Image encoding / decoding method and apparatus

By using intra- or inter-prediction to reconstruct pictures in video encoding and using deblocking filters of multiple filter types, the problem of inefficiency in the block division structure is solved, the quality and efficiency of video encoding are improved, and the block boundary effect is effectively removed.

CN113545041BActive Publication Date: 2025-08-05SAMSUNG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080019186.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-03-21
Filing Date
2020-03-09
Publication Date
2025-08-05
Estimated Expiration
2040-03-09

AI Technical Summary

Technical Problem

The existing video compression technology has problems such as inefficiency in block division structure and prediction methods and is difficult to effectively remove boundary effects, especially in high-resolution and high-definition video encoding.

Method used

The current picture is reconstructed based on intra prediction or inter prediction, and a deblocking filter is applied in the reconstruction picture. Various filter types and predetermined sample grid units are used for filtering, including long, medium and short filters, and personalized filtering is performed for different block boundaries.

Benefits of technology

The loop filtering efficiency is improved, the block boundary effect is effectively removed, the motion compensation and encoding efficiency is improved, and the quality and efficiency of video encoding are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113545041B_ABST
    Figure CN113545041B_ABST
Patent Text Reader

Abstract

According to the image encoding / decoding method and device of the present invention, it is possible to: reconstruct a current picture based on at least one of intra-frame prediction and inter-frame prediction; specify block boundaries to which a deblocking filter is applied in the reconstructed current picture; and apply the deblocking filter to the block boundaries based on a filter type predefined in a decoding device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to video encoding / decoding methods and devices. Background Art

[0002] With the recent increase in demand for high-resolution and high-definition video, there is a growing need for efficient video compression technologies for next-generation video services. In response to this demand, ISO / IEC MPEG and ITU-T VCEG, the organizations that jointly standardize the H.264 / AVC and HEVC video compression standards, formed the JVET (Joint Video Exploration Team) in October 2015 to conduct research and exploration aimed at establishing new video compression standards. In April 2018, the standardization of new video compression standards began, following an evaluation of responses to the CfP (Call for Proposals).

[0003] In video compression technology, a block partition structure refers to the unit used for encoding and decoding, and the unit to which the main encoding and decoding techniques, such as prediction and transform, are applied. With the development of video compression technology, the size of the blocks used for encoding and decoding has gradually increased, and a wider range of partition types are supported. Furthermore, video compression is performed not only using the units used for encoding and decoding, but also using units subdivided according to the function of the block.

[0004] In the HEVC standard, video encoding and decoding are performed using unit blocks that are subdivided according to a quadtree type block division structure and functions for prediction and transformation. In addition to the quadtree type block division structure, various types of block division structures have been proposed, such as QTBT (quadtree plus binary tree) in the form of a combination of quadtree and binary tree, and MTT (Multi-Type Tree) in which a ternary tree is combined with QTBT, to improve video coding efficiency. By supporting various block sizes and various types of block division structures, a picture is divided into multiple blocks, and information in units of coding units, such as coding modes, motion information, and intra-frame prediction direction information corresponding to each block, is expressed in various ways. Therefore, the number of bits expressing information in units of coding units is significantly increased. Summary of the Invention

[0005] Technical issues

[0006] The image encoding / decoding method and apparatus according to the present disclosure provide an in-loop filtering method for reconstructing a picture.

[0007] An image encoding / decoding method and apparatus according to the present disclosure provides a motion compensation method according to a plurality of inter-frame prediction modes.

[0008] Technical Solutions

[0009] The image encoding / decoding method and apparatus according to the present disclosure may reconstruct a current picture based on at least one of intra-frame prediction or inter-frame prediction, specify block boundaries to which a deblocking filter is applied in the reconstructed current picture, and apply the deblocking filter to the specified block boundaries based on a filter type predefined in the encoding / decoding apparatus.

[0010] In the image encoding / decoding method and apparatus according to the present disclosure, the deblocking filter may be applied in units of a predetermined M×N sample grid, where M and N may be integers of 4, 8, or greater.

[0011] In the image encoding / decoding method and apparatus according to the present disclosure, the encoding / decoding apparatus may define a plurality of filter types having different filter lengths, and the plurality of filter types may include at least one of a long filter, a medium filter, or a short filter.

[0012] In the image encoding / decoding method and apparatus according to the present disclosure, the filter length of the long filter may be 8, 10, 12, or 14, the filter length of the medium filter may be 6, and the filter length of the short filter may be 2 or 4.

[0013] In the image encoding / decoding method and apparatus according to the present disclosure, the number of pixels to which a deblocking filter is applied in a P block is different from the number of pixels to which a deblocking filter is applied in a Q block, wherein the P block and the Q block may be adjacent blocks in two directions based on a specified block boundary.

[0014] In the image encoding / decoding method and apparatus according to the present disclosure, the number of pixels to which the deblocking filter is applied in the P block may be 3, and the number of pixels to which the deblocking filter is applied in the Q block may be 7.

[0015] In the image encoding / decoding method and device according to the present disclosure, the step of reconstructing the current picture may include: constructing a merge candidate list of the current block; deriving motion information of the current block according to the merge candidate list; and performing motion compensation on the current block based on the motion information.

[0016] In the image encoding / decoding method and apparatus according to the present disclosure, motion compensation for a current block may be performed based on a predetermined reference region according to a current picture reference mode.

[0017] In the image encoding / decoding method and apparatus according to the present disclosure, the motion vector difference value of the merge mode may be used to correct the motion vector in the derived motion information.

[0018] In the image encoding / decoding method and apparatus according to the present disclosure, correction of a motion vector may be performed only when the size of a current block is greater than a predetermined threshold size.

[0019] Beneficial effects

[0020] In the present disclosure, the efficiency of loop filtering may be improved by applying an in-loop filter in units of a predetermined sample grid but considering boundaries between prediction / transform blocks or sub-blocks thereof.

[0021] Furthermore, the present disclosure can efficiently remove artifacts on the boundaries by filtering the block boundaries based on in-loop filters with different filter lengths.

[0022] Furthermore, the present disclosure may improve the efficiency of motion compensation by adaptively using a plurality of inter prediction modes according to a predetermined priority.

[0023] Furthermore, according to the present disclosure, the encoding efficiency of the current picture reference mode may be improved by adaptively using a reference region according to the current picture reference mode.

[0024] Furthermore, the present disclosure may improve the accuracy of inter-frame prediction parameters of the merge mode and improve the encoding efficiency of the merge mode by selectively using the merge mode based on a motion vector difference value. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a block diagram illustrating an image encoding apparatus according to the present disclosure.

[0026] Figure 2 is a block diagram illustrating an image decoding apparatus according to the present disclosure.

[0027] Figure 3 Target boundaries and target pixels of a deblocking filter according to an embodiment to which the present disclosure is applied are shown.

[0028] Figure 4 Deblocking filtering processes in the filter module 150 of the encoding device and the filter module 240 of the decoding device according to an embodiment to which the present disclosure is applied are illustrated.

[0029] Figure 5 is a diagram illustrating the concept of performing prediction and transformation by dividing one coding block into a plurality of subblocks.

[0030] Figure 6 is a diagram illustrating an example of subblock division of one coding block and the concepts of subblock boundaries and a deblocking filter grid.

[0031] Figure 7is a diagram illustrating the concepts of pixels to be currently filtered and reference pixels used for filtering at a boundary between a P block and a Q block.

[0032] Figure 8 is a diagram illustrating the concepts of pixels to be block filtered at a boundary between a P block and a Q block and at a sub-block boundary within a Q block and reference pixels used for filtering.

[0033] Figure 9 This is a diagram used to explain the basic concept of the current picture reference mode.

[0034] Figure 10 is a diagram illustrating an embodiment of a current picture reference area according to the position of a current block.

[0035] Figures 11 to 14 An embodiment of a searchable and referenceable area including an area of a current block and a current picture reference (CPR) is shown.

[0036] Figure 15 An image encoding / decoding method using a motion vector difference (MVD)-based merge mode is shown as an embodiment to which the present disclosure is applied.

[0037] Figures 16 to 21 A method of determining an inter prediction mode of a current block based on a predetermined priority according to an embodiment to which the present disclosure is applied is illustrated. DETAILED DESCRIPTION

[0038] The image encoding / decoding method and apparatus according to the present disclosure may reconstruct a current picture based on at least one of intra-frame prediction or inter-frame prediction, specify block boundaries to which a deblocking filter is applied in the reconstructed current picture, and apply the deblocking filter to the specified block boundaries based on a filter type predefined in the encoding / decoding apparatus.

[0039] In the image encoding / decoding method and apparatus according to the present disclosure, the deblocking filter may be applied in units of a predetermined M×N sample grid, where M and N may be integers of 4, 8, or greater.

[0040] In the image encoding / decoding method and apparatus according to the present disclosure, the encoding / decoding apparatus may define a plurality of filter types having different filter lengths, and the plurality of filter types may include at least one of a long filter, a medium filter, or a short filter.

[0041] In the image encoding / decoding method and apparatus according to the present disclosure, the filter length of the long filter may be 8, 10, 12, or 14, the filter length of the medium filter may be 6, and the filter length of the short filter may be 2 or 4.

[0042] In the image encoding / decoding method and apparatus according to the present disclosure, the number of pixels to which the deblocking filter is applied in a P block may be different from the number of pixels to which the deblocking filter is applied in a Q block, wherein the P block and the Q block may be adjacent blocks in two directions from a designated block boundary.

[0043] In the image encoding / decoding method and apparatus according to the present disclosure, the number of pixels to which the deblocking filter is applied in the P block may be 3, and the number of pixels to which the deblocking filter is applied in the Q block may be 7.

[0044] In the image encoding / decoding method and device according to the present disclosure, the step of reconstructing the current picture may include: constructing a merge candidate list of the current block; deriving motion information of the current block according to the merge candidate list; and performing motion compensation on the current block based on the motion information.

[0045] In the image encoding / decoding method and apparatus according to the present disclosure, motion compensation for a current block may be performed based on a predetermined reference region according to a current picture reference mode.

[0046] In the image encoding / decoding method and apparatus according to the present disclosure, the motion vector difference value of the merge mode may be used to correct the motion vector in the derived motion information.

[0047] In the image encoding / decoding method and apparatus according to the present disclosure, correction of a motion vector may be performed only when the size of a current block is greater than a predetermined threshold size.

[0048] Implementation Methods of the Present Disclosure

[0049] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings in this specification so that those skilled in the art can easily implement the present disclosure. However, the present disclosure can be implemented in various forms and is not limited to the embodiments described herein. In the accompanying drawings, parts not related to the description are omitted for clarity, and similar reference numerals are attached to similar parts throughout the specification.

[0050] Throughout the specification, when a part is described as being “connected” to another part, this includes not only a direct connection but also an electrical connection with another intervening element. In addition, throughout the specification, when a part “includes” a certain component, this means that other components may also be included rather than excluded unless otherwise specified.

[0051] The terms "(to) a step of" or "a step of" used throughout this specification do not mean "a step for a step of". In addition, terms such as first and second may be used to describe various elements, but the elements should not be limited by these terms. The above terms are only used to distinguish one component from another.

[0052] In addition, the components shown in the embodiments of the present disclosure are shown independently to represent different feature functions, which does not mean that each component is made of a separate hardware or single software component unit. That is, for ease of description, each component unit is described by being listed as its own component unit, and at least two of the component units are combined to form a component unit, or a component unit can be divided into multiple component units to perform functions. As long as the integrated implementation and separate implementation of each of these components do not deviate from the essence of the present disclosure, the integrated implementation and separate implementation of each of these components are also included in the scope of the present disclosure.

[0053] In various embodiments of the present disclosure described below, terms such as “~unit,” “~group,” “~unit,” “~module,” and “~block” mean units that process at least one function or operation, and these units may be implemented in hardware or software or a combination of hardware and software.

[0054] In addition, a coding block refers to a processing unit of a group of target pixels on which encoding and decoding are currently performed, and can be used interchangeably as a coding block and a coding unit. In addition, a coding unit refers to a coding unit (CU), and can generally mean including a coding block (CB).

[0055] In addition, quadtree partitioning refers to partitioning a block into four independent coding units, and binary tree partitioning refers to partitioning a block into two independent coding units. In addition, ternary tree partitioning refers to partitioning a block into three independent coding units at a ratio of 1:2:1.

[0056] Figure 1 is a block diagram illustrating an image encoding apparatus according to the present disclosure.

[0057] Reference Figure 1 The video encoding device 100 may include: a picture partition module 110, prediction modules 120 and 125, a transform module 130, a quantization module 135, a rearrangement module 160, an entropy encoding module 165, an inverse quantization module 140, an inverse transform module 145, a filter module 150 and a memory 155.

[0058] The picture partitioning module 110 may partition an input picture into one or more processing units. Herein, a 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, a coding unit may be used as a unit for performing encoding or a unit for performing decoding.

[0059] The prediction unit can be obtained by dividing one coding unit into at least one square or non-square of the same size, and it can be divided so that one prediction unit among the prediction units divided within one coding unit has a different shape and / or size from another prediction unit. When the prediction unit is not the minimum coding unit when generating a prediction unit for performing intra-frame prediction based on the coding unit, intra-frame prediction can be performed without dividing the coding unit into a plurality of prediction units N×N.

[0060] The prediction modules 120 and 125 may include an inter-frame prediction module 120 for performing inter-frame prediction and an intra-frame prediction module 125 for performing intra-frame prediction. Whether inter-frame prediction or intra-frame prediction is performed for a prediction unit may be determined, and detailed information (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. The residual value (residual block) between the generated prediction block and the original block may be input to the transform module 130. In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded along with the residual value by the entropy encoding module 165 and transmitted to the decoder. However, when the motion information derivation technique performed from the decoder side according to the present disclosure is applied, since the encoder does not generate prediction mode information and motion vector information, the corresponding information is not transmitted to the decoder. Alternatively, the encoder may indicate and transmit information indicating that motion information is derived and used from the decoder side, as well as information regarding the technique used to derive the motion information.

[0061] The inter prediction module 120 can predict the prediction unit based on information of at least one of the previous picture or the subsequent picture of the current picture, or in some cases can predict the prediction unit based on information of some coding areas in the current picture. As the inter prediction mode, various methods can be used, such as merge mode, advanced motion vector prediction (AMVP) mode, affine mode, current picture reference mode and combined prediction mode. In merge mode, at least one motion vector among the spatial / temporal merge candidates can be set to the motion vector of the current block, and inter prediction can be performed using the set motion vector. However, even in merge mode, the preset motion vector can be corrected by adding an additional motion vector difference (MVD) to the preset motion vector. In this case, the corrected motion vector can be used as the final motion vector of the current block, which will be referenced Figure 15A detailed description is given. The affine mode is a method of dividing the current block into predetermined sub-block units and performing inter-frame prediction using a motion vector derived for each sub-block unit. Here, the sub-block unit is represented by N×M, and N and M can be integers of 4, 8, 16 or more, respectively. The shape of the sub-block can be square or non-square. The sub-block unit can be a fixed unit pre-agreed to the encoding device, or can be variably determined in consideration of the size / shape, component type, etc. of the current block. The current picture reference mode is an inter-frame prediction method using a pre-reconstructed area in the current picture to which the current block belongs and a predetermined block vector, which will be referred to Figures 9 to 14 Detailed description. In the combined prediction mode, a first prediction block by inter prediction and a second prediction block by intra prediction are generated for a current block, and predetermined weights are applied to the first prediction block and the second prediction block to generate a final prediction block for the current block. Here, inter prediction can be performed using any of the above-mentioned inter prediction modes. Intra prediction can be performed using only intra prediction modes preset in the encoding device (for example, any one of planar mode, DC mode, vertical / horizontal mode, and diagonal mode). Alternatively, the intra prediction mode used for intra prediction can be derived based on the intra prediction mode of a neighboring block adjacent to the current block (for example, at least one of the left, top, top left, top right, and bottom right). In this case, the number of neighboring blocks to be used can be fixed to one or two, or can be three or more. Even when all the above-mentioned neighboring blocks are available, the use of only one of the left neighboring block or the top neighboring block, or the use of only the left neighboring block and the top neighboring block can be limited. The weight can be determined by considering whether the aforementioned neighboring block is a block encoded in intra mode. Assume that weight w1 is applied to the first prediction block and weight w2 is applied to the second prediction block. In this case, when both the left / upper adjacent blocks are blocks encoded in intra-frame mode, w1 can be a natural number smaller than w2. For example, the ratio of w1 to w2 can be [1:3]. When neither the left / upper adjacent blocks is a block encoded in intra-frame mode, w1 can be a natural number greater than w2. For example, the ratio of w1 to w2 can be [3:1]. When only one of the left / upper adjacent blocks is a block encoded in intra-frame mode, w1 can be set to be the same as w2.

[0062] The inter prediction module 120 may include a reference picture interpolation module, a motion prediction module, and a motion compensation module.

[0063] The reference picture interpolation module can receive reference picture information from the memory 155 and generate pixel information about integer pixels or less than integer pixels based on the reference picture. In the case of luma pixels, an 8-tap DCT-based interpolation filter with different filter coefficients can be used to generate pixel information about integer pixels or less than integer pixels in units of 1 / 4 pixels. In the case of chroma signals, a 4-tap DCT-based interpolation filter with different filter coefficients can be used to generate pixel information about integer pixels or less than integer pixels in units of 1 / 8 pixels.

[0064] The motion prediction module can perform motion prediction based on the reference picture interpolated by the reference picture interpolation module. As a method for obtaining a motion vector, various methods such as a full search based block matching algorithm (FBMA), a three-step search (TSS), and a new three-step search algorithm (NTS) can be used. The motion vector can have a motion vector value in units of 1 / 2 pixels or 1 / 4 pixels based on the interpolated pixels. The motion prediction module can predict the current prediction unit by using various motion prediction methods.

[0065] The intra-frame prediction module 125 can generate a prediction unit based on reference pixel information adjacent to the current block, which is pixel information in the current picture. When the neighboring block of the current prediction unit is a block for which inter-frame prediction has been performed, and the reference pixel is a pixel for which inter-frame prediction has been performed, the reference pixel included in the block for which inter-frame prediction has been performed can be replaced with the reference pixel information of the neighboring block for which intra-frame prediction has been performed. In other words, when a reference pixel is unavailable, the information about the unavailable reference pixel can be replaced with at least one reference pixel from among the available reference pixels.

[0066] In addition, a residual block including residual information that is a difference between a prediction unit on which prediction has been performed based on the prediction units generated by the prediction modules 120 and 125 and an original block of the prediction unit may be generated. The generated residual block may be input to the transform module 130.

[0067] The transform module 130 may use a transform method such as discrete cosine transform (DCT), discrete sine transform (DST), and KLT to transform the residual block including residual information between the original block and the prediction unit generated by the prediction modules 120 and 125. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.

[0068] The quantization module 135 may quantize the value transformed into the frequency domain by the transform module 130. The quantization coefficient may vary according to the block or importance of the picture. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.

[0069] The rearrangement module 160 may rearrange the coefficient values on the quantized residual values.

[0070] The rearrangement module 160 can change the coefficients in the two-dimensional block form into the coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module 160 can use a zigzag scanning method to scan from the DC coefficient to the coefficients in the high frequency domain to change the coefficients into the form of a one-dimensional vector. Depending on the size of the transform unit and the intra-frame prediction mode, the zigzag scan can be replaced by a vertical scan that scans the coefficients in the two-dimensional block form in the column direction or a horizontal scan that scans the coefficients in the two-dimensional block form in the row direction. In other words, it can be determined which scanning method to use among zigzag scanning, vertical scanning and horizontal scanning according to the size of the transform unit and the intra-frame prediction mode.

[0071] The entropy encoding module 165 may perform entropy encoding based on the value calculated by the rearrangement module 160. The entropy encoding may use various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). In this regard, the entropy encoding module 165 may encode residual value coefficient information of the coding units from the rearrangement module 160 and the prediction modules 120 and 125. In addition, according to the present disclosure, information indicating that motion information is derived and used at the decoder side and information about a technique for deriving motion information may be signaled and transmitted.

[0072] The inverse quantization module 140 and the inverse transform module 145 may inversely quantize the value quantized by the quantization module 135 and inversely transform the value transformed by the transform module 130. The residual value generated by the inverse quantization module 140 and the inverse transform module 145 may be combined with a prediction unit predicted by a motion prediction module, a motion compensation module, and an intra prediction module included in the prediction modules 120 and 125 to generate a reconstructed block.

[0073] The filter module 150 may include at least one of a deblocking filter, an offset correction module, or an adaptive loop filter (ALF). The deblocking filter may remove block distortion that occurs due to boundaries between blocks in the reconstructed picture, which will be referred to as Figures 3 to 8Described. The offset correction module can correct the offset relative to the original image in units of pixels in the deblocking filtered image. In order to perform offset correction on a specific picture, a method of applying an offset in consideration of edge information of each pixel can be used, or a method of dividing the pixels included in the image into a predetermined number of areas, determining the areas to be offset, and applying the offset to the determined areas can be used. Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing the filtered reconstructed image with the original image. After the pixels included in the image are divided into predetermined groups, a filter to be applied to the corresponding groups can be determined, and filtering can be performed differently for each group.

[0074] The memory 155 may store the reconstructed block or picture calculated by the filter module 150. When inter-frame prediction is performed, the stored reconstructed block or picture may be provided to the prediction modules 120 and 125.

[0075] Figure 2 is a block diagram illustrating an image decoding apparatus according to the present disclosure.

[0076] Reference Figure 2 The apparatus 200 for decoding a video may include an entropy decoding module 210 , a rearrangement module 215 , an inverse quantization module 220 , an inverse transform module 225 , prediction modules 230 and 235 , a filter module 240 , and a memory 245 .

[0077] When a video bitstream is input to an apparatus for decoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding the video.

[0078] The entropy decoding module 210 may perform entropy decoding according to the inverse process of the entropy encoding performed by the entropy encoding module of the video encoding device. For example, various methods such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), and Context Adaptive Binary Arithmetic Coding (CABAC) may be applied corresponding to the method performed by the video encoding device.

[0079] The entropy decoding module 210 may decode information about intra prediction and inter prediction performed by the encoding apparatus.

[0080] The rearrangement module 215 may perform rearrangement on the bitstream entropy decoded by the entropy decoding module 210 based on the rearrangement method used in the encoding device. The rearrangement module may reconstruct and rearrange coefficients in the form of a one-dimensional vector into coefficients in the form of a two-dimensional block.

[0081] The inverse quantization module 220 may perform inverse quantization based on the quantization parameter received from the encoding apparatus and the rearranged coefficient of the block.

[0082] The inverse transform module 225 can perform inverse transforms on the quantization results generated by the device for encoding the video, i.e., inverse DCT, inverse DST, and inverse KLT corresponding to the transforms performed by the transform module, i.e., DCT, DST, and KLT. The inverse transform can be performed based on the transmission unit determined by the video encoding device. In the inverse transform module 225 of the video decoding device, a transform scheme (e.g., DCT, DST, and KLT) can be selectively performed based on multiple pieces of information such as the prediction method, the size of the current block, and the prediction direction.

[0083] The prediction modules 230 and 235 may generate a prediction block based on the information on prediction block generation received from the entropy decoding module 210 and the information on a previously decoded block or picture received from the memory 245 .

[0084] As described above, if the size of the prediction unit and the size of the transform unit are the same when intra prediction is performed in the same manner as the operation of the video encoding device, intra prediction can be performed on the prediction unit based on the pixels existing in the left, upper left, and top of the prediction unit. However, if the size of the prediction unit and the size of the transform unit are different when intra prediction is performed, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the minimum coding unit.

[0085] The prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module may receive various information from the entropy decoding module 210, such as prediction unit information, prediction mode information of the intra-frame prediction method, and information about motion prediction of the inter-frame prediction method, may divide the current coding unit into prediction units, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction units. On the other hand, if the encoder 100 does not transmit information related to motion prediction for inter-frame prediction, but instead transmits information indicating that motion information is derived and used from the decoder side and information about the technology used to derive the motion information, the prediction unit determination module determines the prediction performance of the inter-frame prediction module 230 based on the information transmitted from the encoder 100.

[0086] The inter-frame prediction module 230 can use the information required for the inter-frame prediction of the current prediction unit provided by the video encoding device to perform inter-frame prediction on the current prediction unit based on information of at least one of the previous picture or the subsequent picture of the current picture including the current prediction unit. In order to perform inter-frame prediction, the inter-frame prediction mode of the prediction unit included in the corresponding coding unit can be determined based on the coding unit. For the inter-frame prediction mode, the aforementioned merge mode, AMVP mode, affine mode, current picture reference mode, combined prediction mode, etc. can also be used in the decoding device, so they are not described in detail herein. The inter-frame prediction module 230 can determine the inter-frame prediction mode of the current prediction unit with a predetermined priority, which will be referred to Figures 16 to 18 Provide a description.

[0087] The intra prediction module 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit that performs intra prediction, intra prediction can be performed based on the intra prediction mode information of the prediction unit received from the video encoding device. The intra prediction module 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and whether to apply the filter can be determined based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block by using the prediction mode of the prediction unit and the AIS filter information received from the device for encoding the video. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0088] When the prediction mode of the prediction unit is a prediction unit that performs intra-frame prediction based on pixel values interpolated from reference pixels, the reference pixel interpolation module can interpolate the reference pixels to generate reference pixels in units of pixels equal to or smaller than integer pixels. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating the reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is the DC mode, the DC filter can generate the prediction block through filtering.

[0089] The reconstructed block or picture may be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.

[0090] The deblocking filter of the video decoding device can receive information about the deblocking filter from the video encoding device and can perform deblocking filtering on the corresponding block. Figures 3 to 8 Provide a description.

[0091] The offset correction module can perform offset correction on the reconstructed image based on the type of offset correction and offset value information applied to the image during encoding. Based on information received from the encoding device regarding whether to apply ALF, ALF coefficient information, etc., ALF can be applied to the coding unit. ALF information can be provided in a manner included in a specific parameter set.

[0092] The memory 245 may store the reconstructed picture or block to be used as a reference picture or block, and may provide the reconstructed picture to the output module.

[0093] Figure 3 Target boundaries and target pixels of a deblocking filter according to an embodiment to which the present disclosure is applied are shown.

[0094] Figure 3 3 is a diagram illustrating block boundaries 320 and 321 between two different blocks (P block and Q block), and the block boundaries can be classified into vertical boundaries and horizontal boundaries.

[0095] exist Figure 3 In

[15] , the Q block region refers to a region where encoding and / or decoding is performed in the current target block, and the P block region refers to a previously reconstructed block that has been reconstructed and is spatially adjacent to the Q block. The P block and the Q block are pre-reconstructed blocks, the Q block may refer to a region where deblocking filtering is currently performed, and the P block may refer to a block spatially adjacent to the Q block.

[0096] Figure 3 is a diagram conceptually showing a P block region and a Q block region to which a deblocking filter is applied, and Figure 3 The embodiment of applying the deblocking filter to the pixels located at the boundary between the P block and the Q block is shown. Therefore, the number of pixels to which the deblocking filter proposed in the present disclosure is applied (hereinafter referred to as the target pixel number) and the number of taps of the deblocking filter are not limited to Figure 3 , and the target number of pixels in each of the P block and the Q block starting from the boundary between the P block and the Q block may be 1, 2, 3, 4, 5, 6, 7, or more. The target number of pixels in the P block may be equal to or different from the target number of pixels in the Q block. For example, the target number of pixels in the P block may be 5, and the target number of pixels in the Q block may be 5. Alternatively, the target number of pixels in the P block may be 7, and the target number of pixels in the Q block may be 7. Alternatively, the target number of pixels in the P block may be 3, and the target number of pixels in the Q block may be 7.

[0097] exist Figure 3 In the embodiment, the case where the target number of pixels of the P block and the Q block is 3 respectively is described.

[0098] exist Figure 3In the illustrated embodiment of the vertical boundary, an example of applying a deblocking filter to the first row 330 of the Q-block region 300 is shown.

[0099] Among the four pixels q0 , q1 , q2 , and q3 belonging to the first row, three pixels q0 , q1 , and q2 adjacent to the vertical boundary are target pixels on which deblocking filtering is performed.

[0100] In addition, Figure 3 In the example of applying a deblocking filter to the first column 331 of the Q block area 301 in the implementation of the horizontal boundary shown, among the four pixels q0, q1, q2, q3 belonging to the first column, the three pixels q0, q1 and q2 adjacent to the horizontal boundary are target pixels on which deblocking filtering is performed.

[0101] However, when deblocking filtering is performed on the corresponding pixel, filtering can be performed by referring to the pixel value of another pixel value (for example, q3) of the target pixel in the first row or the first column on which deblocking filtering is not performed. Alternatively, filtering can be performed by referring to the pixel value of the adjacent row or adjacent column of the first row or the first column. Here, the adjacent row or adjacent column may belong to the current target block or may belong to a block that is spatially adjacent to the current target block (for example, left / right, up / down). The position of the spatially adjacent block can be adaptively determined taking into account the filtering direction (or boundary direction). By reference, it is possible to adaptively determine whether to perform filtering, filtering strength, filter coefficients, the number of filter coefficients, filtering direction, etc. The above-mentioned embodiment can be applied to the embodiment described later in the same / similar manner.

[0102] Figure 3 An example of applying a deblocking filter to a Q-block region is shown, representatively showing the first row 330 and the first column 331, and subsequent rows (second row, third row, etc.) belonging to the Q-block region including the first row and subsequent columns (second column, third column, etc.) belonging to the Q-block region including the first column also undergo the deblocking filter.

[0103] exist Figure 3 In the present invention, the P block region refers to a block region that is spatially adjacent to the vertical boundary or horizontal boundary of the current target block on which encoding and / or decoding is performed, and Figure 3 In the embodiment of the vertical boundary shown in , an example of applying the deblocking filter to the first row 330 of the P-block region 310 is shown.

[0104] Among the four pixels p0, p1, p2, p3 belonging to the first row, three pixels (p0, p1, p2) adjacent to the vertical boundary are target pixels on which deblocking filtering is performed.

[0105] In addition, Figure 3In the example of applying a deblocking filter to the first column 331 of the P block area 311 in the implementation of the horizontal boundary shown, among the four pixels p0, p1, p2, p3 belonging to the first column, the three pixels p0, p1 and p2 adjacent to the horizontal boundary are also target pixels on which deblocking filtering is performed.

[0106] However, when the deblocking filter is performed on the corresponding pixel, filtering may be performed by referring to the pixel value of p3 of the target pixel on which the deblocking filter is not performed.

[0107] Figure 3 An example of applying a deblocking filter to a P-block region is shown, representatively showing the first row 330 and the first column 331, and subsequent rows (second row, third row, etc.) belonging to the P-block region including the first row and subsequent columns (second column, third column, etc.) belonging to the P-block region including the first column also undergo the deblocking filter.

[0108] Figure 4 Deblocking filtering processes in the filter module 150 of the encoding device and the filter module 240 of the decoding device according to an embodiment to which the present disclosure is applied are illustrated.

[0109] Reference Figure 4 , a block boundary (hereinafter, referred to as an edge) related to deblocking filtering among block boundaries of a reconstructed picture may be designated ( S400 ).

[0110] The reconstructed picture can be divided into a predetermined N×M pixel grid (sample grid). The N×M pixel grid can represent a unit for performing deblocking filtering. Here, N and M can be integers of 4, 8, 16 or more. A pixel grid can be defined for each component type. For example, when the component type is a luma component, N and M can be set to 4, and when the component type is a chroma component, N and M can be set to 8. Regardless of the component type, an N×M pixel grid with a fixed size can be used.

[0111] The edge is a block boundary located on an N×M pixel grid and may include at least one of a boundary of a transform block, a boundary of a prediction block, or a boundary of a sub-block. The sub-block may refer to a sub-block according to the aforementioned affine mode. Figure 5 and Figure 6 Describes the block boundaries where the deblocking filter is applied.

[0112] Reference Figure 4 , the decision value of the designated edge can be obtained (S410).

[0113] In this embodiment, it is assumed that the edge type is a vertical edge and a 4×4 pixel grid is applied. The left and right blocks starting from the edge will be referred to as P blocks and Q blocks, respectively. P blocks and Q blocks are pre-reconstructed blocks. Q blocks can refer to the area currently performing deblocking filtering, and P blocks can refer to blocks that are spatially adjacent to Q blocks.

[0114] First, a variable dSam for deriving a decision value may be used to derive a decision value. dSam may be derived for at least one of the first pixel line or the fourth pixel line of a P block and a Q block. Hereinafter, dSam for the first pixel line of a P block and a Q block will be referred to as dSam0, and dSam for the fourth pixel line will be referred to as dSam3.

[0115] If at least one of the following conditions is satisfied, dSam0 may be set to 1, otherwise, dSam0 may be set to 0.

[0116] [Table 1]

[0117]

[0118]

[0119] In Table 1, dpq can be derived based on at least one of the first pixel value linearity d1 of the first pixel line of the P block or the second pixel value linearity d2 of the first pixel line of the Q block. Here, the first pixel value linearity d1 can be derived using i pixels p belonging to the first pixel line of the P block. i can be 3, 4, 5, 6, 7, or more. The i pixels p can be continuous pixels adjacent to each other or non-continuous pixels spaced apart at regular intervals. In this case, the pixels p can be the i pixels closest to the edge among the pixels in the first pixel line. Similarly, the second pixel value linearity d2 can be derived using j pixels q belonging to the first pixel line of the Q block. j can be 3, 4, 5, 6, 7, or more. j is set to the same value as i but is not limited thereto and can be a different value from i. The j pixels q can be continuous pixels adjacent to each other or non-continuous pixels spaced apart at regular intervals. In this case, the pixels q can be the j pixels closest to the edge among the pixels in the first pixel line.

[0120] For example, when three pixels p and three pixels q are used, the first pixel value linearity d1 and the second pixel value linearity d2 can be derived as in the following Equation 1.

[0121] [Formula 1]

[0122] d1=Abs(p2,0-2*p1,0+p0,0)

[0123] d2=Abs(q2,0-2*q1,0+q0,0)

[0124] Alternatively, when six pixels p and six pixels q are used, the first pixel value linearity d1 and the second pixel value linearity d2 may be derived as shown in Equation 2 below.

[0125] [Formula 2]

[0126] d1=(Abs(p2,0-2*p1,0+p0,0)+Abs(p5,0-2*p4,0+p3,0)+1)>>1

[0127] d2=(Abs(q2,0-2*q1,0+q0,0)+Abs(q5,0-2*q4,0+q3,0)+1)>>1

[0128] In Table 1, sp may represent the first pixel value gradient v1 of the first pixel line of the P block, and sq may represent the second pixel value gradient v2 of the first pixel line of the Q block. Here, the first pixel value gradient v1 can be derived using m pixels p belonging to the first pixel line of the P block. m can be 2, 3, 4, 5, 6, 7, or greater. The m pixels p can be continuous pixels adjacent to each other or non-continuous pixels spaced apart at regular intervals. Alternatively, some of the m pixels p can be continuous pixels adjacent to each other, while the remaining pixels can be non-continuous pixels spaced apart at regular intervals. Similarly, the second pixel value gradient v2 can be derived using n pixels q belonging to the first pixel line of the Q block. n can be 2, 3, 4, 5, 6, 7, or greater. n is set to the same value as m, but is not limited thereto, and can be a different value from m. The n pixels q can be continuous pixels adjacent to each other or non-continuous pixels spaced apart at regular intervals. Alternatively, some of the n pixels q can be continuous pixels adjacent to each other, while the remaining pixels can be non-continuous pixels spaced apart at regular intervals.

[0129] For example, when two pixels p and two pixels q are used, a first pixel value gradient v1 and a second pixel value gradient v2 may be derived as shown in the following Equation 3.

[0130] [Formula 3]

[0131] v1=Abs(p3,0-p0,0)

[0132] v2=Abs(q0,0-q3,0)

[0133] Alternatively, when six pixels p and six pixels q are used, the first pixel value gradient v1 and the second pixel value gradient v2 may be derived as shown in Equation 4 below.

[0134] [Formula 4]

[0135] v1=Abs(p3,0-p0,0)+Abs(p7,0-p6,0-p5,0+p4,0)

[0136] v2=Abs(q0,0-q3,0)+Abs(q4,0-q5,0-q6,0+q7,0)

[0137] spq of Table 1 can be derived from the difference between the pixel p0,0 and the pixel q0,0 adjacent to the edge.

[0138] The first and second thresholds in Table 1 can be derived based on a predetermined parameter QP. Here, the QP can be determined using at least one of the first quantization parameter of the P block, the second quantization parameter of the Q block, or an offset used to derive the QP. The offset can be a value encoded and signaled by the encoding device. For example, the QP can be derived by adding the offset to the average of the first and second quantization parameters. The third threshold in Table 1 can be derived based on the aforementioned quantization parameter QP and a block boundary strength (BS). Here, the BS can be variably determined taking into account the prediction mode of the P / Q block, the inter-frame prediction mode, the presence or absence of non-zero transform coefficients, the motion vector difference, and the like. For example, when the prediction mode of at least one of the P block and the Q block is intra mode, the BS can be set to 2. When at least one of the P block or the Q block is encoded in combined prediction mode, the BS can be set to 2. When at least one of the P block or the Q block includes a non-zero transform coefficient, the BS can be set to 1. When the P block is encoded in an inter-frame prediction mode different from that of the Q block (for example, the P block is encoded in the current picture reference mode and the Q block is encoded in the merge mode or AMVP mode), BS may be set to 1. When both the P block and the Q block are encoded in the current picture reference mode and the difference between their block vectors is greater than or equal to a predetermined threshold difference, BS may be set to 1. Here, the threshold difference may be a fixed value (for example, 4, 8, 16) agreed in advance to the encoding / decoding device.

[0139] Since dSam3 is derived by the same method as the above-described dSam0 using one or more pixels belonging to the fourth pixel line, a detailed description thereof will be omitted.

[0140] The decision value may be derived based on the derived dSam0 and dSam3. For example, if both dSam0 and dSam3 are 1, the decision value may be set to a first value (eg, 3), otherwise the decision value may be set to a second value (eg, 1 or 2).

[0141] Reference Figure 4 , a filter type of a deblocking filter may be determined based on the derived decision value (S420).

[0142] In an encoding / decoding device, multiple filter types with different filter lengths can be defined. Examples of filter types include a long filter with the longest filter length, a short filter with the shortest filter length, or one or more medium filters that are longer than the short filter and shorter than the long filter. The number of filter types defined in an encoding / decoding device can be two, three, four, or more.

[0143] For example, when the decision value is the first value, the long filter can be used, and when the decision value is the second value, the short filter can be used. Alternatively, when the decision value is the first value, one of the long filter and the medium filter can be selectively used, and when the decision value is the second value, the short filter can be used. Alternatively, when the decision value is the first value, the long filter can be used, and when the decision value is not the first value, one of the short filter and the medium filter can be selectively used. Specifically, when the decision value is 2, the medium filter can be used, and when the decision value is 1, the short filter can be used.

[0144] Reference Figure 4 , filtering may be performed on the edge of the reconstructed picture based on the deblocking filter according to the determined filter type ( S430 ).

[0145] The deblocking filter can be applied to multiple pixels located in two directions based on the edge and on the same pixel line. Here, the multiple pixels to which the deblocking filter is applied are called the filtering area, and the length of the filtering area (or the number of pixels) can be different for each filter type. The length of the filtering area can be interpreted as being equivalent to the filter length of the above filter type. Alternatively, the length of the filtering area can refer to the sum of the number of pixels to which the deblocking filter is applied in the P block and the number of pixels to which the deblocking filter is applied in the Q block.

[0146] In this embodiment, it is assumed that three filter types, namely, a long filter, a medium filter, and a short filter, are defined in the encoding / decoding device, and the deblocking filtering method for each filter type will be described. However, the present disclosure is not limited thereto, and only the long filter and the medium filter may be defined, only the long filter and the short filter may be defined, or only the medium filter and the short filter may be defined.

[0147] 1. In the case of long filter-based deblocking filtering

[0148] For ease of explanation, it is assumed below that, unless otherwise specified, the edge type is a vertical edge and the pixel currently to be filtered (hereinafter referred to as current pixel q) belongs to block Q. The filtered pixel fq can be obtained by weighted averaging the first reference value and the second reference value.

[0149] Here, the first reference value can be derived using all or part of the pixels of the filtering area to which the current pixel q belongs. Here, the length of the filtering area (or the number of pixels) can be 8, 10, 12, 14 or a larger integer. Some pixels of the filtering area can belong to the P block, and the remaining pixels can belong to the Q block. For example, when the length of the filtering area is 10, five pixels can belong to the P block and five pixels can belong to the Q block. Alternatively, three pixels can belong to the P block and seven pixels can belong to the Q block. Conversely, seven pixels can belong to the P block and three pixels can belong to the Q block. In other words, long filter-based deblocking filtering can be performed symmetrically on the P block and the Q block or can be performed asymmetrically.

[0150] Regardless of the position of the current pixel q, all pixels belonging to the same filtering area can share the same first reference value. That is, regardless of whether the pixel currently to be filtered is located in a P block or a Q block, the same first reference value can be used. Regardless of the position of the pixel currently to be filtered in a P block or a Q block, the same first reference value can be used.

[0151] The second reference value may be derived using at least one of the pixels of the filter area belonging to the Q block or the pixel farthest from the edge (hereinafter referred to as the first pixel) among the adjacent pixels of the filter area. The adjacent pixel may refer to at least one pixel adjacent to the right side of the filter area. For example, the second reference value may be derived as the average value between one first pixel and one adjacent pixel. Alternatively, the second reference value may be derived as the average value between two or more first pixels and two or more adjacent pixels adjacent to the right side of the filter area.

[0152] For weighted averaging, predetermined weights fl and f2 can be applied to the first reference value and the second reference value, respectively. Specifically, the encoding / decoding device can define multiple weight sets and set the weight f1 by selectively using any one of the multiple weight sets. The selection can be performed taking into account the length (or number of pixels) of the filter area belonging to the Q block. For example, the encoding / decoding device can define the weight sets shown in Table 2 below. Each weight set can be composed of one or more weights corresponding to the pixel positions to be filtered. Therefore, from the multiple weights belonging to the selected weight set, a weight corresponding to the position of the current pixel q can be selected and applied to the current pixel q. The number of weights constituting the weight set can be equal to the length of the filter area included in the Q block. The multiple weights constituting a weight set can be sampled at regular intervals within an integer range greater than 0 and less than 64. Here, 64 is only an example and can be greater or less than 64. The predetermined interval can be 9, 13, 17, 21, 25, or more. The interval can be variably determined according to the length (L) of the filter area belonging to the Q block. Alternatively, a fixed interval can be used regardless of L.

[0153] [Table 2]

[0154] Length of the filter region belonging to the Q block (L) Weight Set L>5 {59,50,41,32,23,14,5} 5 {58,45,32,19,6} L<5 {53,32,11}

[0155] Referring to Table 2, when the length (L) of the filter area belonging to the Q block is greater than 5, {59, 50, 41, 32, 23, 14, 5} is selected from the three weight sets. When L is 5, {58, 45, 32, 19, 6} can be selected. When L is less than 5, {53, 32, 11} can be selected. However, Table 2 is only an example of the weight set, and the number of weight sets defined in the encoding / decoding device may be 2, 4, or more.

[0156] Furthermore, when L is 7 and the current pixel is the first pixel q0 from the edge, a weight of 59 may be applied to the current pixel. When the current pixel is the second pixel q1 from the edge, a weight of 50 may be applied to the current pixel, and when the current pixel is the seventh pixel q6 from the edge, a weight of 5 may be applied to the current pixel.

[0157] The weight f2 may be determined based on a predetermined weight f1. For example, the weight f2 may be determined as a value obtained by subtracting the weight f1 from a predefined constant. Here, the predefined constant is a fixed value predefined in the encoding / decoding device and may be 64. However, this is merely an example, and an integer greater than or less than 64 may be used.

[0158] 2. In the case of deblocking filtering based on the median filter

[0159] The filter length of the medium filter may be smaller than that of the long filter. The length (or number of pixels) of the filtering area according to the medium filter may be smaller than that according to the long filter.

[0160] For example, the length of the filter area according to the filter may be 6, 8, or more. Here, the length of the filter area belonging to the P block may be the same as the length of the filter area belonging to the Q block. However, the present disclosure is not limited thereto, and the length of the filter area belonging to the P block may be longer or shorter than the length of the filter area belonging to the Q block.

[0161] Specifically, the filtered pixel fq may be derived using the current pixel q and at least one adjacent pixel adjacent to the current pixel q. Here, the adjacent pixels may include at least one of one or more pixels adjacent to the left side of the current pixel q (hereinafter referred to as left adjacent pixels) or one or more pixels adjacent to the right side of the current pixel q (hereinafter referred to as right adjacent pixels).

[0162] For example, when the current pixel q is q0, two left-neighboring pixels p0 and p1 and two right-neighboring pixels q1 and q2 can be used. When the current pixel q is q1, two left-neighboring pixels p0 and q0 and one right-neighboring pixel q2 can be used. When the current pixel q is q2, three left-neighboring pixels p0, q0, q1 and one right-neighboring pixel q3 can be used.

[0163] 3. In the case of short filter-based deblocking filtering

[0164] The filter length of the short filter may be smaller than the filter length of the medium filter. The length (or number of pixels) of the filter area of the short filter may be smaller than the length of the filter area of the medium filter. For example, the length of the filter area of the short filter may be 2, 4, or more.

[0165] Specifically, the filtered pixel fq can be obtained by adding or subtracting a predetermined first offset (offset1) from the current pixel q. Here, the first offset can be determined based on the difference between the pixels of the P block and the pixels of the Q block. For example, as shown in the following formula 5, the first offset can be determined based on the difference between the pixel p0 and the pixel q0 and the difference between the pixel p1 and the pixel q1. However, filtering can be performed on the current pixel q only when the first offset is less than a predetermined threshold. Here, the threshold is derived based on the aforementioned quantization parameter QP and the block boundary strength (BS), and a detailed description thereof will be omitted.

[0166] [Formula 5]

[0167] offset1=(9*(q0-p0)-3*(q1-p1)+8)>>4

[0168] Alternatively, the filtered pixel fq can be obtained by adding a predetermined second offset (offset2) to the current pixel q. Here, the second offset can be determined by considering at least one of the difference (or change) between the current pixel q and the adjacent pixel or the first offset. Here, the adjacent pixel can include at least one of the left pixel or the right pixel of the current pixel q. For example, the second offset can be determined as shown in the following equation 6.

[0169] [Formula 6]

[0170] offset2=(((q2+q0+1)>>1)-q1-offset1)>>1

[0171] Will refer to Figure 7 and Figure 8The above filtering method is not limited to being applied only to the deblocking filter, and can be applied similarly to adaptive sample offset (SAO) as an example of an in-loop filter, an adaptive in-loop filter (ALF), etc.

[0172] Figure 5 is a diagram illustrating a concept of performing prediction and transformation by dividing one coding block into a plurality of sub-blocks.

[0173] like Figure 5 As shown, one coding block can be divided into two or four in one direction in the horizontal direction or the vertical direction to perform prediction or transform. The coding block can also be understood as a decoding block. In this case, only prediction can be performed by dividing the coding block into two or four in one direction in the horizontal direction or the vertical direction, or both prediction and transform can be performed by dividing the coding block into two or four, or only transform can be performed by dividing the coding block into two or four.

[0174] In this case, by splitting a single coding block into two or four in a horizontal direction or a vertical direction, intra prediction and transform may be performed in each split unit.

[0175] Figure 5 The number of partitions is not limited, and the block can be divided into 3, 5 or more. Here, the number of partitions can be variably determined based on block attributes. Block attributes can refer to coding parameters such as block size / shape, component type (luminance, chrominance), prediction mode (intra-frame prediction or inter-frame mode), inter-frame prediction mode (inter-frame prediction mode predefined in the decoder, such as merge mode, AMVP mode, affine mode, etc.), prediction / transformation unit, and the position or length of block boundaries.

[0176] Alternatively, one of non-division or two-division may be selectively used, and one of non-division or four-division may be selectively used. Alternatively, any one of non-division, two-division, and four-division may be selectively used.

[0177] according to Figure 5 In the embodiment shown, when a coding block 510 is vertically divided into two sub-blocks, the width (W) (511) of the block can be equally divided into two, so that the width of the divided sub-block is W / 2 (513). When a coding block 520 is horizontally divided into two sub-blocks, the height (H) (522) of the block can be equally divided into two, so that the height of the divided sub-block is H / 2 (523).

[0178] In addition, according to Figure 5In another embodiment shown, when a coding block 530 is vertically divided into four sub-blocks, the width (W) (531) of the block can be equally divided into four, so that the divided sub-blocks have a width of W / 4 (533). When a coding block 540 is horizontally divided into four sub-blocks, the height (H) (542) of the block can be equally divided into four, so that the divided sub-blocks have a width of H / 4 (543).

[0179] In addition, according to an embodiment of the present disclosure, in the case of a sub-block intra prediction mode in which prediction is performed by dividing the current coding block into multiple sub-blocks, the current coding block can be transformed in the same shape as the sub-block for which prediction is performed. In this case, the transform unit can be divided into a unit having the same size / shape as the sub-block, or multiple transform units can be combined. Alternatively, conversely, the sub-block unit can be determined based on the transform unit, and intra prediction can be performed in the sub-block unit. The above-described embodiment can be applied in the same / similar manner to the embodiments described later.

[0180] In addition, according to Figure 5 In another embodiment shown, when a coding block 530 is vertically divided into four sub-blocks, the width (W) 531 of the block is equally divided into four, so that the divided sub-blocks have a width of W / 4 (433). When a coding block 440 is horizontally divided into four sub-blocks, the height (H) 542 of the block is equally divided into four, so that the divided sub-blocks have a height of H / 4 (543).

[0181] In addition, according to an embodiment of the present disclosure, in the case of a subblock intra prediction mode in a mode in which prediction is performed by dividing the current coding block into multiple subblocks, the current coding block may be transformed in the same shape as the subblock on which prediction is performed.

[0182] When a coding block is divided into two or four sub-blocks to perform intra-frame prediction and transformation based on the sub-blocks, blocking effects may occur at the boundaries of the sub-blocks. Therefore, when intra-frame prediction is performed in units of sub-blocks, deblocking filtering can be performed at the boundaries of each sub-block. Deblocking filtering can be performed selectively, and flag information can be used for this purpose. Flag information can indicate whether filtering is performed on the boundaries of sub-blocks. Flag information can be encoded by the encoding device and notified to the decoding device with a signal, or the flag information can be derived from the decoding device based on the block properties of at least one of the current block and the adjacent blocks. The block properties are the same as described above, and their detailed description will be omitted.

[0183] When deblocking filtering is performed on one coding block, if the current coding block is a block on which prediction and transformation are performed by intra prediction in units of subblocks, deblocking filtering may be performed in units of subblocks within the current block.

[0184] When performing deblocking filtering on a coded block, when the current coded block is a block that is predicted and transformed by intra prediction in units of sub-blocks, but the boundaries of the sub-blocks do not lie on the block grid (N×M sample grid) used for performing deblocking filtering, deblocking filtering is skipped at the boundaries of the corresponding sub-blocks. Deblocking filtering can be performed at the boundaries of the sub-blocks only when the boundaries of the corresponding sub-blocks lie on the block grid used for performing deblocking filtering.

[0185] In this case, the block grid used for performing deblocking filtering means the smallest block boundary unit to which deblocking filtering can be applied, and the block grid can mean the smallest pixel interval between the previous block boundary and the next block boundary. Generally, 8×8 can be used as the block grid. However, this is not limited to 8×8 blocks, and 4×4 or 16×16 can also be used. Different sizes of block grids can be used according to the component type. For example, a block grid smaller than the size of the chrominance component can be used for the luminance component. A fixed-size block grid for each component type can be used.

[0186] As Figure 5 shown, when dividing a coded block into two in one of the horizontal or vertical directions, the coded block can be divided into asymmetric sub-blocks.

[0187] In this case, Figure 5 an embodiment showing the case of asymmetrically dividing a coded block into two in one of the horizontal or vertical directions is shown.

[0188] The current coded block 550 is vertically divided into two sub-blocks such that the first sub-block includes a sub-block with a height of H and a width of W / 4, and the second sub-block includes a sub-block with a height of H and a width of 3*W / 4.

[0189] In addition, the current coded block 560 is horizontally divided into two sub-blocks such that the first sub-block includes a sub-block with a height of H / 4 and a width of W, and the second sub-block includes a sub-block with a height of H / 4 and a width of W.

[0190] Independent transformation and / or inverse transformation can be performed in units of sub-blocks, and transformation and / or inverse transformation can be performed only in certain sub-blocks of the current coded block. Here, certain sub-blocks can mean N sub-blocks located on the left or above the current target block. N can be 1, 2, 3, etc. N can be a fixed value pre-agreed with the decoding device, or N can be variably determined considering the aforementioned block attributes.

[0191] The transformation process for certain sub-blocks can be restricted to be performed only when the shape of the current target block is rectangular (W>H, W<H). Alternatively, it can be restricted to be performed only when the size of the current target block is greater than or equal to a threshold size.

[0192] Even in the case of a coding block in which transformation and inverse transformation are performed only on some subblocks of the current coding block, the above-described subblock-unit deblocking filtering process can be similarly applied.

[0193] Figure 6 is a diagram illustrating an example of subblock partitioning for one coding block and the concept of subblock boundaries and a deblocking filter grid.

[0194] Figure 6 The diagram illustrates a case where a 16×8 coding block 600 is vertically divided into four 4×8 sub-blocks 610 to 613. In this case, a total of three sub-block boundaries may occur. Examples include a first sub-block boundary 620 occurring between the first sub-block 610 and the second sub-block 611, a second sub-block boundary 621 occurring between the second sub-block 611 and the third sub-block 612, and a third sub-block boundary 622 occurring between the third sub-block 612 and the fourth sub-block 613.

[0195] In this case, only the second subblock boundary 621 exists on the deblocking filter grid as a subblock boundary existing on the deblocking filter grid performed by applying the deblocking filter among the subblock boundaries.

[0196] Therefore, when the current coding block is a block predicted and transformed by intra-frame prediction of the sub-block partition unit, when performing deblocking filtering, the deblocking filter can be performed only at the block boundaries existing on the deblocking filter grid. Alternatively, different deblocking filters can be applied to the second sub-block boundary and the first sub-block boundary. That is, at least one of the following can be different: filter coefficients, number of taps, and strength of the deblocking filter.

[0197] A block grid for performing a deblocking filter may be configured in units of N pixels, where N is a predefined specific integer, and one or more of 4, 8, 16, 32, etc. may be adaptively used.

[0198] For a detailed description of the present disclosure, use Figure 6 The embodiment shown in .

[0199] Figure 6 An embodiment is shown in which one 16×8 coding block is vertically divided into four subblocks and prediction and transform are performed through intra prediction in subblock units.

[0200] In this case, a single 16×8 coding block is divided into four 4×8 sub-blocks and is reconstructed by performing intra prediction and transform in sub-block units, and is input to the deblocking filtering step.

[0201] One coding block input to the deblocking filtering step includes: a first vertical boundary 621 between the first subblock 610 and the second subblock 611, a second vertical boundary 620 between the second subblock 611 and the third subblock 612, and a third vertical boundary 622 between the third subblock 612 and the fourth subblock 613.

[0202] In this case, when the block grid of the current deblocking filter is 8×8, the subblock boundary existing on the deblocking filter grid among the subblock boundaries is only the second vertical boundary 620 .

[0203] According to an embodiment of the present disclosure, when the current coding block is a block predicted and / or transformed by intra prediction in sub-block units, deblocking filtering can be performed on both sub-block boundaries present on the deblocking filter grid (e.g., the second vertical boundary 620) and sub-block boundaries not present on the deblocking filter grid (e.g., the first vertical boundary 621 and the third vertical boundary 622). In this case, the characteristics of the deblocking filter applied to each boundary (e.g., at least one of the following: strength, number of taps, coefficients, position / number of input pixels, etc.) can be different.

[0204] According to another embodiment of the present disclosure, when the current coding block is a block on which prediction and / or transformation is performed by intra-frame prediction in sub-block units, deblocking filtering may be performed only on sub-block boundaries present on the deblocking filter grid (e.g., the second vertical boundary 620), and deblocking filtering may not be performed on sub-block boundaries not present on the deblocking filter grid (e.g., the first vertical boundary 621 and the third vertical boundary 622).

[0205] In addition, in the case of the deblocking filter proposed in the present disclosure, when deblocking filtering is performed on a coding block and the current coding block is a block on which prediction and / or transformation is performed by intra-frame prediction in sub-block units, deblocking filtering can be performed on pixels different from the coding block, the coding block has the same size as the current coding block, different deblocking filter strengths can be used, or different numbers of deblocking filter taps can be applied.

[0206] In an embodiment of the present disclosure, when the current coding block is smaller than a specific block size M, deblocking filtering may be performed on N pixels located in a Q block (a block to which deblocking filtering is currently applied), where the Q block is located at at least one boundary of a transform block (TB), a prediction block (PB), or a coding block (CB) present on a block grid for deblocking filtering.

[0207] In this case, when the current coding block is a block on which prediction and / or transformation is performed by intra prediction in subblock units, deblocking filtering may be performed on (N+K) pixels located in a Q block.

[0208] In this case, M may mean the width or height of the block, and M may be 16, 32, 64, or 128.

[0209] In addition, in this case, N represents the number of pixels adjacent to the block boundary included in the P block (blocks adjacent to the block and block boundary of the currently applied deblocking filter) and the Q block (block to which the deblocking filter is currently applied), and N can be an integer of 1, 2, 3, 4, 5, 6, 7 or more.

[0210] In addition, when the current coding block is a block on which prediction and / or transformation is performed by intra prediction in sub-block units, K represents the number of pixels to be additionally subjected to deblocking filtering among the pixels adjacent to the block boundary included in the Q block, and K can have one of an integer from 0 to N minus the width and height of the current block.

[0211] In another embodiment of the present disclosure, when the current coding block is a block on which prediction and / or transformation is performed by intra-frame prediction in sub-block units, a deblocking filter strength different from the filter applied to N pixels can be used for K pixels located in the Q block.

[0212] In addition, when the current coding block is a block on which prediction and transformation are performed by intra prediction in sub-block units, a deblocking filter different from the filter applied to N pixels may be applied to K pixels located in Q blocks. The above-mentioned different filters may mean that at least one or more of the following are different: filter strength, coefficient value, number of taps, and number / position of input pixels.

[0213] Figure 7 is a diagram showing the concept of pixels currently to be filtered and reference pixels used for filtering at the boundary between a P block and a Q block.

[0214] Figure 7 is a diagram showing an example of pixels to be subjected to deblocking filtering and reference pixels used for filtering at a boundary between a P block and a Q block when a deblocking filter is applied to a horizontal boundary.

[0215] Figure 7 A Q block 700 as a block currently subjected to deblocking filtering, a P block 710 as a block adjacent to the upper space, and a boundary 720 between the P block and the Q block are shown. Target pixels to which deblocking filtering is applied in the P block are a total of three pixel rows adjacent to the block boundary 720, and Figure 7The concept of reference pixels for performing filtering in each pixel row is shown in 713, 712 and 711 of FIG. Figure 7 An implementation is shown for horizontal boundaries.In the present disclosure, when applying a deblocking filter to vertical boundaries, all concepts of the present disclosure described above or below are applied to pixel columns rather than pixel rows.

[0216] exist Figure 7 In 713, the target pixel for deblocking filtering is pixel p2, which is the third pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel p2 are pixels p3, p2, p1, p0, and q0. In this case, pixel p2 can be set to a value p2' that is a weighted average value of the five pixels p3, p2, p1, p0, and q0 using predefined weights. However, in this case, the weighted average value p2' is used as a value within a range of values obtained by adding or subtracting a specific offset value from the value of p2.

[0217] exist Figure 7 In 712, the target pixel for deblocking filtering is pixel p1, which is the second pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel p1 are pixels p2, p1, p0, and q0. In this case, pixel p1 can be set to a value p1' that is a weighted average value of the four pixels p2, p1, p0, and q0 using predefined weights. However, in this case, the weighted average value p1' is used as a value within a range of values obtained by adding or subtracting a specific offset value from the value of p1.

[0218] exist Figure 7 In 711, the target pixel for deblocking filtering is pixel p0, which is the first pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel p0 are pixels p2, p1, p0, q0, and q1. In this case, pixel p0 may be set to a value p0' that is a weighted average value of the five pixels p2, p1, p0, q0, and q1 using a predefined weight. However, in this case, the weighted average value p0' is used as a value within a range of values within which a specific offset value is added or subtracted from the value of p0.

[0219] Similarly, the target pixels to which the deblocking filter is applied in the Q block are a total of three pixel rows adjacent to the block boundary 720, and Figure 7 The concept of reference pixels for performing filtering in each pixel row is shown in 703, 702 and 701 of FIG. Figure 7 An implementation is shown for horizontal boundaries.In the present disclosure, when applying a deblocking filter to vertical boundaries, all concepts of the present disclosure described above or below are applied to pixel columns rather than pixel rows.

[0220] exist Figure 7 In 703, the target pixel for deblocking filtering is pixel q2, which is the third pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel q2 are pixels q3, q2, q1, q0, and p0. In this case, pixel q2 can be set to a value p2' that is a weighted average value of the five pixels q3, q2, q1, q0, and p0 using predefined weights. However, in this case, the weighted average value q2' is used as a value within a range of values obtained by adding or subtracting a specific offset value from the value of q2.

[0221] exist Figure 7 In 702, the target pixel for deblocking filtering is pixel q1, which is the second pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel q1 are pixels q2, q1, q0, and p0. In this case, pixel q1 can be set to a value q1' that is a weighted average value of the four pixels q2, q1, q0, and p0 using predefined weights. However, in this case, the weighted average value q1' is used as a value within a range of values obtained by adding or subtracting a specific offset value from the value of q1.

[0222] exist Figure 7 In 701, the target pixel for deblocking filtering is pixel q0, which is the first pixel from the boundary, and the pixels referenced for performing deblocking filtering on pixel q0 are pixels q2, q1, q0, p0, and p1. In this case, pixel p0 can be set to a value q0' that is a weighted average value of the five pixels q2, q1, q0, p0, and p1 using a predefined weight. However, in this case, the weighted average value q0' is used as a value within a range of values within which a specific offset value is added or subtracted from the value of q0.

[0223] Figure 8 is a diagram showing the concept of pixels to be subjected to block filtering and reference pixels used for filtering at a boundary between a P block and a Q block and a sub-block boundary within a Q block.

[0224] and Figure 7 Unlike the method shown in which deblocking filtering is performed only at the boundary between P blocks and Q blocks, even if it is not located on the block grid of the deblocking filter, when the Q block is a block that performs sub-block based intra prediction or sub-block based transform, blocking artifacts may appear at the sub-block boundary. In order to effectively remove the blocking artifacts, Figure 8 An embodiment is shown in which a deblocking filter is additionally applied even to pixels located at sub-block boundaries within a Q-block.

[0225] remove Figure 7 In addition, Figure 8 In , the target pixels for deblocking filtering are a total of three pixel rows adjacent to the block boundary 720 and an additional N pixel rows of the sub-block boundary 800 existing within the block. Figure 8 The concept of performing filtering on the additional N pixel rows of the sub-block boundary and the concept of reference pixels are shown in 801 and 802. However, Figure 8 An implementation for a horizontal boundary is shown. In the present disclosure, when applying a deblocking filter to a vertical boundary, all concepts of the present disclosure described above or below are applied to pixel columns rather than pixel rows.

[0226] in addition, Figure 8 A case is shown in which N is 2 as an embodiment of additional N pixel rows of the sub-block boundary 800 , but the present disclosure is not limited thereto, and N may be 4 or 8 as an embodiment of the present disclosure.

[0227] exist Figure 8 In 801, the target pixel for deblocking filtering is pixel q3, which is the first pixel on the upper or left side from the sub-block boundary 500, and the pixels referenced for performing deblocking filtering on pixel q3 are pixels q2, q3, q4, and q5. In this case, pixel q3 can be set to a value q3' that is a weighted average value using a predefined weight and four pixels q2, q3, q4, and q5. However, in this case, the weighted average value q3' is used as a value within a range of values that are added or subtracted from a specific offset value from the value of q3. In addition, the pixels q2, q4, and q5 are not limited to Figure 8 , and it may mean a pixel at a predefined position (e.g., +1, +2, -1, -2, or +N, -N) at an integer pixel distance from a sub-block boundary.

[0228] exist Figure 8 In 802, the target pixel for deblocking filtering is pixel q4, which is the first pixel at the bottom or right from the sub-block boundary 800, and the pixels referenced for performing deblocking filtering on pixel q4 are pixels q2, q3, q4, and q5. In this case, pixel q4 can be set to a q4' value that is a weighted average value of the four pixels q2, q3, q4, and q5 using a predefined weight. However, in this case, the weighted average value q4' is used as a value within a range of values that are added or subtracted from a specific offset value from the q4 value. In addition, the q2, q3, and q5 pixels are not limited to Figure 8 , and it may mean pixels at predefined positions (e.g., +1, +2, -1, -2, or +N, -N) that are integer pixel distances from a sub-block boundary.

[0229] In the above embodiment, filtering using 4 pixels is used as an example of a deblocking filter for a sub-block boundary, but in the present disclosure, 5 pixels or 3 pixels may be referenced for the target pixels of the deblocking filter. In addition, the number of reference pixels used for deblocking filtering may differ from one another depending on the position.

[0230] Figure 9 This is a diagram for explaining the basic concept of the current picture reference mode.

[0231] like Figure 9 As shown, the current picture reference technology is a technology for performing prediction in a reconstructed area of the same picture as the current block when performing prediction on the current block.

[0232] When the right Figure 9 When encoding or decoding a current block 910 of a current picture 900 of a pre-reconstructed image, a pre-reconstructed region 901 may exist according to the encoding and decoding order, and an area having pixel similarity with the current block 110 may exist. Therefore, the current picture reference technique is defined as a technique in which, based on pixel similarity, a reference block 930 similar to the current block 910 exists in the region 901 of the pre-reconstructed current picture, and prediction is performed using the reference block 930.

[0233] Information about whether the current picture is referenced may be encoded and signaled by the encoding device, or may be derived from the decoding device. In this case, the information is derived based on the size, shape, position, partition type (e.g., quadtree, binary tree, ternary tree) of the block, the prediction mode of the block, the position / type of the tile or tile group to which the block belongs, etc. Here, the block may refer to at least one of the current block and the adjacent blocks adjacent to the current block.

[0234] In this case, the pixel distance between the current block 910 and the reference block 930 is defined as a vector, and the vector is called a block vector.

[0235] When encoding the current picture reference mode, information about the block vector can be derived using methods such as skipping, merging, and differential signaling using a block vector prediction method similar to inter-frame prediction. For example, the block vector can be derived from the neighboring blocks of the current block. In this case, the neighboring blocks can be limited to blocks encoded in the current picture reference mode, or can be limited to blocks encoded in merge mode (or skip mode). The neighboring blocks can be limited to blocks encoded in other prediction modes (AMVP mode, affine mode, etc.) predefined in the decoding device. Alternatively, the block vector can be derived based on information specifying the position of the reference block (e.g., a block index).

[0236] Figure 10 is a diagram illustrating an embodiment of a current picture reference area according to the position of a current block.

[0237] Figure 10 An embodiment in which the current block is located at the boundary of a tile group, a tile, or a picture and belongs to the leftmost CTU is shown in detail.

[0238] Figure 9 The search range of the current picture reference for the current block, ie, the reference area, is shown.

[0239] Figure 10 The embodiment of dividing the current picture 1000 into tile group A 1050 and tile group B 1060 is shown. In this case, a tile group is one method of dividing a picture, and a tile can also correspond to this. A tile group can include one or more tiles. In the following, a tile group can be understood as a tile.

[0240] exist Figure 10 , tile group A 1050 includes CTUs 1001, 1002, 1006, 1007, 1011, and 1012, and tile group B 1060 includes CTUs 1003, 1004, 1005, 1008, 1009, 1010, 1013, 1014, and 1015.

[0241] The predefined reference region for the current picture reference may mean Figure 9 A partial area of a reconstructed area 901 in the current picture 900 is shown. In addition, the partial area may be at least one of the following: a current CTU including the current block, a left CTU spatially adjacent to the current CTU, or an upper CTU.

[0242] In particular, when the CTU including the current block is the leftmost CTU of the current tile group, the current tile, or the current picture, the CTU including the current block and a spatially adjacent upper CTU may be referenced.

[0243] Figure 10 The illustrated block A 1051 is an embodiment for the case where the current block is included in the leftmost CTU of the current picture 1000. When the current block is included in block A 1051, the region that the current block can refer to for current picture reference may correspond to a region that is pre-reconstructed according to the encoding and decoding order within the current CTU (block A).

[0244] Besides, in the present disclosure, when the CTU including the current block is the leftmost CTU of the current picture 1000 , the spatially adjacent upper CTU 1006 is used as a reference region for a case where a spatially adjacent upper CTU exists.

[0245] When there is no available CTU to the left of the CTU to which the current block belongs (hereinafter referred to as the current CTU), the current picture reference may be performed using only the reconstructed area within the current CTU, or the current picture reference may be set not to be performed. Alternatively, the current reference picture may be set to reference a specific area pre-reconstructed before the current CTU. This specific area may belong to the same tile or tile group, or may be P CTUs decoded immediately before the current CTU. P may be 1, 2, 3, or greater. The value of N may be a fixed value predefined in the encoding / decoding device, or may be variably determined according to the position of the current CTU and / or the current block.

[0246] In addition, the CTU 207 on which encoding and decoding have been previously performed according to the encoding and decoding order may be used as a reference region.

[0247] Figure 10 The illustrated block B 1061 is a CTU included in the tile group B, which is the second tile group of the current picture 1000. This is an embodiment for the case where it is located at the leftmost side of the tile group B and at the tile group boundary. When the current block is a block included in block B 1061, the area that the current block can refer to for performing current picture reference may correspond to an area that has been pre-reconstructed according to the encoding and decoding order within the current CTU (block B).

[0248] Besides, in the present disclosure, when the CTU including the current block is the leftmost CTU of the current tile group 1060 , the spatially adjacent upper CTU 1003 is used as a reference area for a case where a spatially adjacent upper CTU exists.

[0249] In addition, the CTU 1005 on which encoding and decoding have been previously performed according to the encoding and decoding order is used as a reference area.

[0250] Additionally, in the present disclosure, in the above description, the concept of a tile may be used to replace the concept of a tile group.

[0251] In addition, in the present disclosure, when the CTU including the current block is a CTU located at the left boundary of a tile or a tile group, the CTU located to the left of the current CTU can be used as a reference area only when the current tile or tile group is a tile or tile group that allows prediction between tiles or tile groups. To this end, information about the prediction / reference relationship between tiles or tile groups can be encoded. For example, the information may include at least one of the following: whether reference between tiles is allowed, whether the current tile references another tile, the number of tiles belonging to a picture, an index specifying the position of a tile, the number / position of the referenced tiles, etc. The information can be sent by signal at at least one level of a video sequence, a picture, a tile group, or a tile.

[0252] Figure 11 An embodiment of a searchable and referenceable area of a current picture reference (CPR) and an area including a current block is shown.

[0253] The current CTU is shown to be divided into multiple VPDUs. A VPDU refers to the largest unit that can be encoded and decoded at once, reducing the cost of hardware implementation for the CTU as the size of the CTU increases. Here, a VPDU may refer to a block having at least one of a width or a height smaller than a CTU. When the partition depth of the CTU is k, a VPDU may be defined as a block having a partition depth of (k+1) or (k+2). The shape of a VPDU may be square or non-square, but may be limited to a square shape if necessary.

[0254] In addition, the size of the VPDU may be a predefined arbitrary size or a quarter of the size of the CTU. In this case, the predefined arbitrary size may be 64×64, 32×32, or 128×128.

[0255] Figure 11 A CTU 1110 including the current block and a spatially adjacent CTU 1100 on the left are shown. In this case, a search range, ie, a reference area, for a current picture reference of the current block may be predefined.

[0256] In particular, only when the current block is included in the first VPDU 1111 of the current CTU 1110, all or part of all pixel regions of the left adjacent CTU 1100 may be used as a reference region. Figure 11 In the illustrated embodiment, a region pre-reconstructed according to the encoding and decoding order among the second VPDU 1102 , the third VPDU 1103 , the fourth VPDU 1104 excluding the first VPDU 1101 of the left adjacent CTU 1100 and the VPDU 1111 including the current block may be used as a reference region.

[0257] like Figure 11 As shown, according to an embodiment of the present disclosure, when spatially neighboring CTUs are used as search and reference regions for a current picture reference (CPR), only some regions in the spatially neighboring CTUs may be used.

[0258] Only the N CTUs encoded / decoded immediately before the current CTU in the encoding / decoding order may be used. Alternatively, only the M VPDUs encoded / decoded immediately before the current VPDU in the encoding / decoding order may be used. Here, N and M may be integers of 1, 2, 3, 4, or more, and may be the same or different. This number may be a predefined value in the encoding / decoding device or variably determined based on block availability. The M VPDUs may be restricted to belonging to the same CTU (or tile, or tile group). Alternatively, at least one of the M VPDUs may be restricted to belonging to a different CTU (or tile, or tile group) than the other VPDUs. At least one of the above restrictions may be set based on the position and / or scanning order of the current block or VPDU. Here, the term "position" may be interpreted in various ways, such as within a CTU, within a tile, and within a tile group. The above embodiments may also be applied in the same or similar manner as the following embodiments.

[0259] Figure 11 It is shown that the reference area in the left adjacent CTU 1100 is changed for cases where the current block is included in the second VPDU 1112 , the third VPDU 1113 , and the fourth VPDU 1114 of the current CTU 1110 , respectively.

[0260] When the current block is included in the second VPDU 1112 of the current CTU 1110, not all pixel regions of the left adjacent CTU 1100 may be used as reference regions, but only some regions may be used as reference regions. Figure 11 In the illustrated embodiment, the third VPDU 1103 and the fourth VPDU 1104 of the left adjacent CTU 1100, excluding the first VPDU 1101 and the second VPDU 1102, can be used as a reference region. Furthermore, in the first VPDU 1111 of the current CTU 1110 and the second VPDU 1112 including the current block, a region pre-reconstructed according to the encoding and decoding order can be used as a reference region.

[0261] In addition, when the current block is included in the third VPDU 1113 of the current CTU 1110, not all pixel regions of the left adjacent CTU 1100 may be used as reference regions, but only some regions may be used as reference regions. Figure 11In the illustrated embodiment, in addition to the first VPDU 1101, the second VPDU 1102, and the third VPDU 1103 of the left adjacent CTU 1100, the fourth VPDU 1104 can be used as a reference region. Furthermore, in the first VPDU 1111 and the second VPDU 1112 of the current CTU 1110, and the third VPDU 1113 including the current block, a region pre-reconstructed according to the encoding and decoding order can be used as a reference region.

[0262] In addition, when the current block is included in the fourth VPDU 1113 of the current CTU 1110, only the pre-reconstructed area within the current CTU 1110 may be used as a reference area without using the left adjacent CTU 1100 as a reference area.

[0263] Figure 12 Another embodiment of a searchable and referenceable area including an area of a current block and a current picture reference (CPR) is shown.

[0264] Figure 12 An additional embodiment is shown in which the VPDU execution order differs from the existing z-scan order according to the partitioning form of the current CTU 1210 .

[0265] When the current CTU 1210 is vertically divided and the VPDU execution order is the first VPDU 1211, the third VPDU 1213, the second VPDU 1212, and the fourth VPDU 1214, and the current block is currently included in the third VPDU 1213 of the CTU 1210, the second VPDU 1202 and the fourth VPDU 1204 of the left adjacent CTU 1200, excluding the first VPDU 1201 and the third VPDU 1203, can be used as a reference area. Alternatively, a region pre-reconstructed according to the encoding and / or decoding order within the first VPDU 1211 of the current CTU 1210 and the third VPDU 1213 including the current block can be used as a reference area. In the above embodiment, this means that the region spatially adjacent to the current VPDU in the left CTU is first referenced.

[0266] Additionally, according to the VPDU execution order, when the VPDU execution order is the first VPDU 1211, the third VPDU 1213, the second VPDU 1212, and the fourth VPDU 1214 due to the vertical division in the left CTU, it can be as in the above method ( Figure 12 A) Designate the reference area.

[0267] and Figure 12Unlike the previous embodiment of A, when the current CTU 1210 is vertically divided so that the VPDUs are performed in the order of the first VPDU 1211, the third VPDU 1213, the second VPDU 1212, and the fourth VPDU 1214, and the current block is included in the third VPDU 1213 of the current CTU 1210, the third VPDU 1203 and the fourth VPDU 1204 of the left adjacent CTU 1200, excluding the first VPDU 1201 and the second VPDU 1202, can be used as a reference area. In addition, a region pre-reconstructed according to the encoding and decoding order among the first VPDU 1211 of the current CTU 1210 and the third VPDU 1213 including the current block can be used as a reference area.

[0268] This means that for the case where the VPDU execution order in the left CTU is the first VPDU 1211, the second VPDU 1212, the third VPDU 1213 and the fourth VPDU 1214, the above method can be used ( Figure 12 B) Designate the reference area.

[0269] In the above-described embodiment, a region where sequential encoding and decoding are later performed according to the VPDU of the left CTU may be first referred to.

[0270] In addition, when the current CTU 1210 is vertically divided and VPDUs are performed in the order of the first VPDU 1211, the third VPDU 1213, the second VPDU 1212, and the fourth VPDU 1214, when the current block is included in the second VPDU 1212 of the current CTU 1210, the fourth VPDU 1204 of the left adjacent CTU 1200, excluding the first VPDU 1201, the second VPDU 1202, and the third VPDU 1203, can be used as a reference area. In addition, a region pre-reconstructed according to the coding order among the first VPDU 1211 and the third VPDU 1213 of the current CTU 1210 and the second VPDU 1212 including the current block can be used as a reference area.

[0271] Figure 13 Another embodiment of a searchable and referenceable area including an area of a current block and a current picture reference (CPR) is shown.

[0272] exist Figure 13 In, for Figure 10 The case where the CTU including the current block shown in the figure is located at the leftmost side of the current picture, the current block group or the current block and can refer to the upper CTU, shows an implementation method of a CTU located at the upper part among CTUs adjacent to the current CTU in the reference space.

[0273] When the current block is included only in the first VPDU 1311 of the current CTU 1310, not all pixel regions of the upper adjacent CTU 1300 may be used as reference regions, but only some regions may be used as reference regions. Figure 13 In the illustrated embodiment, among the second VPDU 1302 , the third VPDU 1303 , the fourth VPDU 1304 excluding the first VPDU 1301 of the upper adjacent CTU 1300 and the VPDU 1311 including the current block, a region pre-reconstructed according to the encoding and decoding order may be used as a reference region.

[0274] When the current block is included in the second VPDU 1312 of the current CTU 1310, not all pixel regions of the upper adjacent CTU 1300 may be used as reference regions, but only some regions may be used as reference regions. Figure 13 In the illustrated embodiment, the third VPDU 1303 and the fourth VPDU 1304 of the upper adjacent CTU 1300, excluding the first VPDU 1301 and the second VPDU 1302, can be used as a reference region. Alternatively, a region pre-reconstructed according to the encoding and decoding order within the first VPDU 1311 of the current CTU 1310 and the second VPDU 1312 including the current block can be used as a reference region.

[0275] In addition, when the current block is included in the third VPDU 1313 of the current CTU 1310, not all pixel regions of the upper adjacent CTU 1300 may be used as reference regions, but only some regions may be used as reference regions. Figure 13 In the illustrated embodiment, the fourth VPDU 1304 can be used as a reference region in addition to the first VPDU 1301, the second VPDU 1302, and the third VPDU 1303 of the upper adjacent CTU 1300. In addition, among the first VPDU 1311, the second VPDU 1312 of the current CTU 1310, and the third VPDU 1313 including the current block, a region pre-reconstructed according to the encoding and decoding order can be used as a reference region.

[0276] In addition, when the current block is included in the fourth VPDU 1313 of the current CTU 1310, only the pre-reconstructed region within the current CTU 1310 may be used as a reference region without using the upper adjacent CTU 1300 as a reference region.

[0277] Figure 14 Another embodiment of a searchable and referenceable area including an area of a current block and a current picture reference (CPR) is shown.

[0278] exist Figure 14 In addition to Figure 13 In addition, an additional embodiment is shown, in which, for the case where the VPDU execution order is different from the existing z-scan order according to the partition form of the current CTU 1410, the current block references a partial area of the CTU 1400 adjacent to the upper part in space.

[0279] When the current CTU 1410 is vertically divided and VPDUs are performed in the order of the first VPDU 1411, the third VPDU 1413, the second VPDU 1412, and the fourth VPDU 1414, when the current block is included in the third VPDU 1413 of the CTU 1410, the third VPDU 1403 and the fourth VPDU 1404 of the upper adjacent CTU 1400, excluding the first VPDU 1401 and the second VPDU 1402, can be used as a reference region. In addition, among the first VPDU 1411 of the current CTU 1410 and the third VPDU 1413 including the current block, a region pre-reconstructed according to the encoding and decoding order can be used as a reference region.

[0280] In addition, when the current CTU 1410 is vertically divided and VPDUs are performed in the order of the first VPDU 1411, the third VPDU 1413, the second VPDU 1412, and the fourth VPDU 1414, when the current block is included in the second VPDU 1412 of the current CTU 1410, the fourth VPDU 1404 of the upper adjacent CTU 1400 other than the first VPDU 1401, the second VPDU 1402, and the third VPDU 1403 can be used as a reference region. In addition, among the first VPDU 1411, the third VPDU 1413, and the second VPDU 1412 including the current block of the current CTU 1410, a region pre-reconstructed according to the encoding and decoding order can be used as a reference region.

[0281] As described above, the current block may set a reference region based on a CTU located at least one of to the left or above the current CTU. That is, the left CTU or the upper CTU may be selectively used, and the selection may be performed based on predetermined coding information. The coding information may include information regarding whether the left CTU or the upper CTU is referenced, whether the left CTU or the upper CTU is available, the scanning order, the position of the current VPDU within the current CTU, and the like.

[0282] Figure 15 An image encoding / decoding method using a merge mode based on a motion vector difference (MVD) is shown as an embodiment to which the present disclosure is applied.

[0283] Merge mode uses the motion information of adjacent blocks as the motion information of the current block, and unlike AMVP mode, merge mode does not require encoding / decoding of separate motion vector differences. However, even in merge mode, a predetermined motion vector difference (MVD) can be used to improve motion vector accuracy. In the present disclosure, motion information can be understood to include at least one of a motion vector, a reference picture index, or prediction direction information.

[0284] MVD can be selectively used based on a predetermined flag (hereinafter, MVD_flag). MVD_flag can indicate whether motion vector difference (MVD) is used in merge mode. For example, if the flag is a first value, motion vector difference is used in merge mode, and otherwise, motion vector difference is not used in merge mode. That is, when the flag is a first value, motion vector difference can be used to correct motion vectors derived from merge mode, and when the flag is not a first value, motion vectors derived from merge mode may not be corrected.

[0285] MVD_flag may be encoded / decoded only when at least one of the width or height of the current block is greater than or equal to 8. Alternatively, MVD_flag may be encoded / decoded only when the number of pixels belonging to the current block is greater than or equal to 64. Alternatively, MVD_flag may be encoded / decoded only when the sum of the width and height of the current block is greater than 12.

[0286] Reference Figure 15 , a merge candidate list of the current block can be constructed (S1500).

[0287] The merge candidate list may include one or more merge candidates that can be used to derive motion information of the current block. The size of the merge candidate list may be variably determined based on information indicating the maximum number of merge candidates constituting the merge candidate list (hereinafter, size information). The size information may be encoded and signaled by the encoding device, or may be a fixed value (e.g., 2, 3, 4, 5, 6, or a larger integer) pre-agreed with the decoding device.

[0288] The plurality of merge candidates belonging to the merge candidate list may include at least one of a spatial merge candidate or a temporal merge candidate.

[0289] A spatial merge candidate may refer to a neighboring block or motion information of a neighboring block that is spatially adjacent to the current block. Here, the neighboring block may include at least one of the following: the lower left block A0, the left block A1, the upper right block B0, the upper block B1, or the upper left block B2 of the current block. Available neighboring blocks among the neighboring blocks may be sequentially added to the merge candidate list according to a predetermined priority order. For example, priorities such as B1->A1->B0->A1->B2, A1->B1->A0->B1->B2, A1->B1->B0->A0->B2, etc. may be defined, but are not limited thereto.

[0290] A temporal merge candidate may refer to one or more co-located blocks or motion information of a co-located block belonging to a co-located picture. Here, a co-located picture may be any one of a plurality of reference pictures belonging to a reference picture list, and the reference picture list may be a picture different from the picture to which the current block belongs. The co-located picture may be the first picture or the last picture in the reference picture list. Alternatively, the co-located picture may be specified based on an index encoded to indicate the co-located picture. The co-located block may include at least one of the following: a block C1 including the center position of the current block or a neighboring block C0 adjacent to the lower right corner of the current block. Available blocks in C0 and C1 may be sequentially added to the merge candidate list according to a predetermined priority order. For example, C0 may have a higher priority than C1. However, the present disclosure is not limited thereto, and C1 may have a higher priority than C0.

[0291] The encoding / decoding device may include a buffer for storing motion information of one or more blocks (hereinafter referred to as previous blocks) that have been encoded / decoded before the current block. In other words, the buffer may store a list (hereinafter referred to as a motion information list) including motion information of the previous blocks.

[0292] The motion information list can be initialized in units of any one of a picture, a slice, a tile, a CTU row, or a CTU. Initialization may mean a state in which the motion information list is empty. The motion information of the corresponding previous block may be sequentially added to the motion information list according to the encoding / decoding order of the previous block, and the motion information list may be updated in a first-in-first-out (FIFO) manner considering the size of the motion information list. For example, when the most recently encoded / decoded motion information (hereinafter, the latest motion information) is the same as the motion information pre-added to the motion information list, the latest motion information may not be added to the motion information list. Alternatively, the motion information that is the same as the latest motion information may be removed from the motion information list, and the latest motion information may be added to the motion information list. In this case, the latest motion information may be added to the last position of the motion information list or to the position of the removed motion information.

[0293] The previous block may include at least one of one or more neighboring blocks that are spatially adjacent to the current block or one or more neighboring blocks that are not spatially adjacent to the current block.

[0294] In the merge candidate list, a previous block belonging to the buffer or the motion information of the previous block or the motion information list may also be added as a merge candidate.

[0295] Specifically, a redundancy check between the motion information list and the merge candidate list may be performed. Redundancy checking may be performed on all or some merge candidates belonging to the merge candidate list and all or some previous blocks in the motion information list. However, for the sake of convenience of description, it is assumed that the redundancy check of the present disclosure is performed on some merge candidates belonging to the merge candidate list and some previous blocks in the motion information list. Here, some merge candidates in the merge candidate list may include at least one of the left block or the upper block in the spatial merge candidate. However, the present disclosure is not limited thereto, and some merge candidates may be limited to any one of the spatial merge candidates, and may also include at least one of the lower left block, the upper right block, the upper left block, or the temporal merge candidate. Some previous blocks in the motion information list may mean the K previous blocks most recently added to the motion information list. Here, K may be 1, 2, 3 or greater, and may be a fixed value pre-agreed with the encoding / decoding device.

[0296] For example, assume that five previous blocks (or motion information of previous blocks) are stored in a motion information list, and an index of 1 to 5 is assigned to each previous block. The larger the index, the more recently the previous block was stored. In this case, redundancy of motion information between the previous blocks with indices 5, 4, and 3 and some merge candidates in the merge candidate list may be checked. Alternatively, redundancy between the previous blocks with indices 5 and 4 and some merge candidates in the merge candidate list may be checked. Alternatively, redundancy between the previous blocks with indices 4 and 3, excluding the most recently added previous block with index 5, and some merge candidates in the merge candidate list may be checked.

[0297] As a result of a redundancy check, if at least one previous block with the same motion information exists, the previous blocks in the motion information list may not be added to the merge candidate list. On the other hand, if no previous blocks with the same motion information exist, all or some of the previous blocks in the motion information list may be added to the last position in the merge candidate list. In this case, all or some of the previous blocks in the motion information list may be added to the merge candidate list in the order of the most recently added previous block in the motion information list (i.e., from the highest index to the lowest index). However, the most recently added previous block in the motion information list (i.e., the previous block with the highest index) may be restricted from being added to the merge candidate list. The addition of previous blocks may be performed in consideration of the size of the merge candidate list. For example, assume that the merge candidate list has a maximum number (T) of merge candidates according to the size information of the merge candidate list described above. In this case, the addition of previous blocks may be restricted to only being performed until the number of merge candidates in the merge candidate list reaches (Tn). Here, n may be an integer of 1, 2, or a greater number. Alternatively, the addition of previous blocks may be repeated until the number of merge candidates included in the merge candidate list reaches T.

[0298] Reference Figure 15 , the motion information of the current block can be obtained based on the merge candidate list and the merge index (merge_idx) (S1510).

[0299] The merge index may specify any one of a plurality of merge candidates belonging to the merge candidate list. The motion information of the current block may be set to the motion information of the merge candidate specified by the merge index.

[0300] According to the value of MVD_flag, the maximum number of merge candidates that can be used for the current block can be adaptively determined. If MVD_flag is 0, up to M merge candidates can be used, and if MVD_flag is 1, N merge candidates can be used. Here, M can be a natural number smaller than N.

[0301] For example, when MVD_flag is 1, the signaled merge index may have a value of 0 or 1. That is, when a motion vector difference is used in merge mode, only one of the first merge candidate (merge_idx=0) or the second merge candidate (merge_idx=1) in the merge candidate list may be used to derive motion information of the current block.

[0302] Therefore, even when the maximum number of merge candidates belonging to the merge candidate list is M, if a motion vector difference value is used in the merge mode, the maximum number of merge candidates available for the current block may be 2.

[0303] Alternatively, when MVD_flag is 1, the merge index is not encoded / decoded, but the first merge candidate can be forced to be used by setting the merge index to 0. Alternatively, when MVD_flag is 1, the merge index can have a value between 0 and i, i can be an integer of 2, 3 or more, and i can be equal to (M-1).

[0304] Reference Figure 15 , a motion vector difference (MVD) for the merge mode of the current block may be obtained ( S1520 ).

[0305] The MVD of the current block can be derived based on the merged offset vector (offsetMV). The MVD includes at least one of the MVD in the L0 direction (MVD0) or the MVD in the L1 direction (MVD1), and each of MVD0 and MVD1 can be derived using the merged offset vector.

[0306] The merge offset vector may be determined based on the length (mvdDistance) and direction (mvdDirection) of the merge offset vector. For example, the merge offset vector offsetMV may be determined as shown in the following equation 7.

[0307] [Formula 7]

[0308] offsetMV[x0][y0][0]=(mvdDistance[x0][y0]<<2)*mvdDirection[x0][y0][0]

[0309] offsetMV[x0][y0][1]=(mvdDistance[x0][y0]<<2)*mvdDirection[x0][y0][1]

[0310] Here, mvdDistance may be determined taking into account at least one of a distance index (distance_idx) or a predetermined flag (pic_fpel_mmvd_enabled_flag). The distance index (index_idx) may refer to an index encoded to specify the length or distance of the motion vector difference (MVD). pic_fpel_mmvd_enabled_flag may indicate whether the motion vector uses integer pixel precision in the merge mode of the current block. For example, when pic_fpel_mmvd_enabled_flag is a first value, the merge mode of the current block uses integer pixel precision. That is, this may mean that the motion vector resolution of the current block is integer pixels. On the other hand, when pic_fpel_mmvd_enabled_flag is a second value, the merge mode of the current block may use fractional pixel precision. In other words, when pic_fpel_mmvd_enabled_flag is a second value, the merge mode of the current block may use integer pixel precision or fractional pixel precision. Alternatively, when pic_fpel_mmvd_enabled_flag is the second value, the merge mode of the current block may be restricted to use only fractional pixel precision. Examples of fractional pixel precision may include 1 / 2 pixel, 1 / 4 pixel, 1 / 8 pixel, etc.

[0311] For example, mvdDistance may be determined as shown in Table 3 below.

[0312] [Table 3]

[0313]

[0314] In addition, mvdDirection indicates the direction of the merged offset vector and can be determined based on the direction index (direction_idx). Here, the direction may include at least one of left, right, up, down, upper left, lower left, upper right, or lower right. For example, mvdDirection can be determined as shown in Table 4 below.

[0315] [Table 4]

[0316] direction_idx[x0][y0] mvdDirection[x0][y0][0] mvdDirection[x0][y0][1] 0 +1 0 1 -1 0 2 0 +1 3 0 -1

[0317] In Table 4, mvdDirection[x0][y0][0] may mean the sign of the x component of the motion vector difference, and mvdDirection[x0][y0][1] may mean the sign of the y component of the motion vector difference. When direction_idx is 0, the direction of the motion vector difference may be determined as the right direction, when direction_idx is 1, the direction of the motion vector difference may be determined as the left direction, when direction_idx is 2, the direction of the motion vector difference may be determined as the downward direction, and when direction_idx is 3, the direction of the motion vector difference may be determined as the upward direction.

[0318] The above-mentioned distance index and direction index may be encoded / decoded only when MVD_flag is the first value.

[0319] At the same time, the motion vector difference (MVD) may be set to be the same as the previously determined merge offset vector. Alternatively, the merge offset vector may be corrected taking into account the POC difference (PocDiff) between the reference picture of the current block and the current picture to which the current block belongs, and the corrected merge offset vector may be set to the motion vector difference (MVD). In this case, the current block may be encoded / decoded using bidirectional prediction, and the reference picture of the current block may include a first reference picture (a reference picture in the L0 direction) and a second reference picture (a reference picture in the L1 direction). For convenience of description, the POC difference between the first reference picture and the current picture is referred to as PocDiff0, and the POC difference between the second reference picture and the current picture is referred to as PocDiff1.

[0320] When PocDiff0 is identical to PocDiff1, MVD0 and MVD1 of the current block may be identically set as the merge offset vector.

[0321] If PocDiff0 and PocDiff1 are different, when the absolute value of PocDiff0 is greater than or equal to the absolute value of PocDiff1, MVD0 may be set identically to the merge offset vector. At the same time, MVD1 may be derived based on the pre-set MVD0. For example, when the first reference picture and the second reference picture are long-term reference pictures, MVD1 may be derived by applying a first scaling factor to MVD0. The first scaling factor may be determined based on PocDiff0 and PocDiff1. On the other hand, when at least one of the first reference picture and the second reference picture is a short-term reference picture, MVD1 may be derived by applying a second scaling factor to MVD0. The second scaling factor may be a fixed value (e.g., -1 / 2, -1, etc.) pre-agreed with the encoding / decoding device. However, the second scaling factor may be applied only when the sign of PocDiff0 and the sign of PocDiff1 differ from each other. If the sign of PocDiff0 is the same as the sign of PocDiff1, MVD1 may be set identically to MVD0, and separate scaling may not be performed.

[0322] Meanwhile, when PocDiff0 and PocDiff1 are different, when the absolute value of PocDiff0 is less than the absolute value of PocDiff1, MVD1 may be set identically as the merge offset vector. MVD0 may also be derived based on the preset MVD1. For example, when the first reference picture and the second reference picture are long-term reference pictures, MVD0 may be derived by applying a first scaling factor to MVD1. The first scaling factor may be determined based on PocDiff0 and PocDiff1. On the other hand, when at least one of the first reference picture and the second reference picture is a short-term reference picture, MVD0 may be derived by applying a second scaling factor to MVD1. The second scaling factor may be a fixed value (e.g., -1 / 2, -1, etc.) pre-agreed with the encoding / decoding device. However, the second scaling factor may be applied only when the sign of PocDiff0 and the sign of PocDiff1 differ from each other. If the sign of PocDiff0 is the same as the sign of PocDiff1, MVD0 may be set identically to MVD1, and separate scaling may not be performed.

[0323] Reference Figure 15 , the motion vector of the current block may be corrected using a motion vector difference (MVD) ( S1530 ), and motion compensation of the current block may be performed based on the corrected motion vector ( S1540 ).

[0324] Figures 16 to 21 A method of determining an inter prediction mode of a current block based on a predetermined priority according to an embodiment to which the present disclosure is applied is illustrated.

[0325] The present disclosure relates to a method and apparatus for parsing encoding information related to a merge mode in a coding block encoded in a skip mode and / or a merge mode among video coding technologies.

[0326] When encoding and / or decoding a current coding and / or decoding block in skip mode or merge mode, multiple prediction methods may be used, and a method for efficiently signaling the multiple prediction methods is required. When signaling and parsing encoding information related to the merge mode for the current coding and / or decoding block, the order of signaling syntax and parsing syntax may be determined based on the order of frequency of occurrence of the multiple prediction methods.

[0327] The multiple prediction methods may include at least one of the following: block unit merge mode, general CU unit merge mode (conventional merge mode or CU merge mode), MMVD (MVD-based merge mode), sub-block unit merge mode, combined prediction mode, non-rectangular prediction mode or current picture reference mode.

[0328] In addition, the following will describe a method of signaling and parsing each corresponding grammar, conditions therefor, or a case where the corresponding grammar is not expressed (or not signaled) through a grammar table and the semantics of each grammar. However, redundant descriptions will be omitted.

[0329] Reference Figure 16 , regular_merge_flag may indicate whether the general CU unit merge mode is used to generate inter prediction parameters for the current block. When regular_merge_flag is not signaled, regular_merge_flag may be set to 0.

[0330] mmvd_flag[x0][y0] may indicate whether MVD-based merge mode is used to generate inter prediction parameters for the current block. Here, mmvd_flag[x0][y0] may be interpreted as having the same meaning as MVD_flag described above. When mmvd_flag is not signaled, mmvd_flag may be derived based on at least one of whether the current block is a block encoded in current picture reference mode or regular_merge_flag. For example, if the current block is not a block encoded in current picture reference mode and regular_merge_flag is not 1, mmvd_flag may be derived as 1; otherwise, mmvd_flag may be derived as 0.

[0331] merge_subblock_flag may indicate whether inter prediction parameters for the current block in units of subblocks are derived from neighboring blocks. When merge_subblock_flag is not signaled, merge_subblock_flag may be derived based on at least one of sps_ciip_enabled_flag or sps_triangle_enabled_flag. Here, sps_ciip_enabled_flag may indicate whether encoding information regarding the combined prediction mode (e.g., ciip_flag) is present, and sps_triangle_enabled_flag may indicate whether motion compensation based on non-rectangular partitioning can be used.

[0332] For example, if at least one of sps_ciip_enabled_flag or sps_triangle_enabled_flag is 0, merge_subblock_flag may be derived as 1, and otherwise merge_subblock_flag may be derived as 0.

[0333] ciip_flag may indicate whether the combined prediction mode is applied to the current block. If ciip_flag is not signaled, ciip_flag may be derived based on sps_triangle_enabled_flag. For example, when sps_triangle_enabled_flag is 0, ciip_flag may be derived as 1, otherwise ciip_flag may be derived as 0.

[0334] merge_triangle_flag may indicate whether motion compensation based on non-rectangular partitioning is used for the current block. When merge_triangle_flag is not signaled, merge_triangle_flag may be derived based on at least one of sps_triangle_enabled_flag or ciip_flag. For example, if sps_triangle_enabled_flag is 1 and ciip_flag is 0, merge_triangle_flag may be derived as 1; otherwise, merge_triangle_flag may be derived as 0.

[0335] cu_skip_flag may indicate whether the current block is a block coded in skip mode. For example, when cu_skip_flag=1, no syntax is parsed except for the following syntax for the current block. When cu_skip_flag is not signaled, cu_skip_flag may be derived as 0.

[0336] - Flag indicating combined prediction mode (pred_mode_ibc_flag)

[0337] - Flag indicating MVD-based merge mode (mmvd_flag)

[0338] - Merge index in MVD-based merge mode (mmvd_merge_flag)

[0339] -Distance index in MVD-based merge mode (mmvd distance_idx)

[0340] - Direction index in MVD-based merge mode (mmvd_direction_idx)

[0341] -Merge index (merge_idx)

[0342] -merge_subblock_flag

[0343] - Merge index in subblock unit merge mode (merge_subblock_idx)

[0344] -Split direction indicator for non-rectangular partitions (merge_triangle_split_dir)

[0345] -Merge index of non-rectangular partition (merge_triangle_idx)

[0346] Reference Figure 17 , regular_merge_flag may indicate whether the general CU unit merge mode is used to generate inter prediction parameters for the current block. When regular_merge_flag is not signaled, regular_merge_flag may be derived considering whether the current block is a block coded in the current picture reference mode. For example, if the current block is a block coded in the current picture reference mode, regular_merge_flag may be derived as 1; otherwise, regular_merge_flag may be derived as 0.

[0347] Reference Figure 18, regular_merge_flag may indicate whether the general CU unit merge mode is used to generate inter prediction parameters for the current block. When regular_merge_flag is not signaled, regular_merge_flag may be set to 0.

[0348] mmvd_flag[x0][y0] may indicate whether the MVD-based merge mode is used to generate inter prediction parameters for the current block. Here, mmvd_flag[x0][y0] may be interpreted as having the same meaning as the above-mentioned MVD_flag.

[0349] When mmvd_flag is not signaled, mmvd_flag may be derived based on at least one of whether the current block is a block coded in the current picture reference mode or regular_merge_flag. For example, if the current block is not a block coded in the current picture reference mode and regular_merge_flag is not 1, mmvd_flag may be derived as 1; otherwise, mmvd_flag may be derived as 0.

[0350] Alternatively, when mmvd_flag is not signaled, mmvd_flag may be derived based on at least one of whether the current block is a block coded in the current picture reference mode, regular_merge_flag, or the size of the current block. For example, if the current block is not a block coded in the current picture reference mode, regular_merge_flag is not 1, and the sum of the width and height of the current block is less than or equal to 12, then mmvd_flag may be derived as 1; otherwise, mmvd_flag may be derived as 0.

[0351] merge_subblock_flag may indicate whether inter prediction parameters for the current block in units of subblocks are derived from neighboring blocks. When merge_subblock_flag is not signaled, merge_subblock_flag may be derived based on at least one of sps_ciip_enabled_flag or sps_triangle_enabled_flag. Here, sps_ciip_enabled_flag may indicate whether encoding information regarding the combined prediction mode (e.g., ciip_flag) is present, and sps_triangle_enabled_flag may indicate whether motion compensation based on non-rectangular partitioning can be used.

[0352] For example, if at least one of sps_ciip_enabled_flag or sps_triangle_enabled_flag is 0, merge_subblock_flag may be derived as 1, and otherwise merge_subblock_flag may be derived as 0.

[0353] The ciip_flag may indicate whether combined prediction mode is applied to the current block. When the ciip_flag is not signaled, the ciip_flag may be derived based on at least one of the sps_triangle_enabled_flag and the slice type. For example, if the sps_triangle_enabled_flag is 0 or the slice to which the current block belongs is not a B slice, the ciip_flag may be derived as 1; otherwise, the ciip_flag may be derived as 0.

[0354] merge_triangle_flag may indicate whether motion compensation based on non-rectangular partitioning is used for the current block. When merge_triangle_flag is not signaled, merge_triangle_flag may be derived based on at least one of sps_triangle_enabled_flag or ciip_flag. For example, if sps_triangle_enabled_flag is 1 and ciip_flag is 0, merge_triangle_flag may be derived as 1; otherwise, merge_triangle_flag may be derived as 0.

[0355] cu_skip_flag may indicate whether the current block is a block coded in skip mode. For example, when cu_skip_flag is equal to 1, no syntax is parsed except for the following syntax for the current block. When cu_skip_flag is not signaled, cu_skip_flag may be derived as 0.

[0356] - Flag indicating combined prediction mode (pred_mode_ibc_flag)

[0357] - Flag indicating MVD-based merge mode (mmvd_flag)

[0358] - Merge index in MVD-based merge mode (mmvd_merge_flag)

[0359] -Distance index in MVD-based merge mode (mmvd distance_idx)

[0360] - Direction index in MVD-based merge mode (mmvd_Direction_idx)

[0361] -Merge index (merge_idx)

[0362] -merge_subblock_flag

[0363] - Merge index in subblock unit merge mode (merge_subblock_idx)

[0364] -Split direction indicator for non-rectangular partitions (merge_triangle_split_dir)

[0365] -Merge index of non-rectangular partition (merge_triangle_idx)

[0366] Reference Figure 19 , regular_merge_flag may indicate whether the general CU unit merge mode is used to generate inter prediction parameters for the current block. When regular_merge_flag is not signaled, regular_merge_flag may be derived considering whether the current block is a block coded in the current picture reference mode. For example, if the current block is a block coded in the current picture reference mode, regular_merge_flag may be derived as 1; otherwise, regular_merge_flag may be derived as 0.

[0367] The encoding device may generate a bitstream by encoding at least one of the above-mentioned merging mode-related encoding information according to a predetermined priority. The decoding device may decode the bitstream to obtain the merging mode-related encoding information and perform inter-frame prediction based on the obtained encoding information.

[0368] The various embodiments of the present disclosure are not listed as listing all possible combinations, but are intended to describe representative aspects of the present disclosure, and the contents described in the various embodiments may be applied independently or in combinations of two or more.

[0369] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of hardware implementation, various embodiments of the present disclosure may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, and the like.

[0370] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operations according to the methods of various embodiments to be performed on a device or computer, and includes non-transitory computer-readable media in which the software or instructions are stored and executed on a device or computer.

[0371] Industrial availability

[0372] The present disclosure may be used to encode / decode image signals.

Claims

1. A method for decoding an image signal including a current picture, comprising: Reconstructing the current picture; as well as performing deblocking filtering on a boundary between a first block and a second block belonging to the reconstructed current picture, wherein the deblocking filtering is performed based on one of a plurality of filter types predefined in the decoding device, Wherein, the plurality of filter types include long filters and short filters, wherein the filter length of the long filter is M, and the filter length of the short filter is N, wherein the value of M is 8, 10, 12, or 14, the value of N is a natural number smaller than the value of M, and the value of N is an even number, wherein, in response to deblocking filtering based on the long filter, filtered pixels in the first block are obtained using X pixels belonging to the first block and Y pixels belonging to the second block, wherein the long filter is applied symmetrically or asymmetrically to the boundary between the first block and the second block, wherein, in response to the long filter being symmetrically applied to a boundary between the first block and the second block, a value of X and a value of Y are 4, 5, 6, or 7, and the value of X is equal to the value of Y, wherein, in response to the long filter being asymmetrically applied to the boundary between the first block and the second block, when the value of M is 10, one of the value of X or the value of Y is 3, and the other of the value of X or the value of Y is 7, The filtered pixel is obtained by weighted average of the first reference value and the second reference value. wherein the first reference value is derived using X pixels belonging to the first block and Y pixels belonging to the second block, and The second reference value is derived as an average value between a first pixel and a second pixel adjacent to the first pixel, wherein the first pixel is farthest from the boundary among the X pixels belonging to the first block.

2. The method according to claim 1, wherein The deblocking filtering is performed in units of one of a 4×4 sample grid or an 8×8 sample grid.

3. A method for encoding an image signal including a current picture, comprising: Reconstructing the current picture; as well as performing deblocking filtering on a boundary between a first block and a second block belonging to the reconstructed current picture, wherein the deblocking filtering is performed based on one of a plurality of filter types predefined in the encoding device, Wherein, the plurality of filter types include long filters and short filters, wherein the filter length of the long filter is M, and the filter length of the short filter is N, wherein the value of M is 8, 10, 12, or 14, the value of N is a natural number smaller than the value of M, and the value of N is an even number, wherein, in response to deblocking filtering based on the long filter, filtered pixels in the first block are obtained using X pixels belonging to the first block and Y pixels belonging to the second block, wherein the long filter is applied symmetrically or asymmetrically to the boundary between the first block and the second block, wherein, in response to the long filter being symmetrically applied to a boundary between the first block and the second block, a value of X and a value of Y are 4, 5, 6, or 7, and the value of X is equal to the value of Y, wherein, in response to the long filter being asymmetrically applied to the boundary between the first block and the second block, when the value of M is 10, one of the value of X or the value of Y is 3, and the other of the value of X or the value of Y is 7, The filtered pixel is obtained by weighted average of the first reference value and the second reference value. wherein the first reference value is derived using X pixels belonging to the first block and Y pixels belonging to the second block, and The second reference value is derived as an average value between a first pixel and a second pixel adjacent to the first pixel, wherein the first pixel is farthest from the boundary among the X pixels belonging to the first block.

Citation Information

Patent Citations

  • Video encoding and decoding method using deblocking fitering with transform skip and apparatus using the same

    KR1020160068288A

  • Method and apparatus for encoding / decoding image and recording medium for storing bitstream

    KR1020180134764A