Image signal encoding / decoding method and device therefor
By using motion information tables to derive merging candidates and refine motion vectors in video signal encoding/decoding, the problem of low video compression rate in high-definition video services is solved, and inter-frame prediction efficiency and video compression performance are improved.
Patent Information
- Application Number
- CN202080004277.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-01-28
- Filing Date
- 2020-01-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-01-28
AI Technical Summary
Existing video coding technology shows performance limitations in high-definition video services, especially when the amount of data is large, it is difficult to effectively improve the video compression rate.
By using the motion information table to derive merging candidates during the video signal encoding/decoding process, the motion information table is updated using the block motion information in the merging processing area, and the motion vectors derived based on the merging candidates are refined to improve the performance of inter-frame prediction. efficiency.
The inter-frame prediction efficiency of the video signal is improved, and the video compression performance is improved by dynamically updating the motion information table and refining the motion vector.
Smart Images

Figure CN112544083B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a video signal encoding / decoding method and a device therefor. Background Art
[0002] As display panels become larger, higher quality video services are required. The biggest problem with high-definition video services is the greatly increased amount of data. In order to solve the above problems, research on improving video compression rates is being actively conducted. As a representative example, the Joint Collaboration Team on Video Coding (JCT-VC) was established in 2009 by the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) under the International Telecommunication Union Telecommunication Standardization Sector (ITU-T). JCT-VC proposed a video compression standard: High Efficiency Video Coding (HEVC), which has a compression performance approximately twice that of H.264 / AVC, and was approved as a standard on January 25, 2013. However, with the rapid development of high-definition video services, the performance of HEVC has gradually shown its limitations. Summary of the invention
[0003] Technical issues
[0004] The present disclosure is directed to providing a method of deriving a merge candidate by using a motion information table when encoding / decoding a video signal, and an apparatus for performing the method.
[0005] The present disclosure is directed to providing a method of updating a motion information table by using motion information of blocks included in a merge processing area when encoding / decoding a video signal, and an apparatus for performing the method.
[0006] The present disclosure aims to provide a method for refining a motion vector derived based on a merge candidate when encoding / decoding a video signal, and a device for performing the method.
[0007] Technical objectives that can be obtained from the present disclosure are not limited to the above-mentioned technical objectives, and other unmentioned technical objectives can be clearly understood from the following description by a person of ordinary skill in the technical field to which the present disclosure belongs.
[0008] Solution
[0009] According to the present disclosure, a video signal decoding / encoding method includes: generating a merge candidate list of a current block; selecting any one of the merge candidates included in the merge candidate list; and performing motion compensation on the current block based on motion information of the selected merge candidate. Here, the merge candidate list includes merge candidates derived based on a motion information table, and when the current block is included in a merge processing area, the motion information table is not updated when the block included in the merge processing area is decoded.
[0010] In the video signal decoding / encoding method according to the present disclosure, after decoding of the current block is completed, the motion information table may not be updated using the motion information of the current block.
[0011] In the video signal decoding / encoding method according to the present disclosure, whether to update the motion information table using the motion information of the current block may be determined based on the position of the current block within the merge processing region.
[0012] In the video signal decoding / encoding method according to the present disclosure, when the current block is located at the lower right within the merge processing area, it is determined to update the motion information table using the motion information of the current block.
[0013] In the video signal decoding / encoding method according to the present disclosure, whether to add the motion information of the current block to the motion information table may be determined based on whether the same motion information candidate as the motion information of the current block exists in the motion information table.
[0014] In the video signal decoding / encoding method according to the present disclosure, it may be determined whether motion information of a current block is identical to at least one motion information candidate having an index value equal to or less than a threshold or an index value equal to or greater than the threshold.
[0015] In the video signal decoding / encoding method according to the present disclosure, when there is a motion information candidate identical to motion information of a current block, an index of the motion information candidate is updated with a maximum value or a minimum value.
[0016] It will be appreciated that the foregoing summarized features are exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.
[0017] Beneficial Effects
[0018] According to the present disclosure, a motion information table is used to derive merge candidates, thereby improving the efficiency of inter-frame prediction.
[0019] According to the present disclosure, there is provided a method of updating a motion information table using motion information of blocks included in a merge processing area, thereby improving efficiency of inter-frame prediction.
[0020] According to the present disclosure, a motion vector derived based on a merge candidate is refined, thereby improving the efficiency of inter-frame prediction.
[0021] Effects obtainable from the present disclosure may not be limited to the above-mentioned effects, and other unmentioned effects may be clearly understood from the following description by a person of ordinary skill in the technical field to which the present disclosure pertains. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a diagram illustrating a block diagram of a video encoding device (encoder) according to an embodiment of the present disclosure.
[0023] Figure 2 is a diagram showing a block diagram of a video decoding device (decoder) according to an embodiment of the present disclosure.
[0024] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
[0025] Figure 4 is a diagram illustrating various partition types of a coding block.
[0026] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.
[0027] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.
[0028] Figure 7 is a flow chart of the process of deriving current block motion information in merge mode.
[0029] Figure 8 is a diagram illustrating candidate blocks for deriving merge candidates.
[0030] Fig. 9 is a diagram showing the positions of basic sample points.
[0031] Fig.10 is a diagram illustrating an example of candidate blocks for deriving merge candidates.
[0032] Fig.11 is a diagram showing an example of changing the position of the basic sample point.
[0033] Fig.12 is a diagram showing an example of changing the position of the basic sample point.
[0034] Fig.13 It is a diagram for explaining the updating aspect of the motion information table.
[0035] Fig.14 is a diagram illustrating an updating aspect of a motion information table.
[0036] Fig.15 is a diagram showing an example in which the index of the stored motion information candidate is updated.
[0037] Fig.16 is a diagram showing the positions of representative sub-blocks.
[0038] Fig.17 An example of generating a motion information table according to the inter prediction mode is shown.
[0039] Fig.18is a diagram showing an example of generating a motion information table for each motion vector resolution.
[0040] Fig.19 is a diagram illustrating an example of storing motion information of a block to which a merge offset encoding method is applied in a separate motion information table.
[0041] Fig. 20 is a diagram illustrating an example of adding motion information candidates included in a long-term motion information table to a merge candidate list.
[0042] Fig.21 is a diagram illustrating an example of performing redundancy check on only a part of merging candidates.
[0043] Fig. 22 is a diagram illustrating an example in which a redundancy check on a specific merge candidate is omitted.
[0044] Fig.23 is a diagram showing an example in which a candidate block included in the same merge processing region as a current block is set to be unusable as a merge candidate.
[0045] Fig.24 is a diagram illustrating an example of deriving a merge candidate of a current block when the current block is included in a merge processing region.
[0046] Fig.25 is a diagram showing a temporary motion information table.
[0047] Fig.26 is a diagram showing an example in which a motion information table and a temporary motion information table are unified.
[0048] Fig. 27 is a diagram illustrating an offset vector according to a value of distance_idx indicating a size of the offset vector and a value of direction_idx indicating a direction of the offset vector.
[0049] Fig.28 is a diagram illustrating an offset vector according to a value of distance_idx indicating a size of the offset vector and a value of direction_idx indicating a direction of the offset vector. DETAILED DESCRIPTION
[0050] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
[0051] Image encoding and decoding are performed on a block basis. In an example, encoding / decoding processes such as transform, quantization, prediction, in-loop filtering, reconstruction, etc. may be performed on a coding block, a transform block, or a prediction block.
[0052] Hereinafter, the encoding / decoding target block is referred to as a “current block.” In an example, the current block may refer to a coding block, a transform block, or a prediction block according to a current encoding / decoding process.
[0053] In addition, the term "unit" used in this specification means a basic unit for performing a specific encoding / decoding process, and "block" can be understood to mean a sample array having a predetermined size. Unless otherwise specified, "block" and "unit" can be used interchangeably. In the example, the coding block and the coding unit can be understood to have the same meaning as each other in the examples described later.
[0054] Figure 1 is a diagram showing a block diagram of an image encoding device (encoder) according to an embodiment of the present disclosure.
[0055] Reference Figure 1 The image encoding apparatus may include a picture partition unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.
[0056] Figure 1 The components described in the figure are shown independently in order to illustrate different characteristic functions in the image encoding device, and the figure does not mean that each component is composed of separate hardware or a software unit. That is, each component is listed only for the convenience of explanation, at least two of the components may constitute one component, or one component may be partitioned into multiple components that can perform their functions. Even embodiments in which the components are integrated and embodiments in which the components are partitioned are included in the scope of the present disclosure unless they depart from the spirit of the present disclosure.
[0057] In addition, some components are not essential components for performing the essential functions of the present disclosure, but are optional components only for improving performance. The present disclosure may be implemented using essential components for implementing the spirit of the present disclosure other than components only for improving performance, and a structure including only essential components other than optional components only for improving performance is also included in the scope of the present disclosure.
[0058] The picture partition unit 110 may partition the input picture into at least one processing unit. In this regard, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture partition unit 110, a single picture may be partitioned into a plurality of combinations of a plurality of coding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of coding units, prediction units, and transform units according to a predetermined condition (e.g., a cost function).
[0059] For example, a single picture may be partitioned into a plurality of coding units. In order to partition a picture into coding units, a recursive tree structure such as a quadtree structure may be used, and a coding unit derived from a root such as a single image or a maximum coding unit may be partitioned into other coding units and may have as many child nodes as the partitioned coding units. Coding units that are no longer partitioned according to certain restrictions become leaf nodes. That is, when it is assumed that only square partitions are available for a single coding unit, a single coding unit may be partitioned into up to four other coding units.
[0060] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding, or may be used as a unit for decoding.
[0061] The prediction units may be obtained by partitioning a single coding unit into at least one square or rectangle having the same size, or may be partitioned into prediction units in such a manner that one prediction unit may be different in shape and / or size from another prediction unit.
[0062] In generating a prediction unit based on a coding block on which intra prediction is being performed, when the coding unit is not a minimum coding unit, intra prediction may be performed without performing partitioning into a plurality of N×N prediction units.
[0063] The prediction units 120 and 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction and an intra-frame prediction unit 125 that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is performed on the prediction unit, and detailed information (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this regard, the processing unit on which the prediction is performed may be different from the prediction unit on which the prediction method and its details are determined. For example, the prediction method, prediction mode, etc. may be determined based on the prediction unit, but the prediction may be performed based on the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded by the entropy encoding unit 165 using the residual value and may be sent to the decoder. When a specific encoding mode is used, the original block is encoded as it is without generating a prediction block through the prediction unit 120 or 125 and is sent to the decoding unit.
[0064] The inter-frame prediction unit 120 may predict the prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture, or in some cases, may predict the prediction unit based on information about some encoded regions in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0065] The reference picture interpolation unit may receive reference picture information from the memory 155, and may generate pixel information of integer pixels or smaller pixels from the reference picture. In the case of luma pixels, an 8-tap DCT-based interpolation filter with different coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 4 pixels. In the case of chroma pixels, a 4-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 8 pixels.
[0066] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as a full search based matching algorithm (FBMA), a three-step search (TSS) algorithm, a new three-step search (NTS) algorithm, etc. may be used as a method for calculating a motion vector. The motion vector may have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel based on the interpolated pixel. The motion prediction unit may predict the current prediction unit by changing the motion prediction method. Various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra-block copy method, etc. may be used as a motion prediction method.
[0067] The motion prediction unit 125 may generate a prediction unit based on information of reference pixels around the current block as pixel information in the current picture. When a neighboring block of the current prediction unit is a block on which inter-frame prediction is performed, and thus the reference pixel is a pixel on which inter-frame prediction is performed, the reference pixel included in the block on which inter-frame prediction is performed may be replaced with information about the reference pixel of the neighboring block on which intra-frame prediction is performed. In other words, when a reference pixel is unavailable, at least one reference pixel among available reference pixels may be used to replace the unavailable reference pixel information.
[0068] The prediction mode under the intra prediction may include a directional prediction mode that uses reference pixel information according to a prediction direction when performing prediction, and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luma information may be different from the mode for predicting chroma information. In order to predict chroma information, information about the intra prediction mode for predicting luma information or information about the predicted luma signal may be used.
[0069] In the process of performing intra prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra prediction can be performed on the prediction unit based on pixels located to the left, above the left, and above the prediction unit. However, in the process of performing intra prediction, when the size of the prediction unit is different from the size of the transformation unit, intra prediction can be performed by using reference pixels based on the transformation unit. In addition, intra prediction using N×N partitions can be used only for the minimum coding unit.
[0070] In the intra prediction method, a prediction block may be generated after an adaptive intra smoothing (AIS) filter is applied to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may vary. In order to perform the intra prediction method, an intra prediction mode for a current prediction unit may be predicted from intra prediction modes of prediction units existing around the current prediction unit. In the process of predicting a prediction mode for a current prediction unit by using mode information predicted from a neighboring prediction unit, when the intra prediction mode for the current prediction unit is the same as the intra prediction mode of the neighboring prediction unit, information indicating that the current prediction unit has the same prediction mode as the neighboring prediction unit may be sent by using predetermined flag information. When the prediction mode for the current prediction unit is different from the prediction mode of the neighboring prediction unit, entropy coding may be performed to encode information about the prediction mode for the current block.
[0071] In addition, a residual block including information on a residual value which is a difference value between a prediction unit on which prediction is performed by the prediction unit 120 or 125 and an original block of the prediction unit may be generated. The generated residual block may be input to the transform unit 130.
[0072] The transform unit 130 may perform a transform on the residual block by using a transform method such as discrete cosine transform (DCT) or discrete sine transform (DST), wherein the residual block includes information about a residual value between the original block and the prediction unit generated by the prediction unit 120 or 125. In this regard, the DCT transform kernel includes at least one of DCT2 or DCT8, and the DST transform kernel includes DST7. Whether to apply DCT or DST to perform a transform on the residual block may be determined based on information about an intra-frame prediction mode of the prediction unit used to generate the residual block. The transform for the residual block may be skipped. A flag indicating whether to skip the transform for the residual block may be encoded. Transform skipping may be allowed for a residual block whose size is less than or equal to a threshold, a residual block of a luminance component in a 4:4:4 format, or a residual block of a chrominance component.
[0073] The quantization unit 135 may perform quantization on the value transformed into the frequency domain by the transformation unit 130. The quantization coefficient may vary according to the importance or block of the image. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.
[0074] The rearrangement unit 160 may perform rearrangement on the transform coefficients with respect to the quantized residual values.
[0075] The rearrangement unit 160 may change the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement unit 160 may scan from the DC coefficient to the coefficients in the high frequency domain by using a zigzag scanning method so as to change the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical direction scanning of scanning the coefficients in the two-dimensional block form along the column direction or horizontal direction scanning of scanning the coefficients in the two-dimensional block form along the row direction may be used instead of the zigzag scanning. In other words, which scanning method to use among the zigzag scanning, the vertical direction scanning, and the horizontal direction scanning may be determined according to the size of the transform unit and the intra-frame prediction mode.
[0076] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. The entropy encoding may use various encoding methods, for example, exponential Golomb encoding, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC).
[0077] The entropy coding unit 165 may encode various types of information obtained from the rearrangement unit 160 and the prediction units 120 and 125 (such as information about residual value coefficients and information about block types of coding units, information about prediction modes, information about partition units, information about prediction units and information about transform units, information about motion vectors, information about reference frames, information about block interpolation, filtering information, and the like).
[0078] The entropy encoding unit 165 may entropy encode coefficients of the coding unit input from the rearrangement unit 160 .
[0079] The inverse quantization unit 140 may perform inverse quantization on the value quantized in the quantization unit 135, and the inverse transform unit 145 may perform inverse transform on the value transformed in the transform unit 130. The residual value generated by the inverse quantization unit 140 and the inverse transform unit 145 may be added to a prediction unit predicted by a motion estimation unit, a motion compensation unit, or an intra prediction unit included in the prediction units 120 and 125 in order to generate a reconstructed block.
[0080] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive in-loop filter (ALF).
[0081] The deblocking filter can remove block distortion caused by the boundary between blocks in the reconstructed picture. In order to determine whether to perform the deblocking operation, it can be determined whether to apply the deblocking filter to the current block based on the pixels included in the rows or columns included in the block. When the deblocking filter is applied to the block, a strong filter or a weak filter is applied according to the required deblocking filter strength. In addition, in the process of applying the deblocking filter, when horizontal filtering and vertical filtering are performed, the horizontal filtering and the vertical filtering can be configured to be processed in parallel.
[0082] The offset correction unit can correct the original image with an offset in pixels for the image on which the deblocking operation is performed. In order to perform offset correction on a specific picture, a method of applying an offset to an area determined after partitioning the pixels of the image into a predetermined number of areas, or a method of applying an offset according to edge information of each pixel can be used.
[0083] Adaptive in-loop filtering (ALF) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. Pixels included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and filtering may be performed separately for each group. Information on whether ALF is applied may be sent for each coding unit (CU) of a luminance signal, and the shape and filter coefficients of the ALF filter to be applied may vary based on each block. Alternatively, an ALF filter having the same shape (fixed shape) may be applied regardless of the characteristics of the block to which the filter is applied.
[0084] In the memory 155, a reconstructed block or a reconstructed picture calculated by the filter unit 150 may be stored. The stored reconstructed block or the reconstructed picture may be provided to the prediction unit 120 or 125 when inter prediction is performed.
[0085] Figure 2 is a diagram showing a block diagram of an image decoding device (decoder) according to an embodiment of the present disclosure.
[0086] Reference Figure 2 , the image decoding apparatus includes an entropy decoding unit 210 , a rearrangement unit 215 , an inverse quantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .
[0087] When an image bitstream is input from an encoder, the input bitstream may be decoded according to an inverse process of the image encoding apparatus.
[0088] The entropy decoding unit 210 may perform entropy decoding according to an inverse process of entropy encoding performed by an entropy encoding unit of an image encoder. For example, in association with a method performed by an image encoder device, various methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC) may be applied.
[0089] The entropy decoding unit 210 may decode information about intra prediction and inter prediction performed by the encoder.
[0090] The rearrangement unit 215 may perform rearrangement on the bit stream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method used in the encoder. The coefficients represented in the form of a one-dimensional vector may be reconstructed, and the coefficients represented in the form of a one-dimensional vector may be rearranged into coefficients in the form of a two-dimensional block. The rearrangement unit 215 may perform rearrangement by receiving information related to coefficient scanning performed in the encoder and performing inverse scanning based on the scanning order performed in the encoder.
[0091] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter received from the encoder and the coefficient value of the rearranged block.
[0092] The inverse transform unit 225 may perform an inverse transform (i.e., inverse DCT or inverse DST) for the transform (i.e., DCT or DST) performed on the quantization result by the transform unit in the image encoder. In this regard, the DCT transform core may include at least one of DCT2 or DCT8, and the DST transform core may include DST7. Optionally, when the transform is skipped in the image encoder, the inverse transform is also not performed in the inverse transform unit 225. The inverse transform may be performed based on the transform unit determined by the image encoder. The inverse transform unit 225 of the image decoder may selectively perform a transform method (e.g., DCT or DST) according to a plurality of pieces of information (such as a prediction method, a size of a current block, a prediction direction, etc.).
[0093] The prediction unit 230 or 235 may generate a prediction block based on information related to the prediction block received from the entropy decoding unit 210 and information about a previously decoded block or picture received from the memory 245 .
[0094] As described above, like the operation of the image encoder, in the process of performing intra-frame prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra-frame prediction can be performed on the prediction unit based on the pixels located on the left, upper left, and above the prediction unit. However, in the process of performing intra-frame prediction, when the size of the prediction unit is different from the size of the transformation unit, intra-frame prediction can be performed by using reference pixels based on the transformation unit. In addition, intra-frame prediction using N×N partitions can be used only for the minimum coding unit.
[0095] The prediction units 230 and 235 may include a PU determination module, an inter prediction unit, and an intra prediction unit. The PU determination unit may receive various types of information (such as information about the prediction unit, information about the prediction mode of the intra prediction method, information about the motion prediction of the inter prediction method, etc.) input from the entropy decoding unit 210, may partition the prediction unit in the current coding unit, and may determine whether to perform inter prediction or intra prediction on the prediction unit. By using the information required for inter prediction of the current prediction unit received from the image encoder, the inter prediction unit 230 may perform inter prediction on the current prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture including the current prediction unit. Alternatively, inter prediction may be performed based on information about some pre-reconstructed areas in the current picture including the current prediction unit.
[0096] In order to perform inter prediction, which method of the skip mode, the merge mode, the AMVP mode, or the intra block copy mode is used as a motion prediction method for a prediction unit included in the coding unit may be determined based on the coding unit.
[0097] The intra prediction unit 235 may generate a prediction block based on information about pixels within the current picture. When the prediction unit is a prediction unit that has been subjected to intra prediction, intra prediction may be performed based on information about the intra prediction mode of the prediction unit received from the image encoder. The intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, or a DC filter. The AIS filter may perform filtering on the reference pixels of the current block, and may determine whether to apply the filter based on the prediction mode used for the current prediction unit. When AIS filtering is performed on the reference pixels of the current block, the prediction mode of the prediction unit received from the image encoder and information about the AIS filter may be used. When the prediction mode for the current block is a mode to which AIS filtering is not applied, the AIS filter may not be applied.
[0098] When the prediction mode of the prediction unit is a prediction mode for performing intra prediction based on a pixel value obtained by interpolating reference pixels, the reference pixel interpolation unit may interpolate the reference pixels so as to generate reference pixels having an integer or smaller unit. When the prediction mode for the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode for the current block is a DC mode, the DC filter may generate a prediction block by filtering.
[0099] The reconstructed block or the reconstructed picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction module, and an ALF.
[0100] Information about whether a deblocking filter has been applied to a corresponding block or picture and information about whether a strong filter or a weak filter is applied when the deblocking filter is applied may be received from the image encoder. A deblocking filter of an image decoder may receive information about the deblocking filter from the image encoder, and the image decoder may perform deblocking filtering on the corresponding block.
[0101] The offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction applied to the image when encoding is performed, information about the offset value, and the like.
[0102] ALF may be applied to the coding unit based on information on whether ALF is applied, information on an ALF coefficient, etc. received from the encoder. The above ALF information may be provided by being included in a specific parameter set.
[0103] In the memory 245 , the reconstructed picture or the reconstructed block may be stored in order to be used as a reference picture or a reference block, and the reconstructed picture may be provided to the output unit.
[0104] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
[0105] The largest coding block may be defined as a coding tree block. A single picture may be partitioned into a plurality of coding tree units (CTUs). A CTU may be a coding unit of the largest size and may be referred to as a largest coding unit (LCU). Figure 3 is a diagram showing an example in which a single picture is partitioned into a plurality of CTUs.
[0106] The size of the CTU may be defined at a picture level or a sequence level. Similarly, information indicating the size of the CTU may be signaled through a picture parameter set or a sequence parameter set.
[0107] In an example, the size of the CTU for the entire picture within the sequence may be set to 128×128. Alternatively, any one of 128×128 or 256×256 may be determined as the size of the CTU at a picture level. In an example, the CTU may be set to have a size of 128×128 in a first picture, and may be set to have a size of 256×256 in a second picture.
[0108] A coding block may be generated by partitioning the CTU. A coding block represents a basic unit for performing encoding / decoding. In an example, prediction or transformation may be performed for each coding block, or a prediction coding mode may be determined for each coding block. In this regard, the prediction coding mode represents a method for generating a predicted image. In an example, the prediction coding mode may include intra prediction, inter prediction, current picture reference (CPR), intra block copy (IBC), or combined prediction. For a coding block, a prediction block of the coding block may be generated by using a prediction coding mode of at least one of intra prediction, inter prediction, current picture reference, or combined prediction.
[0109] Information indicating the prediction coding mode for the current block may be signaled in the bitstream. In an example, the information may be a 1-bit flag indicating whether the prediction coding mode is an intra mode or an inter mode. When the prediction coding mode for the current block is determined to be an inter mode, current picture reference or combined prediction may be available.
[0110] The current picture reference is to set the current picture as the reference picture and obtain the prediction block of the current block from the area in the current picture that has been encoded / decoded. In this regard, the current picture represents the picture including the current block. Information indicating whether the current picture reference is applied to the current block can be sent by signal in the bitstream. In an example, the information can be a 1-bit flag. When the flag is true (TRUE), the prediction coding mode for the current block can be determined as the current picture reference, and when the flag is false (FALSE), the prediction coding mode for the current block can be determined as inter-frame prediction.
[0111] Alternatively, the prediction coding mode for the current block may be determined based on the reference picture index. In an example, when the reference picture index indicates the current picture, the prediction coding mode for the current block may be determined as the current picture reference. When the reference picture index indicates a picture other than the current picture, the prediction coding mode for the current block may be determined as the inter-frame prediction. In other words, the current picture reference is a prediction method using information about an area that has been encoded / decoded within the current picture, and the inter-frame prediction is a prediction method using information about another picture that has been encoded / decoded.
[0112] Combined prediction refers to a combined coding mode that combines at least two of intra prediction, inter prediction, and current picture reference. In the example, when combined prediction is applied, a first prediction block may be generated based on any one of intra prediction, inter prediction, or current picture reference, and a second prediction block may be generated based on another one of intra prediction, inter prediction, or current picture reference. When the first prediction block and the second prediction block are generated, a final prediction block may be generated by calculating an average or weighted sum of the first prediction block and the second prediction block. Information indicating whether combined prediction is applied to the current block may be signaled in the bitstream. The information may be a 1-bit flag.
[0113] Figure 4 is a diagram illustrating various partition types of a coding block.
[0114] The coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning. The partitioned coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning.
[0115] Quadtree partitioning represents a method of partitioning the current block into four blocks. As a result of quadtree partitioning, the current block can be partitioned into four square partitions (refer to Figure 4 (a) "SPLIT_QT").
[0116] Binary tree partitioning refers to a method of partitioning a current block into two blocks. An operation of partitioning a current block into two blocks along a vertical direction (i.e., using a vertical line passing through the current block) may be referred to as vertical binary tree partitioning, and an operation of partitioning a current block into two blocks along a horizontal direction (i.e., using a horizontal line passing through the current block) may be referred to as horizontal binary tree partitioning. As a result of the binary tree partitioning, the current block may be partitioned into two non-square partitions. Figure 4 "SPLIT_BT_VER" of (b) is a diagram showing the result of binary tree partitioning in the vertical direction. Figure 4 "SPLIT_BT_HOR" of (c) is a diagram showing the result of binary tree partitioning in the horizontal direction.
[0117] Ternary tree partitioning means a method of partitioning a current block into three blocks. The operation of partitioning a current block into three blocks along a vertical direction (i.e., using two vertical lines passing through the current block) may be referred to as vertical ternary tree partitioning, and the operation of partitioning a current block into three blocks along a horizontal direction (i.e., using two horizontal lines passing through the current block) may be referred to as horizontal ternary tree partitioning. As a result of the ternary tree partitioning, the current block may be partitioned into three non-square partitions. In this regard, the width / height of the partition located at the center of the current block may be twice the width / height of the other partitions. Figure 4"SPLIT_TT_VER" of (d) is a diagram showing the result of ternary tree partitioning in the vertical direction, Figure 4 "SPLIT_TT_HOR" of (e) is a diagram showing the result of ternary tree partitioning in the horizontal direction.
[0118] The number of partitions of a CTU may be defined as a partition depth. The maximum partition depth of a CTU may be determined at a sequence level or a picture level. Therefore, the maximum partition depth of a CTU may vary based on a sequence or a picture.
[0119] Optionally, the maximum partition depth may be determined independently for each partitioning method. In an example, the maximum partition depth allowed for quadtree partitioning may be different from the maximum partition depth allowed for binary tree partitioning and / or ternary tree partitioning.
[0120] The encoder may signal information indicating at least one of a partition type and a partition depth of a current block in a bitstream, and the decoder may determine a partition type and a partition depth of a CTU based on the information obtained by parsing the bitstream.
[0121] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.
[0122] An operation of partitioning a coding block by using quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning may be referred to as multitree partitioning.
[0123] A coding block generated by partitioning a coding block by applying multi-tree partitioning may be referred to as a sub coding block. When the partition depth of the coding block is k, the partition depth of the sub coding block is set to k+1.
[0124] In contrast, for a coding block whose partition depth is k+1, the coding block whose partition depth is k may be referred to as a parent coding block.
[0125] The partition type of the current coding block may be determined based on at least one of the partition type of the parent coding block and the partition type of the adjacent coding block. In this regard, the adjacent coding block may be a block adjacent to the current coding block, and may include at least one of an upper adjacent block, a left adjacent block, or an adjacent block adjacent to the upper left of the current coding block. In this regard, the partition type may include whether quadtree partitioning is applied, whether binary tree partitioning is applied, the direction of binary tree partitioning, whether ternary tree partitioning is applied, or the direction of ternary tree partitioning.
[0126] In order to determine the partition type of the coding block, information indicating whether the coding block is partitioned may be signaled in the bitstream. This information may be a 1-bit flag "split_cu_flag", and when the flag is true, it may indicate that the coding block is partitioned by a multi-tree partitioning method.
[0127] When split_cu_flag is true, information indicating whether the coding block is partitioned by quadtree partitioning may be signaled in the bitstream. This information may be a 1-bit flag split_qt_flag, and when this flag is true, the coding block may be partitioned into four blocks.
[0128] In the example, Figure 5 In the example shown in , the CTU is partitioned by quadtree partitioning, and thus four coding blocks with a partition depth of 1 are generated. In addition, it is shown that quadtree partitioning is applied again to the first coding block and the fourth coding block among the four coding blocks generated by quadtree partitioning. As a result, four coding blocks with a partition depth of 2 can be generated.
[0129] In addition, by applying quadtree partitioning again to the coding block with a partition depth of 2, a coding block with a partition depth of 3 may be generated.
[0130] When quadtree partitioning is not applied to a coding block, it may be determined whether to perform binary tree partitioning or ternary tree partitioning on the coding block according to at least one of the size of the coding block, whether the coding block is located at a picture boundary, the maximum partition depth, or the partition type of the neighboring block. When it is determined that binary tree partitioning or ternary tree partitioning is performed on the coding block, information indicating the partition direction may be sent by signal in the bitstream. The information may be a 1-bit flag mtt_split_cu_vertical_flag. Based on the flag, it may be determined whether the partition direction is vertical or horizontal. In addition, information indicating which of binary tree partitioning or ternary tree partitioning is applied to the coding block may be sent by signal in the bitstream. The information may be a 1-bit flag mtt_split_cu_binary_flag. Based on the flag, it may be determined whether binary tree partitioning is applied to the coding block or ternary tree partitioning is applied to the coding block.
[0131] In the example, Figure 5 In the example shown in , vertical binary tree partitioning is applied to a coding block with a partition depth of 1, vertical ternary tree partitioning is applied to a left coding block among the coding blocks generated by the vertical binary tree partitioning, and vertical binary tree partitioning is applied to a right coding block.
[0132] Inter prediction is a prediction coding mode that predicts a current block by using information about a previous picture. In an example, a block in a previous picture that is located at the same position as the current block (hereinafter referred to as a co-located block) may be set as a prediction block of the current block. Hereinafter, a prediction block generated based on the co-located block of the current block may be referred to as a co-located prediction block.
[0133] In contrast, when an object existing in a previous picture has moved to another position in a current picture, the current block can be effectively predicted by using the motion of the object. For example, when the moving direction and size of the object are determined by comparing the previous picture with the current picture, a prediction block (or a prediction image) of the current block can be generated according to the motion information of the object. Hereinafter, the prediction block generated by using the motion information may be referred to as a motion prediction block.
[0134] The residual block may be generated by subtracting the prediction block from the current block. In this regard, in the case where the object moves, the energy of the residual block may be reduced by using the motion prediction block instead of using the co-located prediction block, and thus the compression performance of the residual block may be improved.
[0135] As above, the operation of generating a prediction block by using motion information may be referred to as motion estimation prediction. In most inter predictions, a prediction block may be generated based on motion compensation prediction.
[0136] The motion information may include at least one of a motion vector, a reference picture index, a prediction direction, and a bidirectional weighting factor index. The motion vector represents the moving direction and magnitude of an object. The reference picture index specifies a reference picture of a current block among reference pictures included in a reference picture list. The prediction direction indicates any one of unidirectional L0 prediction, unidirectional L1 prediction, or bidirectional prediction (L0 prediction and L1 prediction). At least one of L0 direction motion information and L1 direction motion information may be used according to the prediction direction of the current block. The bidirectional weighting factor index specifies a weighting factor applied to an L0 prediction block and a weighting factor applied to an L1 prediction block.
[0137] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.
[0138] Reference Figure 6 The inter-frame prediction method includes: determining an inter-frame prediction mode for a current block (S601), obtaining motion information of the current block according to the determined inter-frame prediction mode (S602), and performing motion compensation prediction on the current block based on the obtained motion information (S603).
[0139] In this regard, the inter prediction mode may represent various methods for determining motion information of the current block, and may include an inter prediction mode using translational motion information, an inter prediction mode using affine motion information. In an example, the inter prediction mode using translational motion information may include a merge mode and a motion vector prediction mode, and the inter prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. The motion information about the current block may be determined based on neighboring blocks adjacent to the current block or information obtained by parsing a bitstream.
[0140] The motion information of the current block may be derived from the motion information of another block. In this regard, the other block may be a block that is encoded / decoded by inter-frame prediction before the current block. The operation of setting the motion information of the current block to be the same as the motion information of the other block may be defined as a merge mode. In addition, the operation of setting the motion vector of the other block to the predicted value of the motion vector of the current block may be referred to as a motion vector prediction mode.
[0141] Figure 7 is a flow chart of a process for deriving motion information for a current block in merge mode.
[0142] A merge candidate of a current block may be derived (S701). The merge candidate of the current block may be derived from a block encoded / decoded by inter prediction before the current block.
[0143] Figure 8 is a diagram illustrating candidate blocks for deriving merge candidates.
[0144] The candidate block may include at least one of a neighboring block including samples adjacent to the current block or a non-neighboring block including samples not adjacent to the current block. Hereinafter, samples for determining the candidate block are defined as basic samples. In addition, basic samples adjacent to the current block are referred to as neighboring basic samples, and basic samples not adjacent to the current block are referred to as non-neighboring basic samples.
[0145] The neighboring basic sample points may be included in the neighboring columns of the leftmost column of the current block or the neighboring rows of the uppermost row of the current block. In an example, when the coordinates of the upper left sample point of the current block are (0,0), at least one block among the blocks including the basic sample points at positions (-1,H-1), (W-1,-1), (W,-1), (-1,H) or (-1,-1) may be used as a candidate block. Referring to the diagram, neighboring blocks of index 0 to index 4 may be used as candidate blocks.
[0146] The non-neighboring basic sample points represent samples having at least one of an x-axis distance or a y-axis distance with respect to the basic sample points adjacent to the current block having a predefined value. In an example, at least one of a block including a basic sample point having an x-axis distance with respect to the left basic sample point having a predefined value, a block including a non-neighboring sample point having a y-axis distance with respect to the upper basic sample point having a predefined value, or a block including a non-neighboring sample point having an x-axis distance and a y-axis distance with respect to the upper left basic sample point having predefined values may be used as a candidate block. The predefined value may be a natural number such as 4, 8, 12, 16, etc. Referring to the diagram, at least one block of index 5 to index 26 may be used as a candidate block.
[0147] Sample points that are not located on the same vertical line, horizontal line, or diagonal line as adjacent basic sample points may be set as non-adjacent basic sample points.
[0148] Fig. 9 is a diagram showing the positions of basic sample points.
[0149] As in Fig. 9 In the example shown in , the x-coordinate of the upper non-adjacent basic sample point may be set to be different from the x-coordinate of the upper adjacent basic sample point. As an example, when the position of the upper adjacent basic sample point is (W-1, -1), the position of the upper non-adjacent basic sample point spaced N apart from the upper adjacent basic sample point on the y-axis is set to ((W / 2)-1, -1-N), and the position of the upper non-adjacent basic sample point spaced 2N apart from the upper adjacent basic sample point on the y-axis is set to (0, -1-2N). That is, the position of the non-adjacent basic sample point may be determined based on the position of the adjacent basic sample point and the distance from the non-adjacent basic sample point to the adjacent basic sample point.
[0150] Hereinafter, among candidate blocks, a candidate block including neighboring basic samples is referred to as a neighboring block, and a block including non-neighboring basic samples is referred to as a non-neighboring block.
[0151] When the distance between the current block and the candidate block is equal to or greater than the threshold, the candidate block is set to be unavailable as a merge candidate. The threshold may be determined based on the size of the coding tree unit. As an example, the threshold may be set to the value of the height (ctu_height) of the coding tree unit or a value obtained by adding or subtracting an offset from the height of the coding tree unit (e.g., ctu_height±N). The offset N is a value predefined in the encoder and decoder and may be set to 4, 8, 16, 32, or ctu_height.
[0152] When the difference between the y-axis coordinate of the current block and the y-axis coordinate of the samples included in the candidate block is greater than a threshold value, it is determined that the candidate block is not usable as a merge candidate.
[0153] Optionally, a candidate block that does not belong to the same coding tree unit as the current block may be set to be unavailable as a merge candidate. In an example, when the base sample is outside the upper boundary of the coding tree unit to which the current block belongs, the candidate block including the base sample may be set to be unavailable as a merge candidate.
[0154] When the upper boundary of the current block is adjacent to the upper boundary of the coding tree unit, it is determined that multiple candidate blocks are not available as merge candidates, so the encoding / decoding efficiency of the current block may be reduced. In order to solve such a problem, the candidate blocks can be set so that the number of candidate blocks located on the left side of the current block is greater than the number of candidate blocks located above the current block.
[0155] Fig.10 is a diagram illustrating an example of candidate blocks for deriving merge candidates.
[0156] As in Fig.10 In the example shown, the upper blocks of the N block columns above the current block and the left blocks of the M block columns to the left of the current block can be set as candidate blocks. Here, by setting M to be greater than N, the number of left candidate blocks can be set to be greater than the number of upper candidate blocks.
[0157] As an example, the difference between the y-axis coordinate of the basic sample point in the current block and the y-axis coordinate of the upper block that can be used as the candidate block can be set to not more than N times the height of the current block. In addition, the difference between the x-axis coordinate of the basic sample point in the current block and the x-axis coordinate of the left block that can be used as the candidate block can be set to not more than M times the width of the current block.
[0158] As an example, Fig.10 The example in shows that blocks belonging to two block columns above the current block and blocks belonging to five block columns to the left of the current block are set as candidate blocks.
[0159] As another example, when the candidate block does not belong to the same coding tree unit as the current block, a block belonging to the same coding tree unit as the current block or a block including basic samples adjacent to a boundary of the coding tree unit is used (instead of using the candidate block) to derive a merge candidate.
[0160] Fig.11 is a diagram showing an example of changing the position of the basic sample point.
[0161] When the base sample and the current block are included in different coding tree units and the base sample is not adjacent to a boundary of the coding tree unit, the candidate block is determined using the base sample adjacent to the boundary of the coding tree unit instead of using the base sample.
[0162] As an example, in Fig.11 (a) and Fig.11 In the example shown in (b), when the upper boundary of the current block contacts the upper boundary of the coding tree unit, the basic samples above the current block belong to different coding tree units than the current block. Among the basic samples belonging to different coding tree units than the current block, the basic samples not adjacent to the upper boundary of the coding tree unit may be replaced by samples adjacent to the upper boundary of the coding tree unit.
[0163] As an example, in Fig.11 In the example shown in (a) of FIG. 1 , the basic sample at position 6 can be replaced by the sample at position 6' located at the upper boundary of the coding tree unit. Fig.11In the example shown in (b) of FIG. 1 , the basic sample at position 15 may be replaced with a sample at position 15' located at the upper boundary of the coding tree unit. Here, the y coordinate of the replacement sample may be changed to a position adjacent to the coding tree unit, and the x coordinate of the replacement sample may be set to be the same as the x coordinate of the basic sample. As an example, the sample at position 6' may have the same x coordinate as the sample at position 6. The sample at position 15' may have the same x coordinate as the sample at position 15.
[0164] Optionally, the result of adding or subtracting the offset from the x-coordinate of the basic sample point may be set as the x-coordinate of the replacement sample point. As an example, when the adjacent basic sample point and the non-adjacent basic sample point located above the current block have the same x-coordinate, the result of adding or subtracting the offset from the x-coordinate of the basic sample point is set as the x-coordinate of the replacement sample point. This is to prevent the replacement sample point that replaces the non-adjacent basic sample point from being at the same position as another non-adjacent basic sample point or the adjacent basic sample point.
[0165] Fig.12 is a diagram showing an example of changing the position of the basic sample point.
[0166] When a basic sample that is included in a different coding tree unit from the current block and is not adjacent to the boundary of the coding tree unit is replaced with a sample located at the boundary of the coding tree unit, a value obtained by adding or subtracting an offset from the x-coordinate of the basic sample may be set as the x-coordinate of the replacement sample.
[0167] As an example, in Fig.12 In the example shown, the basic sample at position 6 and the basic sample at position 15 may be replaced with the sample at position 6' and the sample at position 15', respectively, wherein the y coordinates of the sample at position 6' and the sample at position 15' are the same as the y coordinates of the row adjacent to the upper boundary of the coding tree unit. Here, the x coordinate of the sample at position 6' is set to a value obtained by subtracting W / 2 from the x coordinate of the basic sample at position 6. The x coordinate of the sample at position 15' may be set to a value obtained by subtracting W-1 from the x coordinate of the basic sample at position 15.
[0168] and Fig.11 and Fig.12 Different from the example shown in , the y coordinate of a row located above the top row of the current block or the y coordinate of the upper boundary of the coding tree unit can be set as the y coordinate of the replacement sample point.
[0169] Although not shown, a sample replacing the basic sample may be determined based on the left boundary of the coding tree unit. As an example, when the basic sample is not included in the same coding tree unit as the current block and is not adjacent to the left boundary of the coding tree unit, the basic sample is replaced with a sample adjacent to the left boundary of the coding tree unit. Here, the replacement sample may have the same y coordinate as the basic sample, or may have a y coordinate obtained by adding an offset to or subtracting an offset from the y coordinate of the basic sample.
[0170] Thereafter, the block including the replacement sample point may be set as a candidate block, and a merge candidate of the current block may be derived based on the candidate block.
[0171] The merge candidate may be derived from a temporally adjacent block included in a different picture from the current block. In an example, the merge candidate may be derived from a co-located block included in a co-located picture. Any one of the reference pictures included in the reference picture list may be set as the co-located picture. Index information identifying the co-located picture in the reference picture may be signaled in the bitstream. Optionally, a reference picture having a predefined index in the reference picture may be determined as the co-located picture.
[0172] The motion information of the merge candidate may be set to be the same as the motion information of the candidate block. In an example, at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index of the candidate block may be set to the motion information of the merge candidate.
[0173] A merge candidate list including merge candidates may be generated ( S702 ).
[0174] The indexes of the merge candidates in the merge candidate list may be assigned according to a predetermined order. In an example, the indexes may be assigned in the order of: merge candidates derived from the left neighboring block, merge candidates derived from the upper neighboring block, merge candidates derived from the upper right neighboring block, merge candidates derived from the lower left neighboring block, merge candidates derived from the upper left neighboring block, and merge candidates derived from the temporal neighboring block.
[0175] When multiple merge candidates are included in the merge candidate list, at least one of the multiple merge candidates may be selected (S703). Specifically, information for specifying any one of the multiple merge candidates may be signaled in the bitstream. In the example, information merge_idx indicating an index of any one of the merge candidates included in the merge candidate list may be signaled in the bitstream.
[0176] When the number of merge candidates included in the merge candidate list is less than the threshold value, the motion information candidate included in the motion information table may be added to the merge candidate list as a merge candidate. In this regard, the threshold value may be the maximum number of merge candidates that may be included in the merge candidate list or a value minus an offset from the maximum number of merge candidates. The offset may be a natural number (such as 1 or 2, etc.).
[0177] The motion information table includes motion information candidates derived from a block encoded / decoded based on inter-frame prediction in a current picture. In an example, motion information of the motion information candidate included in the motion information table may be set to be the same as motion information of the block encoded / decoded based on inter-frame prediction. In this regard, the motion information may include at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index.
[0178] The motion information candidates included in the motion information table may also be referred to as inter region merging candidates or prediction region merging candidates.
[0179] The maximum number of motion information candidates that can be included in the motion information table can be predefined in the encoder and the decoder. In an example, the maximum number of motion information candidates that can be included in the motion information table can be 1, 2, 3, 4, 5, 6, 7, 8 or more (e.g., 16).
[0180] Optionally, information indicating the maximum number of motion information candidates that can be included in the motion information table may be signaled in the bitstream. The information may be signaled at a sequence, picture, or slice level. The information may indicate the maximum number of motion information candidates that can be included in the motion information table. Optionally, the information may indicate the difference between the maximum number of motion information candidates that can be included in the motion information table and the maximum number of merge candidates that can be included in the merge candidate list.
[0181] Alternatively, the maximum number of motion information candidates that can be included in the motion information table may be determined according to a picture size, a slice size, or a coding tree unit size.
[0182] The motion information table may be initialized in units of pictures, slices, tiles, blocks, coding tree units, or coding tree unit lines (rows or columns). In an example, when a slice is initialized, the motion information table is also initialized, and thus the motion information table may not include any motion information candidates.
[0183] Optionally, information indicating whether the motion information table is to be initialized may be signaled in the bitstream. The information may be signaled at a slice, tile, tile or block level. Before the information indicates initialization of the motion information table, a pre-configured motion information table may be used.
[0184] Alternatively, information about the initial motion information candidate may be signaled in a picture parameter set or a slice header. Although the slice is initialized, the motion information table may include the initial motion information candidate. Therefore, the initial motion information candidate may be used for a block of the first encoding / decoding target in the slice.
[0185] Optionally, the motion information candidate included in the motion information table of the previous coding tree unit may be set as the initial motion information candidate. In an example, the motion information candidate having the smallest index or the largest index among the motion information candidates included in the motion information table of the previous coding tree unit may be set as the initial motion information candidate.
[0186] The blocks are encoded / decoded in the order of encoding / decoding, and the blocks encoded / decoded based on the inter prediction may be sequentially set as motion information candidates in the order of encoding / decoding.
[0187] Fig.13 is a diagram for explaining the updating aspect of the motion information table.
[0188] For the current block, when inter prediction is performed (S1301), a motion information candidate may be derived based on the current block (S1302). The motion information of the motion information candidate may be set to be the same as the motion information of the current block.
[0189] When the motion information table is empty ( S1303 ), the motion information candidate derived based on the current block may be added to the motion information table ( S1304 ).
[0190] When the motion information table already includes motion information candidates (S1303), a redundancy check of the motion information of the current block (or the motion information candidates derived therefrom) may be performed (S1305). The redundancy check is used to determine whether the motion information of the pre-stored motion information candidates in the motion information table is the same as the motion information of the current block. The redundancy check may be performed on all pre-stored motion information candidates in the motion information table. Optionally, the redundancy check may be performed on motion information candidates having an index exceeding or below a threshold among the pre-stored motion information candidates in the motion information table. Optionally, the redundancy check may be performed on a predefined number of motion information candidates. In the example, the two motion information candidates having the smallest index or the two motion information candidates having the largest index may be determined as targets of the redundancy check.
[0191] When a motion information candidate having the same motion information as the current block is not included, a motion information candidate derived based on the current block may be added to the motion information table (S1308). Whether the motion information candidates are the same may be determined based on whether the motion information (e.g., motion vector / reference picture index, etc.) of the motion information candidates are the same.
[0192] In this regard, when the maximum number of motion information candidates is already stored in the motion information table (S1306), the oldest motion information candidate may be deleted (S1307), and the motion information candidate derived based on the current block may be added to the motion information table (S1308). In this regard, the oldest motion information candidate may be a motion information candidate having a maximum or minimum index.
[0193] The motion information candidates may be identified by corresponding indexes. When the motion information candidates derived from the current block are added to the motion information table, the minimum index (e.g., 0) may be assigned to the motion information candidates, and the index of the pre-stored motion information candidates may be increased by 1. In this regard, when the maximum number of motion information candidates is already stored in the motion information table, the motion information candidate with the largest index is removed.
[0194] Optionally, when a motion information candidate derived from the current block is added to the motion information table, a maximum index may be assigned to the motion information candidate. In an example, when the number of pre-stored motion information candidates in the motion information table is less than a maximum value, an index having the same value as the number of pre-stored motion information candidates may be assigned to the motion information candidate. Optionally, when the number of pre-stored motion information candidates in the motion information table is equal to a maximum value, an index obtained by subtracting 1 from the maximum value may be assigned to the motion information candidate. Optionally, the motion information candidate having the smallest index is removed, and the indexes of the remaining pre-stored motion information candidates are reduced by 1.
[0195] Fig.14 is a diagram illustrating an updating aspect of a motion information table.
[0196] It is assumed that when a motion information candidate derived from the current block is added to the motion information table, a maximum index is assigned to the motion information candidate. In addition, it is assumed that a maximum number of motion information candidates are already stored in the motion information table.
[0197] When the motion information candidate HmvpCand[n+1] derived from the current block is added to the motion information table HmvpCandList, the motion information candidate HmvpCand[0] having the smallest index among the pre-stored motion information candidates may be deleted, and the index of the residual motion information candidate may be reduced by 1. In addition, the index of the motion information candidate HmvpCand[n+1] derived from the current block may be set to the maximum value (for Fig.14 The example shown in , n).
[0198] When the same motion information candidate as the motion information candidate derived based on the current block is pre-stored ( S1305 ), the motion information candidate derived based on the current block may not be added to the motion information table ( S1309 ).
[0199] Optionally, when the motion information candidate derived based on the current block is added to the motion information table, the pre-stored motion information candidate identical to the motion information candidate may be removed. In this case, it produces the same effect as when the index of the pre-stored motion information candidate is newly updated.
[0200] Fig.15 is a diagram showing an example in which indexes of pre-stored motion information candidates are updated.
[0201] When the index of the pre-stored motion information candidate that is the same as the motion information candidate mvCand derived from the current block is hIdx, the pre-stored motion information candidate may be removed, and the index of the motion information candidate having an index greater than hIdx may be reduced by 1. In an example, Fig.15 The example shown in shows that HmvpCand[2] identical to mvCand is deleted in the motion information table HvmpCandList, and the indexes from HmvpCand[3] to HmvpCand[n] are decreased by 1.
[0202] And, the motion information candidate mvCand derived based on the current block may be added to the end of the motion information table.
[0203] Alternatively, an index assigned to the same pre-stored motion information candidate as the motion information candidate derived based on the current block may be updated. For example, the index of the pre-stored motion information candidate may be changed to a minimum value or a maximum value.
[0204] The motion information of the blocks included in the predetermined area may be set not to be added to the motion information table. In an example, the motion information candidates derived based on the motion information of the blocks included in the merge processing area may not be added to the motion information table. Since the encoding / decoding order of the blocks included in the merge processing area is not defined, it is inappropriate to use the motion information of any one of them for inter-frame prediction of another one of them. Therefore, the motion information candidates derived based on the blocks included in the merge processing area may not be added to the motion information table.
[0205] Optionally, the motion information of a block smaller than a preset size may be set not to be added to the motion information table. In an example, the motion information candidate derived based on the motion information of a coding block with a width or height less than 4 or 8 or the motion information of a coding block of 4×4 size may not be added to the motion information table.
[0206] When motion compensated prediction is performed on a per-subblock basis, a motion information candidate may be derived based on motion information of a representative subblock among a plurality of subblocks included in the current block. In an example, when a subblock merge candidate is used for the current block, a motion information candidate may be derived based on motion information of a representative subblock among the subblocks.
[0207] The motion vector of the sub-block can be derived in the following order. First, any one of the merge candidates included in the candidate list of the current block can be selected, and the initial shift vector (shVector) can be derived based on the motion vector of the selected merge candidate. And, the shifted sub-block whose basic sample is located at (xColSb, yColSb) can be derived by adding the initial shift vector to the position (xSb, ySb) of the basic sample (e.g., the upper left sample or the center sample) of each sub-block in the coding block. The following equation 1 shows a formula for deriving a shifted sub-block.
[0208] [Equation 1]
[0209] (xColSb, yColSb) = (xSb+shVector[0]>>4, ySb+shVecror[1]>>4)
[0210] Then, a motion vector of a collocated block corresponding to a center position of a sub-block including (xColSb, yColSb) may be set as a motion vector of the sub-block including (xSb, ySb).
[0211] The representative sub-block may mean a sub-block including an upper left sample point, a center sample point, a lower right sample point, or a lower left sample point of the current block.
[0212] Fig.16 is a diagram showing the positions of representative sub-blocks.
[0213] Fig.16 (a) shows an example in which a sub-block located at the upper left of the current block is set as a representative sub-block, and Fig.16 (b) shows an example in which a subblock located at the center of the current block is set as a representative subblock. When motion compensation prediction is performed based on subblocks, a motion information candidate of the current block may be derived based on a motion vector of a subblock including an upper left sample of the current block or including a central sample of the current block.
[0214] Based on the inter prediction mode of the current block, it may be determined whether the current block will be used as a motion information candidate. In an example, a block encoded / decoded based on an affine motion model may be set to be unusable as a motion information candidate. Therefore, although the current block is encoded / decoded by inter prediction, when the inter prediction mode of the current block is an affine prediction mode, the motion information table may not be updated based on the current block.
[0215] Alternatively, whether to use the current block as a motion information candidate may be determined based on at least one of a motion vector resolution of the current block, whether a merge offset encoding method is applied, whether a combined prediction is applied, or whether a triangle partition is applied. As an example, the current block may be set to be unusable as a motion information candidate in at least one of the following cases: a motion information resolution of the current block is equal to or greater than 2 integer pels, combined prediction is applied to the current block, triangle partition is applied to the current block, or a merge offset encoding method is applied to the current block.
[0216] Alternatively, the motion information candidate may be derived based on at least one sub-block vector of a sub-block included in a block encoded / decoded based on an affine motion model. In an example, the motion information candidate may be derived by using a sub-block located at the upper left, center, or upper right of the current block. Alternatively, an average value of sub-block vectors of a plurality of sub-blocks may be set as a motion vector of the motion information candidate.
[0217] Alternatively, the motion information candidate may be derived based on an average value of affine seed vectors of blocks encoded / decoded according to an affine motion model. In an example, at least an average value of a first affine seed vector, a second affine seed vector, or a third affine seed vector of the current block may be set as a motion vector of the motion information candidate.
[0218] Optionally, the motion information table may be configured according to the inter prediction mode. In an example, at least one of a motion information table of a block encoded / decoded by intra block copying, a motion information table of a block encoded / decoded based on a translational motion model, or a motion information table of a block encoded / decoded based on an affine motion model may be defined. Depending on the inter prediction mode of the current block, any one of the plurality of motion information tables may be selected.
[0219] Fig.17 An example of generating a motion information table according to the inter prediction mode is shown.
[0220] When a block is encoded / decoded based on a non-affine motion model, the motion information candidate mvCand derived based on the block can be added to the non-affine motion information table HmvpCandList. On the other hand, when a block is encoded / decoded based on an affine motion model, the motion information candidate mvAfCand derived based on the above model can be added to the affine motion information table HmvpCandList.
[0221] The affine seed vector of the above block may be stored in the motion information candidate derived from the block encoded / decoded based on the affine motion model. Therefore, the motion information candidate may be used as a merge candidate for deriving the affine seed vector of the current block.
[0222] Optionally, a motion information table may be constructed for each motion vector resolution. As an example, at least one of the following may be defined: a motion information table for storing motion information with a motion vector resolution of 1 / 16 pel, a motion information table for storing motion information with a motion vector resolution of 1 / 4 pel, a motion information table for storing motion information with a motion vector resolution of 1 / 2 pel, a motion information table for storing motion information with a motion vector resolution of an integer pel, or a motion information table for storing motion information with a motion vector resolution of 4 integer pels.
[0223] Fig.18 is a diagram showing an example of generating a motion information table for each motion vector resolution.
[0224] When the motion vector resolution of the block has 1 / 4 pel, the motion information mvCand of the block is stored in the 1 / 4 pel motion information table HmvpQPCandList. However, when the motion vector resolution of the block has integer pel, the motion information mvCand of the block is stored in the integer pel motion information table HmvpIPCandList. When the motion vector resolution of the block has 4 integer pel, the motion information mvCand of the block is stored in the 4 integer pel motion information table Hmvp4IPCandList.
[0225] Depending on the motion vector resolution of the current block, a motion information table may be selected, and a merge candidate of the current block may be derived. As an example, when the motion vector resolution of the current block is 1 / 4 pel, the 1 / 4 pel motion information table HmvpQPCandList is used to derive the merge candidate of the current block. However, when the motion vector resolution of the current block is integer pel, the integer pel motion information table HmvpIPCandList is used to derive the merge candidate of the current block.
[0226] Alternatively, the motion information of the block to which the merge offset encoding method is applied may be stored in a separate motion information table.
[0227] Fig.19 is a diagram illustrating an example of storing motion information of a block to which a merge offset encoding method is applied in a separate motion information table.
[0228] When the merged offset vector encoding method is not applied to the block, the motion information mvCand of the block is stored in the motion information table HmvpCandList. On the contrary, when the merged offset vector encoding method is applied to the block, the motion information mvCand of the block is not stored in the motion information table HmvpCandList, but is stored in the merged offset motion information table HmvpMMVDCandList.
[0229] Depending on whether the merge offset vector encoding method is applied to the current block, the motion information table may be selected. As an example, when the merge offset encoding method is not applied to the current block, the merge candidate of the current block is derived using the motion information table HmvpCandList. On the contrary, when the merge offset encoding method is applied to the current block, the merge candidate of the current block is derived using the merge offset motion information table HmvpMMVDCandList.
[0230] In addition to the motion information table described, another motion information table may be defined. In addition to the above-mentioned motion information table (hereinafter referred to as the first motion information table), a long-term motion information table (hereinafter referred to as the second motion information table) may be defined. In this regard, the long-term motion information table includes long-term motion information candidates.
[0231] When both the first motion information table and the second motion information table are empty, first, the motion information candidate may be added to the second motion information table. After the number of motion information candidates available for the second motion information table reaches the maximum number, the motion information candidate may be added to the first motion information table.
[0232] Alternatively, one motion information candidate may be added to both the second motion information table and the first motion information table.
[0233] In this regard, the fully filled second motion information table may not be updated any more. Alternatively, when the decoding area in the slice exceeds a predetermined ratio, the second motion information table may be updated. Alternatively, the second motion information table may be updated every N coding tree unit lines.
[0234] On the other hand, whenever an encoding / decoding block is generated by inter prediction, the first motion information table may be updated. However, the motion information candidate added to the second motion information table may be set not to be used for updating the first motion information table.
[0235] Information for selecting any one of the first motion information table or the second motion information table may be signaled in the bitstream. When the number of merge candidates included in the merge candidate list is less than a threshold, the motion information candidate included in the motion information table indicated by the information may be added as a merge candidate to the merge candidate list.
[0236] Alternatively, the motion information table may be selected based on the size of the current block, the shape of the current block, the inter prediction mode of the current block, whether bidirectional prediction is applied to the current block, whether the motion vector is refined, or whether triangle partitioning is applied to the current block.
[0237] Alternatively, when the number of merge candidates included in the merge candidate list is less than a maximum number although the motion information candidate included in the first motion information table is added, the motion information candidate included in the second motion information table may be added to the merge candidate list.
[0238] Fig. 20 is a diagram illustrating an example of adding motion information candidates included in a long-term motion information table to a merge candidate list.
[0239] In the case where the number of merge candidates included in the merge candidate list is less than the maximum number, the motion information candidates included in the first motion information table HmvpCandList may be added to the merge candidate list. When the number of merge candidates included in the merge candidate list is less than the maximum number although the motion information candidates included in the first motion information table are added to the merge candidate list, the motion information candidates included in the long-term motion information table HmvpLTCandList may be added to the merge candidate list.
[0240] Table 1 shows a process of adding motion information candidates included in the long-term information table to a merge candidate list.
[0241] [Table 1]
[0242]
[0243] The motion information candidate may be set to include additional information in addition to the motion information. In an example, at least one of the size, shape, or partition information of the block may be additionally stored in the motion information candidate. When configuring the merge candidate list of the current block, only motion information candidates whose size, shape, or partition information is the same as or similar to that of the current block in the motion information candidate may be used, or motion information candidates whose size, shape, or partition information is the same as or similar to that of the current block may be pre-added to the merge candidate list. Optionally, a motion information table may be generated according to the block size, shape, or partition information. The merge candidate list of the current block may be configured by using a motion information table that matches the shape, size, or partition information of the current block among a plurality of motion information tables.
[0244] When the number of merge candidates included in the merge candidate list of the current block is less than a threshold value, the motion information candidate included in the motion information table may be added to the merge candidate list as a merge candidate. The additional processing is performed in an order reflecting the sorting order of the indexes of the motion information candidates in ascending or descending order. In an example, the motion information candidate with the largest index may be first added to the merge candidate list of the current block.
[0245] When a motion information candidate included in the motion information table is added to a merge candidate list, a redundancy check between the motion information candidate and a pre-stored merge candidate in the merge candidate list may be performed. As a result of the redundancy check, a motion information candidate having the same motion information as the pre-stored merge candidate may not be added to the merge candidate list.
[0246] In an example, Table 2 shows a process of adding motion information candidates to the merge candidate list.
[0247] [Table 2]
[0248]
[0249] The redundancy check may be performed only on a portion of the motion information candidates included in the motion information table. In an example, the redundancy check may be performed only on the motion information candidates having an index exceeding or below a threshold. Alternatively, the redundancy check may be performed only on N motion information candidates having a maximum index or a minimum index. Alternatively, the redundancy check may be performed only on a portion of the pre-stored merge candidates in the merge candidate list. In an example, the redundancy check may be performed only on merge candidates having an index exceeding or below a threshold or on merge candidates derived from a block at a specific position. In this regard, the specific position may include at least one of a left neighboring block, an upper neighboring block, an upper right neighboring block, or a lower left neighboring block of the current block.
[0250] Fig.21 is a diagram illustrating an example of performing redundancy check on only a part of merge candidates.
[0251] When the motion information candidate HmvpCand[j] is added to the merge candidate list, a redundancy check with 2 merge candidates mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1] having the largest index may be performed for the motion information candidate. In this regard, NumMerge may show the number of available spatial merge candidates and temporal merge candidates.
[0252] Unlike the example shown, when the motion information candidate HmvpCand[j] is added to the merge candidate list, a redundancy check with two merge candidates with the smallest index may be performed for the motion information candidate. For example, it may be checked whether mergeCandList[0] and mergeCandList[1] are the same as HmvpCand[j].
[0253] Optionally, a redundancy check may be performed only on merge candidates derived from a specific position. In an example, a redundancy check may be performed on at least one of merge candidates derived from a neighboring block located to the left of the current block or above the current block. When there is no merge candidate derived from a specific position in the merge candidate list, the motion information candidate may be added to the merge candidate list without a redundancy check.
[0254] When the motion information candidate HmvpCand[j] is added to the merge candidate list, a redundancy check with 2 merge candidates mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1] having the largest index may be performed for the motion information candidate. In this regard, NumMerge may show the number of available spatial merge candidates and temporal merge candidates.
[0255] A redundancy check with merge candidates may be performed only on a portion of the motion information candidates. In an example, a redundancy check may be performed only on N motion information candidates having large indexes or small indexes among the motion information candidates included in the motion information table. In an example, a redundancy check may be performed only on motion information candidates having indexes whose difference between the number of motion information candidates and the index is lower than a threshold among the motion information candidates included in the motion information table. When the threshold is 2, a redundancy check may be performed only on 3 motion information candidates having the largest index value among the motion information candidates included in the motion information table. For motion information candidates other than the above 3 motion information candidates, the redundancy check may be omitted. When the redundancy check is omitted, the motion information candidate may be added to the merge candidate list regardless of whether there is the same motion information as the merge candidate.
[0256] In contrast, the redundancy check is set to be performed only on the motion information candidates having the index whose difference between the number of motion information candidates and the index exceeds the threshold value among the motion information candidates included in the motion information table.
[0257] The number of motion information candidates for performing redundancy check may be redefined in the encoder and the decoder. In an example, the threshold may be an integer (such as 0, 1, or 2).
[0258] Alternatively, the threshold may be determined based on at least one of the number of merge candidates included in the merge candidate list or the number of motion information candidates included in the motion information table.
[0259] When the merge candidate identical to the first motion information candidate is found, redundant checking of the merge candidate identical to the first motion information candidate may be omitted in redundant checking of the second motion information candidate.
[0260] Fig. 22is a diagram showing an example in which a redundancy check on a specific merge candidate is omitted.
[0261] When the motion information candidate HmvpCand[i] with index i is added to the merge candidate list, a redundant check is performed between the motion information candidate and the pre-stored merge candidates in the merge candidate list. In this regard, when a merge candidate mergeCandlist[j] identical to the motion information candidate HmvpCand[i] is found, a redundant check can be performed between the motion information candidate HmvpCand[i-1] with index i-1 and the merge candidate without adding the motion information candidate HmvpCand[i] to the merge candidate list. In this regard, the redundant check between the motion information candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted.
[0262] In the example, Fig. 22 In the example shown, it is determined that HmvpCand[1] and mergeCandList[2] are the same. Therefore, a redundancy check of HmvpCand[i-1] may be performed without HmvpCand[i] being added to the merge candidate list. In this regard, a redundancy check between HmvpCand[i-1] and mergeCandList[2] may be omitted.
[0263] When the number of merge candidates included in the merge candidate list of the current block is less than a threshold value, at least one of a paired merge candidate or a zero merge candidate may be further included in addition to the motion information candidate. The paired merge candidate indicates a merge candidate having a value obtained by averaging motion vectors of more than 2 merge candidates as a motion vector, and the zero merge candidate indicates a merge candidate having a motion vector of 0.
[0264] For the merge candidate list of the current block, merge candidates may be added in the following order.
[0265] Spatial merging candidate - Temporal merging candidate - Motion information candidate - (affine motion information candidate) - Paired merging candidate - Zero merging candidate
[0266] The spatial merge candidate refers to a merge candidate derived from at least one of a neighboring block or a non-neighboring block, and the temporal merge candidate refers to a merge candidate derived from a previous reference picture. The affine motion information candidate refers to a motion information candidate derived from a block encoded / decoded by an affine motion model.
[0267] The motion information table may be used in a motion vector prediction mode. In an example, when the number of motion vector prediction candidates included in the motion vector prediction candidate list of the current block is less than a threshold value, the motion information candidate included in the motion information table may be set as a motion vector prediction candidate for the current block. Specifically, the motion vector of the motion information candidate may be set as a motion vector prediction candidate.
[0268] If any one of the motion vector prediction candidates included in the motion vector prediction candidate list of the current block is selected, the selected candidate may be set as a motion vector predictor of the current block. Then, after decoding the motion vector residual value of the current block, the motion vector of the current block may be obtained by adding the motion vector predictor and the motion vector residual value.
[0269] The motion vector prediction candidate list of the current block may be configured in the following order.
[0270] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Motion information candidate - (affine motion information candidate) - Zero motion vector prediction candidate
[0271] A spatial motion vector prediction candidate represents a motion vector prediction candidate derived from at least one of a neighboring block or a non-neighboring block, and a temporal motion vector prediction candidate represents a motion vector prediction candidate derived from a previous reference picture. An affine motion information candidate represents a motion information candidate derived from a block encoded / decoded according to an affine motion model. A zero motion vector prediction candidate represents a candidate whose motion vector value is 0.
[0272] A merge processing area larger than a coding block can be defined. The coding blocks included in the merge processing area can be processed in parallel without being encoded / decoded sequentially. In this regard, not being encoded / decoded sequentially means that the order of encoding / decoding is not defined. Therefore, the encoding / decoding processing of the blocks included in the merge processing area can be processed independently. Optionally, the blocks included in the merge processing area can share merge candidates. In this regard, merge candidates can be derived based on the merge processing area.
[0273] According to the above features, the merged processing region may be referred to as a parallel processing region, a shared merge region (SMR), or a merged estimation region (MER).
[0274] A merge candidate of the current block may be derived based on the coding block. However, when the current block is included in a merge processing region larger than the current block, a candidate block included in the same merge processing region as the current block may be set to be unavailable as a merge candidate.
[0275] Fig.23 is a diagram showing an example in which a candidate block included in the same merge processing region as a current block is set to be unusable as a merge candidate.
[0276] exist Fig.23 In the example shown in (a), in the decoding / decoding of CU5, a block including basic samples adjacent to CU5 may be set as a candidate block. In this regard, candidate blocks X3 and X4 included in the same merge processing region as CU5 may be set to be unusable as merge candidates for CU5. However, candidate blocks X0, X1, and X2 not included in the same merge processing region as CU5 may be set to be usable as merge candidates.
[0277] exist Fig.23 In the example shown in (b), in the decoding / decoding of CU8, a block including basic samples adjacent to CU8 may be set as a candidate block. In this regard, candidate blocks X6, X7, and X8 included in the same merge processing region as CU8 may be set to be unusable as merge candidates. However, candidate blocks X5 and X9 not included in the same merge processing region as CU8 may be set to be usable as merge candidates.
[0278] Optionally, when the current block is included in the merge processing region, neighboring blocks adjacent to the current block and adjacent to the merge processing region may be set as candidate blocks.
[0279] Fig.24 is a diagram illustrating an example of deriving a merge candidate of a current block when the current block is included in a merge processing region.
[0280] As in Fig.24 In the example shown in (a), a neighboring block adjacent to the current block may be set as a candidate block for deriving a merge candidate of the current block. In this regard, a candidate block included in the same merge processing area as the current block may be set to be unusable as a merge candidate. In the example, when deriving a merge candidate for the coding block CU3, the upper neighboring block y3 and the upper right neighboring block y4 included in the same merge processing area as the coding block CU3 may be set to be unusable as a merge candidate for the coding block CU3.
[0281] By scanning neighboring blocks adjacent to the current block in a predefined order, a merge candidate may be derived. In an example, the predefined order may be the order of y1, y3, y4, y0, and y2.
[0282] When the number of merge candidates that can be derived from neighboring blocks adjacent to the current block is less than the value obtained by subtracting the offset from the maximum number of merge candidates or less than the maximum number, such as Fig.24In the example shown in (b), the merge candidate of the current block can be derived by using the neighboring blocks adjacent to the merge processing area. In the example, the neighboring blocks adjacent to the merge processing area including the coding block CU3 can be set as the candidate blocks of the coding block CU3. In this regard, the neighboring blocks adjacent to the merge processing area may include at least one of the left neighboring block x1, the upper neighboring block x3, the lower left neighboring block x0, the upper right neighboring block x4, or the upper left neighboring block x2.
[0283] By scanning neighboring blocks adjacent to the merge processing area in a predefined order, a merge candidate may be derived. In an example, the predefined order may be the order of x1, x3, x4, x0, and x2.
[0284] In summary, a merge candidate on the coding block CU3 included in the merge processing area can be derived by scanning the candidate blocks in the following scanning order.
[0285] (y1,y3,y4,y0,y2,x1,x3,x4,x0,x2)
[0286] However, the scanning order of the candidate blocks described above is only an example of the present disclosure, and the candidate blocks may be scanned in an order different from the above example. Optionally, the scanning order may be adaptively determined based on at least one of the size or shape of the current block or the merge processing area.
[0287] The merged processing area may be square or non-square. Information for determining the merged processing area may be sent by signal in the bitstream. The information may include at least one of information indicating the shape of the merged processing area or information indicating the size of the merged processing area. When the merged processing area is non-square, at least one of information indicating the size of the merged processing area, information indicating the width or height of the merged processing area, or information indicating the ratio between the width and height of the merged processing area may be sent by signal in the bitstream.
[0288] The size of the merge processing area may be determined based on at least one of information signaled in a bitstream, a picture resolution, a size of a slice, or a size of a tile.
[0289] If motion compensation prediction is performed on a block included in the merge processing area, motion information candidates derived based on motion information of the block on which motion compensation prediction is performed may be added to the motion information table.
[0290] However, if the motion information candidate derived from the block included in the merge processing area is added to the motion information table, it may happen that the motion information candidate derived from the block is used in the encoding / decoding of other blocks in the merge processing area that are actually slower than the encoding / decoding of the block. In other words, although the dependency between blocks should be excluded in the encoding / decoding of the block included in the merge processing area, it may happen that motion prediction compensation is performed by using the motion information of other blocks included in the merge processing area. In order to solve such a problem, although the encoding / decoding of the block included in the merge processing area is completed, the motion information of the encoding / decoding completed block may not be added to the motion information table.
[0291] Alternatively, the motion information table may be updated using only blocks at predefined positions within the merge processing area. Examples of the predefined position may include at least one of the following: a block located at the upper left of the merge processing area, a block located at the upper right of the merge processing area, a block located at the lower left of the merge processing area, a block located at the lower right of the merge processing area, a block located at the center of the merge processing area, a block adjacent to the right boundary of the merge processing area, and a block adjacent to the lower boundary of the merge processing area. As an example, the motion information table may be updated using only the motion information of the block adjacent to the lower right corner of the merge processing area, and the motion information table may not be updated using the motion information of other blocks.
[0292] Alternatively, after decoding of all blocks included in the merge processing area is completed, the motion information candidate derived from the block may be added to the motion information table. That is, when the block included in the merge processing area is encoded / decoded, the motion information table may not be updated.
[0293] In an example, if motion compensation prediction is performed on a block included in a merge processing area, the motion information candidate derived from the block may be added to the motion information table in a predefined order. In this regard, the predefined order may be determined according to a scanning order of coding blocks in a merge processing area or a coding tree unit. The scanning order may be at least one of a raster scan, a horizontal scan, a vertical scan, or a zigzag scan. Alternatively, the predefined order may be determined based on the motion information of each block or the number of blocks having the same motion information.
[0294] Alternatively, a motion information candidate including unidirectional motion information may be added to the motion information table before a motion information candidate including bidirectional motion information. Conversely, a motion information candidate including bidirectional motion information may be added to the motion information table before a motion information candidate including unidirectional motion information.
[0295] Alternatively, the motion information candidates may be added to the motion information table in order of high usage frequency or low usage frequency in a merge processing region or a coding tree unit.
[0296] When the current block is included in the merge processing region and the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, the motion information candidate included in the motion information table may be added to the merge candidate list. In this regard, the motion information candidate derived from the block included in the same merge processing region as the current block may be set not to be added to the merge candidate list of the current block.
[0297] Optionally, when the current block is included in the merge processing region, it may be set not to use the motion information candidates included in the motion information table. In other words, although the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, the motion information candidates included in the motion information table may not be added to the merge candidate list.
[0298] In another example, a motion information table for a merge processing region or a coding tree unit may be configured. The motion information table serves to temporarily store motion information of blocks included in the merge processing region. In order to distinguish a general motion information table from a motion information table for a merge processing region or a coding tree unit, the motion information table for the merge processing region or the coding tree unit is referred to as a temporary motion information table. And, the motion information candidates stored in the temporary motion information table are referred to as temporary motion information candidates.
[0299] Fig.25 is a diagram showing a temporary motion information table.
[0300] A temporary motion information table for a coding tree unit or a merge processing area may be configured. When motion compensation prediction is performed on a current block included in the coding tree unit or the merge processing area, the motion information of the block may not be added to the motion information table HmvpCandList. Optionally, a temporary motion information candidate derived from the block may be added to the temporary motion information table HmvpMERCandList. In other words, the temporary motion information candidate added to the temporary motion information table may not be added to the motion information table. Therefore, the motion information table may not include a motion information candidate derived based on the motion information of the block included in the coding tree unit or the merge processing area including the current block.
[0301] Optionally, only motion information of some blocks included in the merge processing area may be added to the temporary motion information table. As an example, only blocks at predefined positions within the merge processing area may be used to update the motion information table. The predefined position may include at least one of the following items: a block located at the upper left of the merge processing area, a block located at the upper right of the merge processing area, a block located at the lower left of the merge processing area, a block located at the lower right of the merge processing area, a block located at the center of the merge processing area, a block adjacent to the right boundary of the merge processing area, and a block adjacent to the lower boundary of the merge processing area. As an example, only the motion information of the block adjacent to the lower right corner of the merge processing area may be added to the temporary motion information table, and the motion information of other blocks may not be added to the temporary motion information table.
[0302] The maximum number of temporary motion information candidates that the temporary motion information table can include may be set to be equal to the maximum number of motion information candidates that the motion information table can include. Alternatively, the maximum number of temporary motion information candidates that the temporary motion information table can include may be determined according to the size of the coding tree unit or the merge processing region. Alternatively, the maximum number of temporary motion information candidates that the temporary motion information table can include may be set to be smaller than the maximum number of motion information candidates that the motion information table can include.
[0303] The current block included in the coding tree unit or the merge processing area may be set not to use the temporary motion information table for the corresponding coding tree unit or the merge processing area. In other words, when the number of merge candidates included in the merge candidate list of the current block is less than a threshold value, the motion information candidates included in the motion information table may be added to the merge candidate list, and the temporary motion information candidates included in the temporary motion information table may not be added to the merge candidate list. Therefore, the motion information of other blocks included in the same coding tree unit or the same merge processing area as the current block may not be used for motion compensation prediction of the current block.
[0304] If encoding / decoding of all blocks included in the coding tree unit or the merge processing area is completed, the motion information table and the temporary motion information table may be unified.
[0305] Fig.26 is a diagram illustrating an example of a unified motion information table and a temporary motion information table.
[0306] If encoding / decoding of all blocks included in the coding tree unit or the merge processing area is completed, as in Fig.26 In the example shown in , the temporary motion information candidates included in the temporary motion information table may be updated in the motion information table.
[0307] In this regard, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table in the order of being inserted into the temporary motion information table (in other words, in ascending or descending order of index values).
[0308] In another example, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table in a predefined order. In this regard, the predefined order may be determined according to a scanning order of coding blocks in a merge processing area or a coding tree unit. The scanning order may be at least one of a raster scan, a horizontal scan, a vertical scan, or a zigzag scan. Alternatively, the predefined order may be determined based on the motion information of each block or the number of blocks having the same motion information.
[0309] Alternatively, a temporary motion information candidate including unidirectional motion information may be added to the motion information table before a temporary motion information candidate including bidirectional motion information. Conversely, a temporary motion information candidate including bidirectional motion information may be added to the motion information table before a temporary motion information candidate including unidirectional motion information.
[0310] Alternatively, the temporary motion information candidates may be added to the motion information table in order of high usage frequency or low usage frequency in the merge processing region or the coding tree unit.
[0311] In the case where a temporary motion information candidate included in the temporary motion information table is added to the motion information table, a redundancy check on the temporary motion information candidate may be performed. In an example, when a motion information candidate identical to the temporary motion information candidate included in the temporary motion information table is pre-stored in the motion information table, the temporary motion information candidate may not be added to the motion information table. In this regard, a redundancy check may be performed on a portion of the motion information candidates included in the motion information table. In an example, a redundancy check may be performed on a motion information candidate having an index exceeding a threshold value or below a threshold value. In an example, when the temporary motion information candidate is equal to a motion information candidate having an index exceeding a predefined value, the temporary motion information candidate may not be added to the motion information table.
[0312] It may limit the use of motion information candidates derived from blocks included in the same coding tree unit or the same merge processing area as the current block as merge candidates for the current block. To this end, address information of the block may be additionally stored for the motion information candidate. The address information of the block may include at least one of the following items: the position of the block, the address of the block, the index of the block, the position of the merge processing area including the block, the address of the merge processing area including the block, the index of the merge processing area including the block, the position of the coding tree area including the block, the address of the coding tree area including the block, or the index of the coding tree area including the block.
[0313] When a merge candidate of the current block is selected, the motion vector of the selected merge candidate is set as the initial motion vector. Using the motion vector derived by adding an offset vector or subtracting an offset vector from the initial motion vector, motion compensation prediction of the current block may be performed. Derivation of a new motion vector by adding an offset vector or subtracting an offset vector from the motion vector of the merge candidate may be defined as a merge offset vector encoding method.
[0314] Information indicating whether the merge offset coding method is used may be signaled via a bitstream. The information may be a 1-bit flag merge_offset_vector_flag. As an example, a flag merge_offset_vector_flag having a value of 1 indicates that the merge offset vector coding method is applied to the current block. When the merge offset vector coding method is applied to the current block, the motion vector of the current block is derived by adding an offset vector or subtracting an offset vector from the motion vector of the merge candidate. A flag merge_offset_vector_flag having a value of 0 indicates that the merge offset vector coding method is not applied to the current block. When the merge offset coding method is not applied, the motion vector of the merge candidate is set to the motion vector of the current block.
[0315] The flag may be signaled only when a skip flag indicating whether the skip mode is applied has a true value, or when a merge flag indicating whether the merge mode is applied has a true value. As an example, when a flag skip_flag indicating that the skip mode is applied to the current block has a value of 1, or when a flag merge_flag indicating that the merge mode is applied to the current block has a value of 1, the flag merge_offset_vector_flag is encoded and signaled.
[0316] When it is determined that the merge offset encoding method is applied to the current block, at least one of information specifying any one of the merge candidates included in the merge candidate list, information indicating the size of the offset vector, or information indicating the direction of the offset vector is additionally sent by a signal.
[0317] Information for determining the maximum number of merge candidates that the merge candidate list can include may be signaled through a bitstream. As an example, the maximum number of merge candidates that the merge candidate list can include may be set to a natural number of 6 or less.
[0318] When it is determined that the merge offset coding method is applied to the current block, a preset maximum number of merge candidates is set only for the initial motion vector of the current block. That is, depending on whether the merge offset coding method is applied, the number of merge candidates available for the current block can be adaptively determined. As an example, when the value of the flag merge_offset_vector_flag is set to 0, the maximum number of merge candidates available for the current block is set to M. Conversely, when the value of the flag merge_offset_vector_flag is set to 1, the maximum number of merge candidates available for the current block is set to N. Here, the letter M represents the maximum number of merge candidates that the merge candidate list can include, and the letter N represents a natural number equal to or less than M.
[0319] As an example, when M is 6 and N is 2, two merge candidates having the smallest index among the merge candidates included in the merge candidate list are set as available for the current block. Therefore, the motion vector of the merge candidate having an index value of 0 or the motion vector of the merge candidate having an index value of 1 may be set as the initial motion vector of the current block. When M and N are the same (for example, M and N are 2), all merge candidates included in the merge candidate list are set as available for the current block.
[0320] Optionally, it is possible to determine when a neighboring block is available as a merge candidate based on whether the merge offset vector encoding method is applied to the current block. As an example, when the flag merge_offset_vector_flag has a value of 1, at least one of the neighboring blocks adjacent to the upper right corner of the current block and the neighboring blocks adjacent to the lower left corner is set to be unavailable as a merge candidate. Therefore, when the merge offset vector encoding method is applied to the current block, the motion vector of at least one of the neighboring blocks adjacent to the upper right corner of the current block and the neighboring blocks adjacent to the lower left corner is not set as an initial motion vector. Optionally, when the flag merge_offset_vector_flag has a value of 1, the temporal neighboring blocks of the current block are set to be unavailable as merge candidates.
[0321] When the merge offset vector encoding method is applied to the current block, it is set not to use at least one of the paired merge candidate and the zero merge candidate. Therefore, when the flag merge_offset_vector_flag has a value of 1, even if the number of merge candidates included in the merge candidate list is less than the maximum number, at least one of the paired merge candidate and the zero merge candidate may not be added to the merge candidate list.
[0322] The motion vector of the merge candidate may be set to the initial motion vector of the current block. Here, when there are multiple merge candidates available for the current block, information specifying any one of the multiple merge candidates is sent by a bitstream signal. As an example, when the maximum number of merge candidates that the merge candidate list can include is greater than 1, information merge_idx indicating any one of the multiple merge candidates is sent by a bitstream signal. That is, under the merge offset coding method, the merge candidate may be specified by information merge_idx used to specify any one of the multiple merge candidates. The initial motion vector of the current block may be set using the motion vector of the merge candidate indicated by the information merge_idx.
[0323] On the contrary, when there is only one merge candidate available for the current block, the signaling of the information for specifying the merge candidate is omitted. As an example, when the maximum number of merge candidates that the merge candidate list can include is not greater than 1, the signaling of the information merge_idx for specifying the merge candidate is omitted. That is, under the merge offset encoding method, when only one merge candidate is included in the merge candidate list, the encoding of the information merge_idx for specifying the merge candidate is omitted, and the initial motion vector is determined based on the merge candidate included in the merge candidate list. The motion vector of the merge candidate may be set to the initial motion vector of the current block.
[0324] As another example, after determining the merge candidate of the current block, it may be determined whether the merge offset vector encoding method is applied to the current block. As an example, when the maximum number of merge candidates that the merge candidate list can include is greater than 1, information merge_idx for specifying any one of the merge candidates is signaled. After selecting the merge candidate based on the information merge_idx, a flag merge_offset_vector_flag indicating whether the merge offset vector encoding method is applied to the current block may be decoded. Table 3 shows a syntax table according to the above-described embodiment.
[0325] [Table 3]
[0326]
[0327]
[0328] As another example, after determining the merge candidate of the current block, it is determined whether to apply the merge offset vector encoding method to the current block only when the index of the determined merge candidate is less than the maximum number of merge candidates available when the merge offset vector encoding method is applied. As an example, only when the value of the index information merge_idx is less than N, the flag merge_offset_vector_flag indicating whether the merge offset vector encoding method is applied to the current block is encoded and signaled. When the value of the index information merge_idx is equal to or greater than N, the encoding of the flag merge_offset_vector_flag is omitted. When the encoding of the flag merge_offset_vector_flag is omitted, it is determined that the merge offset vector encoding method is not applied to the current block. Optionally, after determining the merge candidate of the current block, it is determined whether to apply the merge offset vector encoding method to the current block, considering whether the determined merge candidate has bidirectional motion information or unidirectional motion information. As an example, only when the value merge_idx of the index information is less than N and the merge candidate selected by the index information has bidirectional motion information, the flag merge_offset_vector_flag indicating whether the merge offset vector encoding method is applied to the current block is encoded and signaled. Alternatively, only when the value merge_idx of the index information is less than N and the merge candidate selected by the index information has unidirectional motion information, the flag merge_offset_vector_flag indicating whether the merge offset vector encoding method is applied to the current block is encoded and signaled.
[0329] Optionally, whether to apply the merge offset vector encoding method may be determined based on at least one of the size, shape, or whether the current block contacts the boundary of the coding tree unit of the current block. When at least one of the size, shape, or whether the current block contacts the boundary of the coding tree unit of the current block does not meet a preset condition, encoding of a flag merge_offset_vector_flag indicating whether the merge offset vector encoding method is applied to the current block is omitted.
[0330] When a merge candidate is selected, the motion vector of the merge candidate is set as the initial motion vector of the current block. Then, the offset vector can be determined by decoding information indicating the size of the offset vector and information indicating the direction of the offset vector. The offset vector may have a horizontal direction component or a vertical direction component.
[0331] The information indicating the size of the offset vector may be index information indicating any one of the vector size candidates. As an example, the index information distance_idx indicating any one of the vector size candidates may be signaled through a bitstream. Table 4 shows the binarization of the index information distance_idx and the value of the variable DistFromMergeMV used to determine the size of the offset vector according to distance_idx.
[0332] [Table 4]
[0333] distance_idx[x][y] Binarization DistFromMergeMV[x0][y0] 0 0 1 1 10 2 2 110 4 3 1110 8 4 11110 16 5 111110 32 6 1111110 64 7 1111111 128
[0334] The size of the offset vector may be derived by dividing the variable DistFromMergeMV by a preset value. Equation 2 shows an example of determining the size of the offset vector.
[0335] [Equation 2]
[0336] abs(offsetMV)=DistFromMergeMV<<2
[0337] According to Equation 2, a value obtained by dividing the variable DistFromMegeMV by 4 or a value obtained by shifting the variable DistFromMegeMV left by 2 can be set as the size of the offset vector.
[0338] A larger number of vector size candidates or a smaller number of vector size candidates than those in the example shown in Table 4 may be used, or the range of motion vector offset size candidates may be set to be different from the example shown in Table 4. As an example, the size of the horizontal direction component or the vertical direction component of the offset vector may be set so as not to be greater than the 2-sample distance. Table 5 shows binarization of index information distance_idx and a value of a variable DistFromMergeMV for determining the size of the offset vector according to distance_idx.
[0339] [Table 5]
[0340] distance_idx[x][y] Binarization DistFromMergeMV[x0][y0] 0 0 1 1 10 2 2 110 4 3 111 8
[0341] Optionally, based on the motion vector accuracy, the range of the motion vector offset size candidate may be set differently. As an example, when the motion vector accuracy of the current block is fractional pel, the value of the variable DistFromMergeMV corresponding to the value of the index information distance_idx is set to 1, 2, 4, 8, 16, etc. Here, the fractional pel may include at least one of 1 / 16pel, 1 / 8pel, 1 / 4pel, or 1 / 2pel. However, when the motion vector accuracy of the current block is integer pel, the value of the variable DistFromMergeMV corresponding to the value of the index information distance_idx is set to 4, 8, 16, 32, 64, etc. That is, depending on the motion vector accuracy of the current block, the table referenced to determine the variable DistFromMergeMV may be set differently. For example, when the motion vector accuracy of the current block or the merge candidate is 1 / 4pel, the variable DistFromMergeMV indicated by distance_idx is derived using Table 4. However, when the motion vector precision of the current block or the merge candidate is an integer pel, a value N times (eg, 4 times) the value of the variable DistFromMergeMV indicated by distance_idx in Table 4 is derived as the value of the variable DistFromMergeMV.
[0342] Information for determining the motion vector precision may be signaled via the bitstream. As an example, the information may be signaled at a sequence level, a picture level, a slice level, or a block level. Thus, the range of vector size candidates may be set to be different by information related to the motion vector precision signaled via the bitstream. Optionally, the motion vector precision may be determined based on a merge candidate of the current block. As an example, the motion vector precision of the current block may be set equal to the motion vector precision of the merge candidate.
[0343] Optionally, information for determining a search range for an offset vector may be signaled through a bitstream. The number of vector size candidates and at least one of a minimum value and a maximum value of the vector size candidates may be determined based on the search range. As an example, a flag merge_offset_vector_flag for determining a search range for an offset vector may be signaled through a bitstream. This information may be signaled through a sequence header, a picture header, or a slice header.
[0344] As an example, when the flag merge_offset_extend_range_flag has a value of 0, the size of the offset vector is set not to exceed a value of 2. Therefore, the maximum value of DiffFrommergeMV may be set to 8. On the contrary, when the flag merge_offset_extend_range_flag has a value of 1, the size of the offset vector is set not to exceed a distance of 32 samples. Therefore, the maximum value of DiffFrommergeMV may be set to 128.
[0345] The size of the offset vector may be determined using a flag indicating whether the size of the offset vector is greater than a threshold. As an example, a flag distance_flag indicating whether the size of the offset vector is greater than a threshold may be signaled by the bitstream. The threshold may be 1, 2, 4, 8, or 16. As an example, a flag distance_flag having a value of 1 indicates that the size of the offset vector is greater than 4. Conversely, a flag distance_flag having a value of 0 indicates that the size of the offset vector is equal to or less than 4.
[0346] When the size of the offset vector is greater than the threshold, the difference between the size of the offset vector and the threshold is derived using the index information distance_idx. Alternatively, when the size of the offset vector is equal to or less than the threshold, the size of the offset vector is determined using the index information distance_idx. Table 6 is a syntax table showing encoding aspects of distance_flag and distance_idx.
[0347] [Table 6]
[0348]
[0349]
[0350] Equation 3 shows an example of deriving a variable DistFromMergeMV for determining the size of an offset vector by using distance_flag and distance_idx.
[0351] [Equation 3]
[0352] DistFromMergeMV=N*distance_flag+(1<<distance_idx)
[0353] In Equation 3, the value of distance_flag may be set to 1 or 0. The value of distance_idx may be set to 1, 2, 4, 8, 16, 32, 64, 128, etc. The letter N represents a coefficient determined by a threshold value. As an example, when the threshold value is 4, N is set to 16.
[0354] The information indicating the direction of the offset vector may be index information indicating any one of the vector direction candidates. As an example, index information direction_idx indicating any one of the vector direction candidates may be signaled through a bitstream. Table 7 shows binarization of index information direction_idx and the direction of the offset vector according to direction_idx.
[0355] [Table 7]
[0356] direction_idx[x][y] Binarization sign[x][y][0] sign[x][y][1] 0 00 +1 0 1 01 -1 0 2 10 0 +1 3 11 0 -1
[0357] In Table 7, expression sign[0] represents the horizontal direction, and expression sign[1] represents the vertical direction. Expression +1 represents that the value of the x component or y component of the offset vector is + (positive). Expression -1 represents that the value of the x component or y component of the offset vector is - (negative). Equation 4 shows an example of determining an offset vector based on the size and direction of the offset vector.
[0358] [Equation 4]
[0359] offsetMV[0]=abs(offsctMV)*sign[0]
[0360] offsetMV[1]=abs(offsctMV)*sign[1]
[0361] In Equation 4, the expression offsetMV[0] represents the vertical direction component of the offset vector, and the expression offsetMV[1] represents the horizontal direction component of the offset vector.
[0362] Fig. 27 is a diagram illustrating an offset vector according to a value of distance_idx indicating a size of the offset vector and a value of direction_idx indicating a direction of the offset vector.
[0363] As in Fig. 27 In the example shown, the size and direction of the offset vector can be determined based on the value of distance_idx and the value of direction_idx. The maximum size of the offset vector can be set so as not to exceed the threshold. Here, the threshold can be a value predefined in the encoder and the decoder. As an example, the threshold can be a 32-sample distance. Optionally, the threshold can be determined based on the size of the initial motion vector. As an example, the threshold in the horizontal direction can be set based on the size of the horizontal component of the initial motion vector, and the threshold in the vertical direction can be set based on the size of the vertical component of the initial motion vector.
[0364] When the merge candidate has bidirectional motion information, the L0 motion vector of the merge candidate is set to the L0 initial motion vector of the current block, and the L1 motion vector of the merge candidate is set to the L1 initial motion vector of the current block. Here, the L0 offset vector and the L1 offset vector may be determined considering the difference in output order between the L0 reference picture of the merge candidate and the current picture (hereinafter, referred to as the L0 difference) and the difference in output order between the L1 reference picture of the merge candidate and the current picture (hereinafter, referred to as the L1 difference).
[0365] First, when the sign of the L0 difference value is the same as the sign of the L1 difference value, the L0 offset vector and the L1 offset vector are set to be the same. Conversely, when the sign of the L0 difference value and the sign of the L1 difference value are different, the L1 offset vector is set in the opposite direction to the L0 offset vector.
[0366] The size of the L0 offset vector and the size of the L1 offset vector may be set to be the same. Optionally, the L0 offset vector is scaled based on the L0 difference value and the L1 difference value, thereby determining the size of the L1 offset vector.
[0367] As an example, Equation 5 shows an L0 offset vector and an L1 offset vector when the sign of the L0 difference value and the sign of the L1 difference value are the same.
[0368] [Equation 5]
[0369] offsetMVL0[0]=abs(offsetMV)*sign[0]
[0370] offsetMVL0[1]=abs(offsetMV)*sign[1]
[0371] offsetMVL1[0]=abs(offsetMV)*sign[1]
[0372] offsetMVL1[1]=abs(offsetMV)*sign[0]
[0373] In Equation 5, the expression offsetMVL0[0] represents the horizontal component of the L0 offset vector, and the expression offsetMVL0[1] represents the vertical component of the L0 offset vector. The expression offsetMVL1[0] represents the horizontal component of the L1 offset vector, and the expression olfsetMVL1[1] represents the vertical component of the L1 offset vector.
[0374] Equation 6 shows the L0 offset vector and the L1 offset vector when the sign of the L0 difference value and the sign of the L1 difference value are the same.
[0375] [Equation 6]
[0376] offsetMVL0[0]=abs(offsetMV)*sign[0]
[0377] offsetMVL0[1]=abs(offsetMV)*sign[1]
[0378] offsetMVL1[0]=-1*abs(offsetMV)*sign[0]
[0379] offsetMVL1[1]=-1*abs(offsetMV)*sign[1]
[0380] More than four vector direction candidates may be defined. Tables 8 and 9 show examples of defining eight vector direction candidates.
[0381] [Table 8]
[0382]
[0383]
[0384] [Table 9]
[0385] direction_idx[x][y] Binarization sign[x][y][0] sign[x][y][1] 0 000 +1 0 1 001 -1 0 2 010 0 +1 3 011 0 -1 4 100 +1 / 2 +1 / 2 5 101 +1 / 2 -1 / 2 6 110 -1 / 2 +1 / 2 7 111 -1 / 2 -1 / 2
[0386] In Tables 8 and 9, when the absolute values of sign[0] and sign[1] are greater than 0, it indicates that the offset vector is in the diagonal direction. When Table 7 is used, abs(offsetMV) is used to set the size of the x-axis component and the y-axis component of the offset vector in the diagonal direction. However, when Table 8 is used, abs(offsetMV / 2) is used to set the size of the x-axis component and the y-axis component of the offset vector in the diagonal direction. Fig.28 is a diagram illustrating an offset vector according to a value of distance_idx indicating a size of the offset vector and a value of direction_idx indicating a direction of the offset vector.
[0387] Fig.28 (a) is an example of applying Table 7, Fig.28 (b) is an example of applying Table 8.
[0388] Information for determining at least one of the number or size of the vector direction candidates may be signaled through a bitstream. As an example, a flag merge_offset_direction_range_flag for determining the vector direction candidates may be signaled through a bitstream. The flag may be signaled at a sequence level, a picture level, or a slice level. As an example, when the flag has a value of 0, four vector direction candidates shown in Table 7 are used. Conversely, when the flag has a value of 1, eight vector direction candidates shown in Table 8 or Table 9 are used.
[0389] Optionally, based on the size of the offset vector, at least one of the number and size of the vector direction candidates may be determined. As an example, when the value of the variable DistFromMergeMV used to determine the size of the offset vector is equal to or less than a threshold, eight vector direction candidates shown in Table 8 or Table 9 are used. However, when the value of the variable DistFromMergeMV is greater than the threshold, four vector direction candidates shown in Table 7 are used.
[0390] Optionally, based on the value MVx of the x component and the value MVy of the y component of the initial motion vector, at least one of the number and size of the vector direction candidates may be determined. As an example, when the difference between MVx and MVy or the absolute value of the difference is equal to or less than a threshold, eight vector direction candidates shown in Table 8 or Table 9 are used. On the contrary, when the difference between MVx and MVy or the absolute value of the difference is greater than a threshold, four vector direction candidates shown in Table 7 are used.
[0391] The motion vector of the current block may be derived by adding the offset vector to the initial motion vector. Equation 7 shows an example of determining the motion vector of the current block.
[0392] [Equation 7]
[0393] mvL0[0]=mergeMVL0[0]+offsetMVL0[0]
[0394] mvL0[1]=mergeMVL0[1]+offsetMVL0[1]
[0395] mvL1[0]=mergeMVL0[0]+offsetMVL1[0]
[0396] mvL1[1]=mergeMVL0[0]+offsetMVL1[1]
[0397] In Equation 7, expression mvL0 represents the L0 motion vector of the current block, and expression mvL1 represents the L1 motion vector of the current block. Expression mergeMVL0 represents the L0 initial motion vector of the current block (i.e., the L0 motion vector of the merge candidate), and expression mergeMVL1 represents the L1 initial motion vector of the current block. Expression [0] represents the horizontal direction component of the motion vector, and expression [1] represents the vertical direction component of the motion vector.
[0398] The affine seed vector or motion vector (sub-block motion vector or affine sub-block vector) of the sub-block derived based on the affine merge mode or the affine motion vector prediction mode may be updated based on the offset vector. Specifically, by adding an offset or subtracting an offset from the affine seed vector or motion vector of the sub-block, an updated affine seed vector or an updated sub-block motion vector may be derived. Under the affine motion model, refining the affine seed vector or motion vector of the sub-block is referred to as an affine merge offset encoding method.
[0399] When the affine motion model is applied to the coding block and the flag merge_olfset_vector_flag indicating whether the merge offset coding method is used has a value of 1, the affine merge offset coding method is applied to the coding block.
[0400] When it is determined to apply the affine merge offset coding method, a merge index (merge_idx) for determining the initial motion vector of the current block, index information distance_idx for determining the size of the offset vector, and index information direction_idx for determining the direction of the offset vector are sent by signal. The index information distance_idx for determining the size indicates any one of multiple size candidates, and the index information direction_idx for determining the direction indicates any one of multiple direction candidates. Based on the index information distance_idx for determining the size and the index information direction_idx for determining the direction, the offset vector (offsetAffine[0] and offsetAffine[1]) can be determined.
[0401] An updated affine seed vector may be derived by adding or subtracting an offset vector from the affine seed vector. Here, the sign of the offset vector applied to each affine seed vector may be determined according to the direction of the reference picture. As an example, when bidirectional prediction is applied to a coding block and the temporal direction of the L0 reference picture is the same as the temporal direction of the L1 reference picture, the offset vector is added to each affine seed vector as shown in Equation 8 below. Here, the temporal direction may be determined based on the difference in output order (POC) between the current picture and the reference picture. As an example, when the difference in output order between the current picture and the L0 reference picture and the difference in output order between the current picture and the L1 reference picture are both negative numbers, or when the difference in output order between the current picture and the L0 reference picture and the difference in output order between the current picture and the L1 reference picture are both positive numbers, it is determined that the temporal direction of the L0 reference picture is the same as the temporal direction of the L1 reference picture.
[0402] [Equation 8]
[0403] CpMV[0].mvL0[0]=CpMV[0].mvL0[0]+offsetAffine[0]
[0404] CpMV[0].mvL0[1]=CpMV[0].mvL0[1]+offsetAffine[1]
[0405] CpMV[1].mvL0[0]=CpMV[1].mvL0[0]+offsetAffine[0]
[0406] CpMV[1].mvL0[1]=CpMV[01.mvL0[1]+offsetAffine[1]
[0407] CpMV[2].mvL0[0]=CpMV[2].mvL0[0]+offsetAffine[0]
[0408] CpMV[2].mvL0[0]=CpMV[2].mvL0[1]+offsetAffine[1]
[0409] In contrast, when the temporal direction of the L0 reference picture is different from the temporal direction of the L1 reference picture, an offset vector is added to or subtracted from each affine seed vector as shown in the following Equation 9, thereby deriving an updated affine seed vector. As an example, when the difference in output order between the current picture and the L0 reference picture is negative but the difference in output order between the current picture and the L1 reference picture is positive, or when the difference in output order between the current picture and the L0 reference picture is positive but the difference in output order between the current picture and the L1 reference picture is negative, it is determined that the temporal direction of the L0 reference picture is different from the temporal direction of the L1 reference picture.
[0410] [Equation 9]
[0411] CpMV[0].mvL0[0]=CpMV[0].mvL0[0]+offsetAffine[0]
[0412] CpMV[0].mvL0[1]=CpMV[0].mvL0[1]+offsetAffine[1]
[0413] CpMV[1].mvL0[0]=CpMV[1].mvL0[0]+offsetAffine[0]
[0414] CpMV[1].mvL0[1]=CpMV[1].mvL0[1]-offsetAffine[1]
[0415] CpMV[2].mvL0[0]=CpMV[2].mvL0[0]+offsetAffine[0]
[0416] CpMV[2].mvL0[1]=CpMV[2].mvL0[1]-offsetAffine[1]
[0417] In Equation 8 and Equation 9, it is shown that the same offset vector is applied to all affine seed vectors, but the present invention is not limited thereto. It is also possible to individually determine the offset vectors of the corresponding affine seed vectors.
[0418] Optionally, an offset vector may be set for each sub-block. The motion vector of the sub-block may be updated using the offset vector of the sub-block.
[0419] Depending on the motion vector accuracy of the current block or the neighboring block, the range of the offset vector size candidates may be determined differently. That is, depending on the motion vector accuracy of the current block or the neighboring block, there may be a difference in at least one of the following items: the number of offset vector size candidates or the minimum or maximum value of the offset vector size candidates. As an example, when the affine motion model is applied to the current block and the motion vector accuracy of the current block is 1 / 4pel, the value of the variable DistFromMergeMV is determined to be any one of 1, 2, 4, 8, 16, 32, 64 and 128 through distance_idx. However, when the motion vector accuracy of the current block is an integer pel, the value of the variable DistFromMergeMV is determined to be any one of 4, 8, 16, 32, 64, 128, 256 and 512 through distance_idx.
[0420] As another example, information for specifying any one of a plurality of offset vector size candidate sets may be signaled via a bitstream. At least one of the number and type of offset vector size candidates included in each of the offset vector size candidate sets may differ. As an example, when a first offset vector size candidate set is selected, the variable DistFromMergeMV is determined to be one of {1, 2, 4, 8, 16, 32, 64, 128}. When a second offset vector size candidate set is selected, the variable DistFromMergeMV is determined to be one of {4, 8, 16, 32, 64, 128, 256, 512}.
[0421] Index information DistMV_idx specifying any one of a plurality of offset vector size candidate sets may be signaled through a bitstream. As an example, index information DistMV_idx having a value of 0 indicates that the first offset vector size candidate set is selected, and index information DistMV_idx having a value of 1 indicates that the second offset vector size candidate set is selected.
[0422] The offset vector may be set for each sub-block or each sample point. That is, an offset vector (or deviation vector) or an offset vector array (or deviation vector array) of a sub-block or sample point may be defined as offset data.
[0423] For example, when a sub-block motion vector is derived based on an affine seed vector, the derived sub-block motion vector is used to perform motion compensation on the sub-block. Here, when performing motion compensation, an offset vector for each sub-block or sample may be additionally used.
[0424] The offset vector candidate may be used to derive an offset vector of the sub-block, the sub-block motion vector may be updated based on the offset vector, and motion compensation of the sub-block may be performed based on the updated sub-block motion vector.
[0425] The offset vector may be derived for each prediction sample in the sub-block. Specifically, the offset vector of each prediction sample may be derived based on the position of each prediction sample in the sub-block. Here, the position of the prediction sample may be determined based on the upper left sample of the sub-block.
[0426] The x-component of the offset vector of the prediction sample may be derived based on a value obtained by multiplying the x-axis coordinate of the prediction sample by the difference between the x-component of the second affine seed vector and the x-component of the first affine seed vector, and based on a value obtained by multiplying the y-axis coordinate of the prediction sample by the difference between the y-component of the second affine seed vector and the y-component of the first affine seed vector. In addition, the y-component of the offset vector of the prediction sample may be derived based on a value obtained by multiplying the x-axis coordinate of the prediction sample by the difference between the x-component of the third affine seed vector and the x-component of the first affine seed vector, and based on a value obtained by multiplying the y-axis coordinate of the prediction sample by the difference between the y-component of the third affine seed vector and the y-component of the second affine seed vector.
[0427] When the 4-parameter motion model is applied to the current block, the y-component and x-component of the offset vector are derived based on a value obtained by multiplying the x-axis coordinate of the prediction sample point by the difference between the x-component of the first affine seed vector and the x-component of the second affine seed vector, and based on a value obtained by multiplying the y-axis coordinate of the prediction sample point by the difference between the y-component of the second affine seed vector and the y-component of the first affine seed vector.
[0428] As described above, the offset vectors of the prediction samples within a sub-block may have different values. However, the offset vector array for the prediction samples may be commonly applied to all sub-blocks. That is, the offset vector array applied to the first sub-block may be the same as the offset vector array applied to the second sub-block.
[0429] Optionally, further considering the position of the sub-block, an offset vector array for each sample point may be derived. In this case, different offset vector arrays may be applied to the sub-block.
[0430] After performing motion compensation of the sub-block based on the sub-block motion vector, each prediction sample may be updated based on the offset vector. The updating of the prediction sample may be performed based on the offset vector of the prediction sample and the gradient of the prediction sample.
[0431] The gradient of the prediction sample point may be derived based on the difference between the prediction sample points. The gradient of the first prediction sample point may be derived based on the difference between the prediction sample points belonging to the same row as the first prediction sample point or based on the difference between the prediction sample points belonging to the row adjacent to the first prediction sample point.
[0432] As an example, the gradient of the first prediction sample point may be derived using the difference between the first prediction sample point and another prediction sample point belonging to the same row as the first prediction sample point. Specifically, the horizontal gradient of the first prediction sample point may be derived using the difference between the first prediction sample point and the second prediction sample point belonging to the same row as the first prediction sample point. The vertical gradient of the first prediction sample point may be derived using the difference between the first prediction sample point and the third prediction sample point belonging to the same column as the first prediction sample point. Here, the second prediction sample point and the third prediction sample point may be adjacent to the first prediction sample point. As an example, the second prediction sample point may be located on the left or right side of the first prediction sample point, and the third prediction sample point may be located above or below the first prediction sample point. Optionally, the second prediction sample point and the third prediction sample point may be spaced apart from the first prediction sample point by a predetermined distance in the x-axis and / or y-axis direction. Here, the predetermined distance may be a natural number (such as 1, 2, or 3).
[0433] Optionally, the difference between the predicted samples belonging to the row adjacent to the first predicted sample point may be set as the gradient of the first predicted sample point. As an example, the horizontal direction gradient of the first predicted sample point may be derived using the difference between the predicted samples belonging to the row adjacent to the first predicted sample point. In this article, the row adjacent to the first predicted sample point may refer to a row above or below the first predicted sample point. At least one of the predicted samples used to derive the horizontal direction gradient of the first predicted sample point may be adjacent to the first predicted sample point, and the other may not be adjacent to the first predicted sample point. As an example, the horizontal direction gradient of the first predicted sample point may be derived based on the difference between the second predicted sample point located above or below the first predicted sample point and the third predicted sample point spaced a predetermined distance from the second predicted sample point in the x-axis direction. The vertical direction gradient of the first predicted sample point may be derived using the difference between the predicted samples belonging to the column adjacent to the first predicted sample point. Here, the column adjacent to the first predicted sample point may refer to the column on the left or right side of the first predicted sample point. At least one of the prediction samples used to derive the vertical gradient of the first prediction sample may be adjacent to the first prediction sample, and the other may not be adjacent to the first prediction sample. As an example, the vertical gradient of the first prediction sample may be derived based on a difference between a fourth prediction sample located on the left or right side of the first prediction sample and a fifth prediction sample spaced a predetermined distance from the fourth prediction sample in the y-axis direction. Here, the predetermined distance may be a natural number (such as 1, 2, or 3).
[0434] Equation 10 shows an example of deriving the horizontal direction gradient gradientH and the vertical direction gradient gradientV of the first prediction sample.
[0435] [Equation 10]
[0436] gradientH[x][y]=(predSample[x+2][y+1]-predSample[x][y+1])>>shift1
[0437] gradientV[x][y]=(predSample[x+1][y+2]-predSample[x+1][y])>>shift1
[0438] In Equation 10, the expression predSample represents a predicted sample, and the expression [x][y] represents x-axis and y-axis coordinates. The expression shift1 represents a shift parameter. The shift parameter may have a value predefined in the encoder and the decoder. Optionally, the shift parameter may be adaptively determined based on at least one of a size, a shape, an aspect ratio, or an affine motion model of the current block.
[0439] When deriving the gradient of the prediction sample, the offset prediction value of the prediction sample is derived using the gradient and the offset vector. The offset prediction value may be derived based on a multiplication operation of the gradient and the offset vector. As an example, Equation 11 shows an example of deriving the offset prediction value OffsetPred.
[0440] [Equation 11]
[0441] OffsetPred[x][y]=gradientH[x][y]*offsetMV[x][y][0]+gradientT*offsetMV[x][y][1]
[0442] When the offset prediction value is derived, the offset prediction value is added to the prediction sample, thereby updating the prediction sample. Equation 12 shows an example of updating the prediction sample.
[0443] [Equation 12]
[0444] predSample[x][y]=predSample[x][y]+OffsetPred[x][y]
[0445] As another example, the prediction sample may be updated by adding the offset vector to the neighboring prediction sample. Here, the neighboring prediction sample may include at least one of a sample located to the right of the prediction sample, a sample located below the prediction sample, or a sample located to the right below the prediction sample. As an example, Equation 13 shows an example of updating the prediction sample by using the neighboring prediction sample.
[0446] [Equation 13]
[0447] predSample[x][y]=predSample[x+1][y+1]+OffsetPred[x][y]
[0448] Information indicating whether to use an offset vector when performing motion compensation for a current block may be signaled through a bitstream. The information may be a 1-bit flag.
[0449] Alternatively, whether to use the offset vector may be determined based on the size of the current block, the shape of the current block, or whether the affine seed vectors are the same. As an example, in the case where a 4-parameter affine motion model is applied to the current block, when the first affine seed vector and the second affine seed vector are the same, motion compensation is performed using the offset vector. Alternatively, in the case where a 6-parameter affine motion model is applied to the current block, when the first affine seed vector, the second affine seed vector, and the third affine seed vector are the same, or when two of the first affine seed vector, the second affine seed vector, and the third affine seed vector are the same, motion compensation is performed using the offset vector.
[0450] Intra prediction is a method for performing prediction on a current block by using reconstructed samples that have been encoded / decoded and are around the current block. In this regard, the reconstructed samples before applying the in-loop filter can be used for intra prediction of the current block.
[0451] Intra-frame prediction methods include matrix-based intra-frame prediction and intra-frame prediction according to directions with adjacent reconstruction samples. Information indicating the intra-frame prediction method of the current block can be sent by signal in the bitstream. The information can be a 1-bit flag. Optionally, the intra-frame prediction of the current block can be determined based on at least one of the position of the current block, the size of the current block, the shape of the current block, or the intra-frame prediction method of the neighboring block. In one example, when there is a current block across a picture boundary, it can be set so that the matrix-based intra-frame prediction method is not applied to the current block.
[0452] The matrix-based intra prediction method is a method for obtaining a prediction block of the current block based on the matrix stored in the encoder and decoder and the matrix product of the reconstructed samples around the current block. Information for specifying any one of a plurality of pre-stored matrices can be signaled in the bitstream. The decoder can determine the matrix for performing intra prediction on the current block based on the above information and the size of the current block.
[0453] Generally, intra prediction is a method for obtaining a prediction block of a current block based on a non-directional intra prediction mode or a directional intra prediction mode.
[0454] The residual image can be derived by subtracting the predicted image from the original image. In this regard, when the residual image is converted to the frequency domain, the subjective image quality of the image will not be significantly reduced even if the high-frequency components are removed from the frequency components. Therefore, when the value of the high-frequency component is transformed to a small value, or when the value of the high-frequency component is set to 0, the compression efficiency can be improved without causing large visual distortion. Reflecting the above characteristics, a transformation can be performed on the current block so as to decompose the residual image into two-dimensional frequency components. The transformation can be performed by using a transformation method such as DCT (discrete cosine transform), DST (discrete sine transform), etc.
[0455] The transformation method may be determined based on the block. The transformation method may be determined based on at least one of the prediction coding mode of the current block, the size of the current block, or the size of the current block. In the example, when the current block is encoded by the intra prediction mode and the size of the current block is less than N×N, the transformation may be performed by a transformation method using DST. On the other hand, when the above conditions are not met, the transformation may be performed by a transformation method using DCT.
[0456] For some blocks of the residual image, two-dimensional image transform may not be performed. Not performing two-dimensional image transform may be referred to as transform skipping. When transform skipping is applied, quantization may be applied to the residual value for which transform is not performed.
[0457] After the current block is transformed by using DCT or DST, the transformed current block can be transformed again. In this regard, the transformation based on DCT or DST can be defined as a first transformation, and the transformation performed again on the block to which the first transformation is applied can be defined as a second transformation.
[0458] The first transform may be performed by using any one of a plurality of transform kernel candidates. In an example, the first transform may be performed by using any one of DCT2, DCT8, or DCT7.
[0459] Different transform kernels may be used for the horizontal direction and the vertical direction. Information indicating the combination of the transform kernel for the horizontal direction and the transform kernel for the vertical direction may be signaled in the bitstream.
[0460] The processing unit of the first transform may be different from that of the second transform. In an example, the first transform may be performed on an 8×8 block, and the second transform may be performed on a 4×4 sized sub-block within the transformed 8×8 block. In this regard, the transform coefficients of the remaining regions where the second transform is not performed may be set to 0.
[0461] Alternatively, the first transform may be performed on the 4×4 block, and the second transform may be performed on a region having an 8×8 size including the transformed 4×4 block.
[0462] Information indicating whether the second transform is performed may be signaled in the bitstream.
[0463] Alternatively, whether to perform the second transform may be determined based on whether the horizontal transform kernel and the vertical transform kernel are identical to each other. In one example, the second transform may be performed only when the horizontal transform kernel and the vertical transform kernel are identical to each other. Alternatively, the second transform may be performed only when the horizontal transform kernel and the vertical transform kernel are different from each other.
[0464] Alternatively, the second transform may be allowed only when a predetermined transform kernel is used for the horizontal transform and the vertical transform. In one example, the second transform may be allowed when a DCT2 transform kernel is used for the horizontal transform and the vertical transform.
[0465] Alternatively, whether to perform the second transform may be determined based on the number of non-zero transform coefficients of the current block. In one example, when the number of non-zero transform coefficients of the current block is less than or equal to a threshold, the prediction method may be configured not to use the second transform. When the number of non-zero transform coefficients of the current block is greater than a threshold, the prediction method may be configured to use the second transform. As long as the current block is encoded using intra prediction, the prediction method may be configured to use the second transform.
[0466] The decoder may perform inverse transform on the second transform (second inverse transform), and may perform inverse transform on the first transform result from the second inverse transform (first inverse transform). As a result of performing the second inverse transform and the first inverse transform, a residual signal of the current block may be obtained.
[0467] When the encoder performs transformation and quantization, the decoder can obtain a residual block through inverse quantization and inverse transformation. The decoder can add the prediction block and the residual block to each other to obtain a reconstructed block of the current block.
[0468] When obtaining a reconstructed block of the current block, information loss occurring in quantization and encoding processes can be reduced via in-loop filtering. The in-loop filter may include at least one of a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive in-loop filter (ALF).
[0469] Applying the embodiments described with respect to the decoding process or the encoding process to the encoding process or the decoding process, respectively, may be included within the scope of the present disclosure. Within the scope of the present disclosure, embodiments in which operations occur in a predetermined order may be modified to embodiments in which operations occur in an order different from the predetermined order.
[0470] Although the above-mentioned embodiment is described based on a series of operations or flow charts, the embodiment does not limit the time series order of the operation of the method to this. In another example, the operation can be performed simultaneously or in a different order from it as needed. In addition, in the above-mentioned embodiment, each component (e.g., unit, module, etc.) constituting the block diagram can be implemented in the form of hardware device or software. Multiple components can be combined with each other into a single component, wherein a single component can be implemented using a single hardware device or software. The above-mentioned embodiment can be implemented using program instructions that can be executed via various computer components. Instructions can be recorded in a computer-readable storage medium. The computer-readable storage medium can include program instructions, data files, data structures, etc., individually or in combination with each other. Examples of computer-readable storage media include magnetic media (such as hard disks, floppy disks, and tapes) specially configured to store and execute program instructions therein, optical storage media (such as CD-ROMs, DVDs), magneto-optical media (such as optical disks), and hardware devices (such as ROMs, RAMs, flash memories, etc.). The hardware device can be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0471] Industrial availability
[0472] The present disclosure may be applied to an electronic device that encodes / decodes a video.
Claims
1. An image decoding method, comprising: Generate a merge candidate list for the current block; selecting one of the merge candidates included in the merge candidate list; and Perform motion compensation on the current block based on the motion information of the selected merge candidate, The merge candidate list includes merge candidates derived based on the motion information table. wherein, when the current block is included in the merge processing region, the motion information table is not updated when the block included in the merge processing region is decoded, wherein the motion information table is updated after decoding all blocks included in the merge processing area, Wherein, determining whether to update the motion information table using the motion information of the current block is based on the position of the current block in the merge processing area, and When the current block is located at the lower left of the merge processing area, it is determined to update the motion information table using the motion information of the current block.
2. The image decoding method according to claim 1, wherein: After decoding of the current block is completed, the motion information table is not updated using the motion information of the current block.
3. The image decoding method according to claim 1, wherein: When the current block is located at the lower right in the merge processing area, it is determined to update the motion information table using the motion information of the current block.
4. The image decoding method according to claim 3, wherein: Whether to add the motion information of the current block to the motion information table is determined based on whether the same motion information candidate as the motion information of the current block exists in the motion information table.
5. The image decoding method according to claim 4, wherein: The determination of whether the motion information candidate is identical to the motion information of the current block is performed using at least one motion information candidate having an index value equal to or less than a threshold value or an index value equal to or greater than the threshold value.
6. The image decoding method according to claim 4, wherein: When there is a motion information candidate identical to the motion information of the current block, the index of the motion information candidate is updated with a maximum value or a minimum value.
7. An image encoding method, comprising: Generate a merge candidate list for the current block; selecting one of the merge candidates included in the merge candidate list; and Perform motion compensation on the current block based on the motion information of the selected merge candidate, The merge candidate list includes merge candidates derived based on the motion information table. wherein, when the current block is included in the merge processing region, the motion information table is not updated when the block included in the merge processing region is encoded, wherein the motion information table is updated after encoding all blocks included in the merge processing area, Wherein, determining whether to update the motion information table using the motion information of the current block is based on the position of the current block in the merge processing area, and When the current block is located at the lower left of the merge processing area, it is determined to update the motion information table using the motion information of the current block.
8. The image encoding method according to claim 7, wherein: After the encoding of the current block is completed, the motion information table is not updated using the motion information of the current block.
9. The image encoding method according to claim 7, wherein: When the current block is located at the lower right in the merge processing area, it is determined to update the motion information table using the motion information of the current block.
10. The image encoding method according to claim 9, wherein: Whether to add the motion information of the current block to the motion information table is determined based on whether the same motion information candidate as the motion information of the current block exists in the motion information table.
11. The image encoding method according to claim 10, wherein: The determination of whether the motion information candidate is identical to the motion information of the current block is performed using at least one motion information candidate having an index value equal to or less than a threshold value or an index value equal to or greater than the threshold value.
12. The image encoding method according to claim 10, wherein: When there is a motion information candidate identical to the motion information of the current block, the index of the motion information candidate is updated with a maximum value or a minimum value.
13. An image decoding device, comprising: an inter-frame prediction unit, generating a merge candidate list of the current block, selecting any one of the merge candidates included in the merge candidate list, and performing motion compensation on the current block based on motion information of the selected merge candidate, The merge candidate list includes merge candidates derived based on the motion information table. wherein, when the current block is included in the merge processing region, the motion information table is not updated when the block included in the merge processing region is decoded, wherein the motion information table is updated after decoding all blocks included in the merge processing area, Wherein, determining whether to update the motion information table using the motion information of the current block is based on the position of the current block in the merge processing area, and When the current block is located at the lower left of the merge processing area, it is determined to update the motion information table using the motion information of the current block.
Citation Information
Patent Citations
Method and apparatus for setting reference picture index of temporal merging candidate
CN104012089A
Method predicting view synthesis in multi-view video coding and method for constituting merge candidate list by using same
CN105659604A
Inter prediction method and apparatus in image coding system
CN108141588A
Method for determining candidate block on inter prediction and apparatus using same
KR1020140049527A
Image encoding / decoding method and device using same
US20150103897A1
