Video coding method and apparatus, and recording medium having recorded thereon bitstream

By deriving and signaling the sign of motion and block vector difference values based on their magnitudes and prediction directions, the method improves encoding efficiency and accuracy in video coding.

WO2026147058A1PCT designated stage Publication Date: 2026-07-09DIGITALINSIGHTS INC

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
DIGITALINSIGHTS INC
Filing Date
2025-12-23
Publication Date
2026-07-09

AI Technical Summary

Technical Problem

Existing video coding technologies face inefficiencies in determining and signaling the sign of motion and block vector difference values, leading to unnecessary computations and reduced prediction accuracy.

Method used

A method and apparatus for deriving and signaling the sign of motion and block vector difference values based on their magnitudes and prediction directions, using adaptive coding to improve encoding efficiency and reduce unnecessary computations.

Benefits of technology

Enhances encoding efficiency by considering prediction direction and magnitude, reducing unnecessary computations and improving prediction accuracy in video coding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025022618_09072026_PF_FP_ABST
    Figure KR2025022618_09072026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a video decoding method and apparatus, the method comprising the steps of: generating a prediction block for a current block on the basis of a motion vector or a block vector of the current block; deriving transform coefficients for the current block on the basis of residual information for the current block; deriving inversely quantized transform coefficients by performing inverse quantization on the transform coefficients; deriving a residual block by performing a transform on the inversely quantized transform coefficients; and reconstructing the current block from the residual block, wherein when the prediction block is generated on the basis of the motion vector, a sign of a motion vector difference value corresponding to the motion vector may be derived, and when the prediction block is generated on the basis of the block vector, a sign of a block vector difference value corresponding to the block vector may be derived.
Need to check novelty before this filing date? Find Prior Art

Description

Video coding method and device, and a recording medium storing a bitstream

[0001] The present invention relates to a video signal processing method and apparatus. More specifically, it relates to a method and apparatus for deriving and using the sign of a vector difference value in prediction using motion vectors or block vectors.

[0002] A prediction mode can be determined for the current block, and prediction can be performed according to the determined prediction mode. The prediction mode may include an intra-frame prediction mode, an inter-frame prediction mode, an intra-block copy mode, a palette mode, etc.

[0003] When cross-frame prediction or intra-block copy prediction is performed, prediction for the current block can be performed based on motion vectors or block vectors.

[0004] The present disclosure aims to provide a method and apparatus for deriving the sign of a difference value when a difference value between a motion vector and a block vector exists.

[0005] The present disclosure aims to provide a method and apparatus for signaling / parsing the sign of a difference value when a motion vector / block vector difference value exists.

[0006] According to the present disclosure, the purpose is to provide a method for determining the signaling form of a motion vector difference value based on a motion vector coding mode.

[0007] According to the present disclosure, the purpose is to provide a method for selectively determining whether to derive the sign of a motion vector / block vector difference value based on the precision of the motion vector / block vector.

[0008] The technical problems to be solved in this disclosure are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which this disclosure belongs from the description below.

[0009] A video decoding method according to the present disclosure comprises: a step of generating a prediction block for a current block based on a motion vector or a block vector of a current block; a step of deriving a transformation coefficient for a current block based on residual information for the current block; a step of deriving a derivation-quantized transformation coefficient by performing inverse quantization on the transformation coefficient; a step of deriving a residual block by performing a transformation on the derivation-quantized transformation coefficient; and a step of restoring the current block from the residual block, wherein when the prediction block is generated based on the motion vector, the sign of a motion vector difference value corresponding to the motion vector is derived, and when the prediction block is generated based on the block vector, the sign of a block vector difference value corresponding to the block vector is derived.

[0010] In the image decoding method according to the present disclosure, the motion vector difference value may be obtained from motion vector difference information or based on index information signaled from a bitstream and a predetermined table.

[0011] In the image decoding method according to the present disclosure, the motion vector coding mode includes an AMVD-based mode, and based on the AMVD-based mode, it may be determined whether the motion vector difference value is obtained from the motion vector difference information or is obtained based on the index information and the predetermined table.

[0012] In the image decoding method according to the present disclosure, the sign of the motion vector difference value can be derived for at least one of the x-direction motion vector difference value and the y-direction motion vector difference value.

[0013] In the image decoding method according to the present disclosure, the sign of the motion vector difference value is determined to be derived based on the precision being less than or equal to a threshold value, and the threshold value may include 1-pel.

[0014] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and when the magnitude of either the x-direction motion vector difference value or the y-direction motion vector difference value is not zero, only the sign of the non-zero motion vector difference value is derived, wherein if the magnitude of the non-zero motion vector difference value is even, the sign for the derived direction is derived as a negative number, and if the magnitude is odd, the sign is derived as a positive number.

[0015] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and if the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, the sign of the y-direction motion vector difference value can be derived.

[0016] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and when the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, the sign of the induced direction is determined to be positive based on the fact that the sum of the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value is even, and the sign of the induced direction can be determined to be negative based on the fact that the sum of the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value is odd.

[0017] In the image decoding method according to the present disclosure, when bidirectional inter-frame prediction is performed for the current block, a code may be derived for all or part of the x-direction motion vector difference value in the L0 direction, the y-direction motion vector difference value in the L0 direction, the x-direction motion vector difference value in the L1 direction, and the y-direction motion vector difference value in the L1 direction.

[0018] In the image decoding method according to the present disclosure, a code can be derived only for the y-direction motion vector difference value in the L1 direction.

[0019] In the image decoding method according to the present disclosure, if the sum of the absolute values ​​of the non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is even, the sign of the induced direction may be determined as positive, and if the sum of the absolute values ​​of the non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is odd, the sign of the induced direction may be determined as negative.

[0020] In the image decoding method according to the present disclosure, a block vector precision candidate set is determined at the frame level, wherein the block vector precision candidate set for the current block may be determined as either a first candidate set consisting only of integer pixel precision or a second candidate set including integer pixel precision and sub-pixel precision.

[0021] A video encoding method according to the present disclosure comprises: a step of generating a prediction block for a current block based on a motion vector or a block vector of a current block; a step of deriving a residual block for the current block based on the prediction block; a step of performing a transformation based on the residual block to derive a transformation coefficient for the current block; a step of performing quantization on the transformation coefficient to derive a quantized transformation coefficient; and a step of encoding residual information regarding the quantized transformation coefficient, wherein when the prediction block is generated based on the motion vector, a sign of a motion vector difference value corresponding to the motion vector is derived, and when the prediction block is generated based on the block vector, a sign of a block vector difference value corresponding to the block vector is derived.

[0022] In a non-transient digital storage medium for storing a bitstream according to the present disclosure, the bitstream may be generated by the image encoding method of the present disclosure.

[0023] In a transmission method for transmitting a bitstream according to the present disclosure, the bitstream may be generated by the image encoding method of the present disclosure.

[0024] According to the present disclosure, by providing a method and apparatus for deriving the sign of a difference value when a difference value between a motion vector and a block vector exists, encoding efficiency can be improved through encoding that considers the prediction direction and the magnitude of the motion vector / block vector.

[0025] According to the present disclosure, by providing a method and apparatus for signaling / parsing the sign of a difference value when a difference value between a motion vector and a block vector exists, encoding efficiency can be improved through encoding that considers the prediction direction and the magnitude of the motion vector / block vector.

[0026] According to the present disclosure, adaptive coding according to mode characteristics may be possible by providing a method for determining the signaling form of motion vector / block vector difference values ​​based on a motion vector coding mode.

[0027] According to the present disclosure, by providing a method for selectively determining whether to sign-derive a motion vector / block vector difference value based on motion vector / block vector precision, unnecessary computation can be reduced and prediction accuracy can be improved.

[0028] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure pertains from the description below.

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

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

[0031] FIG. 3 is a flowchart of an image decoding method according to the present disclosure.

[0032] FIG. 4 is a diagram illustrating a search location for constructing a candidate list according to the present disclosure.

[0033] FIG. 5 is a drawing showing an example of a fixed block vector candidate according to the present disclosure.

[0034] FIG. 6 is a flowchart of an image encoding method according to the present disclosure.

[0035] A video decoding method according to the present disclosure comprises: a step of generating a prediction block for a current block based on a motion vector or a block vector of a current block; a step of deriving a transformation coefficient for a current block based on residual information for the current block; a step of deriving a derivation-quantized transformation coefficient by performing inverse quantization on the transformation coefficient; a step of deriving a residual block by performing a transformation on the derivation-quantized transformation coefficient; and a step of restoring the current block from the residual block, wherein when the prediction block is generated based on the motion vector, the sign of a motion vector difference value corresponding to the motion vector is derived, and when the prediction block is generated based on the block vector, the sign of a block vector difference value corresponding to the block vector is derived.

[0036] In the image decoding method according to the present disclosure, the motion vector difference value may be obtained from motion vector difference information or based on index information signaled from a bitstream and a predetermined table.

[0037] In the image decoding method according to the present disclosure, the motion vector coding mode includes an AMVD-based mode, and based on the AMVD-based mode, it may be determined whether the motion vector difference value is obtained from the motion vector difference information or is obtained based on the index information and the predetermined table.

[0038] In the image decoding method according to the present disclosure, the sign of the motion vector difference value can be derived for at least one of the x-direction motion vector difference value and the y-direction motion vector difference value.

[0039] In the image decoding method according to the present disclosure, the sign of the motion vector difference value is determined to be derived based on the precision being less than or equal to a threshold value, and the threshold value may include 1-pel.

[0040] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and when the magnitude of either the x-direction motion vector difference value or the y-direction motion vector difference value is not zero, only the sign of the non-zero motion vector difference value is derived, wherein if the magnitude of the non-zero motion vector difference value is even, the sign for the derived direction is derived as a negative number, and if the magnitude is odd, the sign is derived as a positive number.

[0041] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and if the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, the sign of the y-direction motion vector difference value can be derived.

[0042] In the image decoding method according to the present disclosure, unidirectional inter-frame prediction is performed for the current block, and when the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, the sign of the induced direction is determined to be positive based on the fact that the sum of the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value is even, and the sign of the induced direction can be determined to be negative based on the fact that the sum of the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value is odd.

[0043] In the image decoding method according to the present disclosure, when bidirectional inter-frame prediction is performed for the current block, a code may be derived for all or part of the x-direction motion vector difference value in the L0 direction, the y-direction motion vector difference value in the L0 direction, the x-direction motion vector difference value in the L1 direction, and the y-direction motion vector difference value in the L1 direction.

[0044] In the image decoding method according to the present disclosure, a code can be derived only for the y-direction motion vector difference value in the L1 direction.

[0045] In the image decoding method according to the present disclosure, if the sum of the absolute values ​​of the non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is even, the sign of the induced direction may be determined as positive, and if the sum of the absolute values ​​of the non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is odd, the sign of the induced direction may be determined as negative.

[0046] In the image decoding method according to the present disclosure, a block vector precision candidate set is determined at the frame level, wherein the block vector precision candidate set for the current block may be determined as either a first candidate set consisting only of integer pixel precision or a second candidate set including integer pixel precision and sub-pixel precision.

[0047] A video encoding method according to the present disclosure comprises: a step of generating a prediction block for a current block based on a motion vector or a block vector of a current block; a step of deriving a residual block for the current block based on the prediction block; a step of performing a transformation based on the residual block to derive a transformation coefficient for the current block; a step of performing quantization on the transformation coefficient to derive a quantized transformation coefficient; and a step of encoding residual information regarding the quantized transformation coefficient, wherein when the prediction block is generated based on the motion vector, a sign of a motion vector difference value corresponding to the motion vector is derived, and when the prediction block is generated based on the block vector, a sign of a block vector difference value corresponding to the block vector is derived.

[0048] In a non-transient digital storage medium for storing a bitstream according to the present disclosure, the bitstream may be generated by the image encoding method of the present disclosure.

[0049] In a transmission method for transmitting a bitstream according to the present disclosure, the bitstream may be generated by the image encoding method of the present disclosure.

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

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

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

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

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

[0055] In addition, some components or steps of the first embodiment of the present invention may be added to or replace some components or steps of the second embodiment of the present invention.

[0056] Furthermore, the components shown in the embodiments of the present invention are depicted independently to represent different characteristic functions and do not imply that each component consists of separate hardware or a single software unit. That is, for convenience of explanation, each component is described by listing it as a separate component, and at least two of the components may be combined to form a single component, or a single component may be divided into multiple components to perform a function. Such integrated and separated embodiments of each component are also included within the scope of the present invention as long as they do not deviate from the essence of the invention.

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

[0058] Referring to FIG. 1, the encoding device (100) comprises a picture splitting unit (110), a prediction unit (120, 125), a conversion unit (130), a quantization unit (135), a reordering unit (160), and an entropy encoding unit (165).

[0059] It may include an inverse quantization unit (140), an inverse conversion unit (145), a filter unit (150), and a memory (155).

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

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

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

[0063] The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous picture or the subsequent picture of the current picture, and in some cases, may predict a prediction unit based on information of a partially encoded area within the current picture. The inter prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

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

[0065] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to calculate motion vectors. Based on the interpolated pixels, the motion vector can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various motion prediction methods such as the Skip method, Merge method, AMVP (Advance Motion Vector Prediction) method, and Intra Block Copy method can be used.

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

[0067] Additionally, a residual block can be generated that includes residual value information, which is the difference between the prediction unit that performed the prediction based on the prediction unit generated in the prediction unit (120, 125) and the original block of the prediction unit. The generated residual block can be input to the conversion unit (130).

[0068] In the transformation unit (130), the residual block containing residual value information of the prediction unit generated through the original block and the prediction unit (120, 125) can be transformed using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on the intra-prediction mode information of the prediction unit used to generate the residual block.

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

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

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

[0072] The entropy encoding unit (165) can perform entropy encoding based on the values ​​calculated by the reordering unit (160). Entropy encoding can use various encoding methods, such as, for example, Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding). In this regard, the entropy encoding unit (165) can encode residual value coefficient information of the encoding unit from the reordering unit (160) and the prediction unit (120, 125).

[0073] In the inverse quantization unit (140) and inverse transformation unit (145), the values ​​quantized in the quantization unit (135) are inverse quantized, and the values ​​transformed in the transformation unit (130) are inverse transformed. The residual value generated in the inverse quantization unit (140) and inverse transformation unit (145) can be combined with the prediction unit predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.

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

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

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

[0077] Referring to FIG. 2, the image decoder (200) may include an entropy decoder (210), a reordering unit (215), an inverse quantization unit (220), an inverse transformation unit (225), a prediction unit (230, 235), a filter unit (240), and a memory (245).

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

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

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

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

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

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

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

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

[0086] The prediction unit (230, 235) may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit receives various information, such as prediction unit information input from the entropy decoding unit (210), prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, distinguishes the prediction unit in the current encoding unit, and can determine whether the prediction unit performs inter prediction or intra prediction.

[0087] The inter prediction unit (230) can perform inter prediction for the current prediction unit based on information included in at least one picture, either a previous picture or a subsequent picture, of the current picture containing the current prediction unit, using information required for inter prediction of the current prediction unit provided by the video encoder. To perform inter prediction, based on the encoding unit, it can determine whether the motion prediction method of the prediction unit included in the corresponding encoding unit is a Skip Mode, Merge Mode, AMVP Mode, or Intra Block Copy Mode.

[0088] The intra prediction unit (235) can generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit that has performed intra prediction, it can perform intra prediction based on the intra prediction mode information of the prediction unit provided by the image encoder. The intra prediction unit (235) may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixel of the current block, and can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block using the prediction mode of the prediction unit and the AIS filter information provided by the image encoder. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

[0089] The reference pixel interpolation unit can generate a reference pixel of an integer value or less by interpolating the reference pixel when the prediction mode of the prediction unit is a prediction unit that performs intra-prediction based on the pixel value interpolated from the reference pixel. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.

[0090] The restored block or picture may be provided to a filter unit (240). The filter unit (240) may include a deblocking filter, an offset correction unit, and an ALF.

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

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

[0093] The memory (245) can store the restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to the output unit.

[0094] First, the terms used in this disclosure are briefly explained as follows.

[0095] In the present disclosure, the prediction target block may refer to a block for which a prediction is to be performed. The prediction target block may be understood as a prediction block, a prediction unit (PU), a decoding block, etc.

[0096] The conversion target block may refer to a block on which a conversion is to be performed during the encoding process. In this disclosure, the conversion target block may be understood as a conversion block, a conversion unit (TU), etc. The inverse conversion target block may refer to a block on which an inverse conversion is to be performed during the decoding process.

[0097] The current block may indicate a prediction target block, a transformation target block, or an inverse transformation target block depending on the stage of the encoding / decoding method.

[0098] Luminance component block and luminance block have the same meaning and can be used interchangeably.

[0099] Color difference component block and color difference block can be used interchangeably with the same meaning.

[0100] Picture and frame have the same meaning and can be used interchangeably.

[0101] Motion and movement have the same meaning and can be used interchangeably.

[0102] The image signal encoding / decoding method proposed in this disclosure can be performed independently for the luminance block and the chrominance block, respectively. If the color format of the input image is a YUV format (e.g., YUV420, YUV411, YUV422, YUV444, etc.), it may be performed for the chrominance block after being performed for the luminance block. If the color format of the input image is an RGB format, encoding may be performed after performing color conversion to YUV.

[0103] However, the above-disclosed embodiment is merely an example, and image encoding / decoding for luminance blocks and chrominance blocks may be performed in a different manner.

[0104] FIG. 3 is a flowchart of an image decoding method according to the present disclosure.

[0105] Referring to FIG. 3, prediction parameters such as the motion vector of the current block can be derived (S310).

[0106] According to one embodiment of the present disclosure, a prediction target block, i.e., a prediction unit, for performing a prediction may be determined. In the present disclosure, the prediction unit may correspond to the current block. For example, the prediction unit may be determined as a coding block, any one of the sub-blocks into which the coding block is divided, a set of pixels, or the value of a single pixel.

[0107] According to one embodiment of the present disclosure, the prediction unit may include size information and / or shape information for performing predictions for luminance components and color difference components.

[0108] According to one embodiment of the present disclosure, the prediction unit may be determined dependently or independently of the luminance component and the color difference component.

[0109] The statement that the prediction unit is determined dependently on the luminance component and the chrominance component may mean that the prediction units of the luminance component or the chrominance component are not determined independently for each component, but rather that when the prediction unit of one component is determined, the units of other components or components are determined to have a corresponding size and / or shape. Here, the one component may include one or more of the luminance component and the chrominance component.

[0110] For example, a color difference component can be determined based on information about a luminance component (or luminance components). Alternatively, a luminance component can be determined based on information about a color difference component (or color difference components).

[0111] For example, the prediction unit of the color difference component can be determined as a size corresponding to the prediction unit of the luminance component depending on the color format of the input image or the converted color format.

[0112] When the prediction unit is determined dependently with respect to the luminance component and the chrominance component, information regarding the prediction unit of the other component corresponding to one component, that is, the component determined dependently, may be omitted.

[0113] The fact that the prediction unit is determined independently for the luminance component and the color difference component may mean that the prediction unit of the luminance component or the color difference component is determined individually for each component.

[0114] If the prediction unit is determined independently for the luminance component and the chrominance component, information regarding the prediction unit for each component can be signaled separately.

[0115] According to one embodiment of the present disclosure, information related to the size and / or shape of a current block may be signaled to a decoding device. Here, the information related to the size and / or shape of the current block may include direct or indirect information necessary to determine the size of the current block.

[0116] For example, information related to the size and / or shape of the current block may include information on the size and / or shape of the current block. Accordingly, the size and / or shape of the current block can be directly determined by the decoding device.

[0117] Alternatively, information related to the size and / or shape of the current block may include information that can influence the determination of the size and / or shape information of the current block, such as size information regarding the number of divisions, division depth, division shape, division direction, minimum division block, etc., division information of previously decoded neighboring blocks, and prediction mode of previously decoded neighboring blocks. Accordingly, the decoding device may derive the size and / or shape of the current block based on information that can influence the determination of the size and / or shape of the current block.

[0118] According to one embodiment of the present disclosure, a prediction mode for the current block can be determined. Specifically, the prediction mode may include an intra-frame prediction mode, an inter-frame prediction mode, an Intra Block Copy (IBC) mode, a palette mode, a mode combining an intra-frame prediction mode and an inter-frame prediction mode, etc. Accordingly, any one of intra-frame prediction, inter-frame prediction, prediction using IBC mode, prediction using palette mode, or prediction using a mode combining an intra-frame prediction mode and an inter-frame prediction mode may be performed for the current block. In some cases, the prediction using a mode combining an intra-frame prediction mode and an inter-frame prediction mode may be included in the inter-frame prediction.

[0119] A specific prediction method can be determined based on the determined prediction mode. For example, the direction of intra-frame prediction, the number of reference pictures in inter-frame prediction, and the method for determining the pixel values ​​of reference blocks in inter-frame prediction can be determined. This will be discussed later.

[0120] Meanwhile, according to one embodiment of the present disclosure, if in-frame prediction is not performed on the current block, a 1-bit flag can be parsed for the current block.

[0121] If the value of the above flag indicates 'skip', the prediction mode of the current block may be determined as merge mode or IBC prediction merge mode. In this case, the transformation may be omitted, and the prediction sample may be used as the restoration sample. Here, 'skip' may indicate a case where motion information (e.g., motion vector, reference picture, reference picture list, etc.) is not signaled / parsed, or where motion information is signaled / parsed using only at least one syntax information. Additionally, it may indicate a case where the residual block for the current block is not signaled.

[0122] According to one embodiment of the present disclosure, when skip prediction is not performed for the current block, a prediction mode for the current block may be determined by parsing a 1-bit flag for the current block. The prediction mode may include an intra-frame prediction mode, an inter-frame prediction mode, an IBC mode, a palette mode, etc.

[0123] When skip prediction is not performed for the current block and inter-frame prediction or IBC prediction is performed, a 1-bit flag can be parsed to determine whether to perform prediction for the current block in merge mode or in AMVP (Advanced Motion Vector Prediction) mode. Here, AMVP mode may refer to a mode in which elements within motion information are transmitted individually, and in addition to the motion information, motion vector difference values ​​are signaled / parsed to perform motion compensation using the corrected motion information during the subsequent prediction process.

[0124] According to one embodiment of the present disclosure, when the prediction mode of the current block is determined to be an inter-frame prediction mode, the number of reference frames and the reference frame index to be used by the current block can be determined.

[0125] For example, the TIP (Temporal Interpolated Prediction) flag can be parsed. If the flag is 1, the L0 frame is determined to be the TIP frame, and unidirectional prediction can be performed. Here, the TIP frame may refer to a reference frame generated based on motion field information within the current frame and motion field information of reference frames within the DPB, rather than a frame stored in the DPB (Decoded Picture Buffer).

[0126] If the TIP flag is not parsed, the number of reference frames to use for cross-frame prediction in the current block can be determined by parsing the information determining whether to perform bidirectional prediction.

[0127] Subsequently, the reference frame index for each reference frame can be parsed according to the determined prediction direction (unidirectional or bidirectional) to determine the reference frame to be used for prediction.

[0128] At this time, according to the embodiment, the reference frame stored in the DPB can be determined based on the difference in the Picture Order Count (POC) with the current frame and / or the Quantization Parameter (QP) of the frame, etc., and a cost function defined by an agreement between the decoding and encoding devices can be calculated, and the reference frame represented by each index can be determined according to the result of the cost function. For example, lower index numbers can be adaptively assigned starting from the reference frame with the lowest calculated cost function.

[0129] According to one embodiment of the present disclosure, when the prediction mode of the current block is determined to be an inter-frame prediction mode, unidirectional motion or bidirectional motion information can be parsed. At this time, after defining a method for signaling / parsing motion information for unidirectional and bidirectional motion information as an agreement between the encoding / decoding devices, the index of the mode and / or the information of the mode can be parsed.

[0130] The prediction direction (unidirectional or bidirectional) of the current block can be determined based on the index information of the mode and / or the information of the mode. A method for representing motion information can be determined based on the index information of the mode and / or the information of the mode. In the method for representing motion information, it can be determined whether to represent the motion information with one or more index information, and / or to parse the motion information into a value (e.g., motion vector difference value).

[0131] Specifically, motion information for each direction can be determined by parsing index information and / or by parsing whether global motion information is used. One or more global motion information entries can be derived per frame and can be stored and used.

[0132] In some cases, in addition to index information, motion vector difference values ​​can be additionally parsed. In this case, information regarding distance and / or direction can be parsed, and / or difference values ​​in the vertical and / or horizontal directions can be parsed to derive motion vector difference values.

[0133] Or / and in the case of bidirectional prediction, the motion vector difference value in one direction may be parsed, and the motion vector difference value in the opposite direction may be derived and used based on the relationship between the already derived motion vector difference value and the reference picture. Here, the relationship may include the temporal distance from the current frame and / or temporal direction, etc.

[0134] When a motion vector difference value in one direction is derived, scaling may be performed on additionally derived motion vector difference values ​​in the vertical and / or horizontal directions. In this case, scaling information can be parsed.

[0135] According to one embodiment of the present disclosure, a motion vector coding mode for each reference frame, i.e., a method for parsing motion vectors, may be determined according to the prediction direction. Here, L0 may mean a direction having a POC lower than the POC of the current frame, and L1 may mean a direction having a POC higher than the POC of the current frame.

[0136] For example, the motion vector coding mode for a unidirectional prediction mode may include at least one of GLOBAL_MV mode, NEW_MV mode, NEAR_MV mode, AMVD_NEW_MV mode, or WARP_MV mode. GLOBAL_MV mode may mean a mode that uses a frame-by-frame global motion model parsed at a higher level. NEW_MV mode may mean a mode that parses motion vector candidate index information and Motion Vector Difference (MVD) values. NEAR_MV mode may mean a mode that parses only motion vector candidate index information. AMVD_NEW_MV mode may mean a mode that parses motion vector candidate index information and simplified MVDs. WARP_MV mode may mean a mode that constructs a candidate list for Warp prediction and derives parameters for non-translational MVs by parsing the indices of the translational MVs of the Warp prediction.

[0137] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0138] For example, the motion vector coding mode of the bidirectional prediction mode can be defined according to the encoding / decoding device agreement as a combination of all or part of the motion vector coding modes of the unidirectional prediction mode, and the motion vector coding mode for L0 and L1 reference frames can be determined by parsing index information for the corresponding mode.

[0139] For example, the motion vector coding mode of the bidirectional prediction mode may include at least one of NEAR_NEAR_MV, NEAR_NEW_MV, NEW_NEAR_MV, GLOBAL_GLOBAL_MV, NEW_NEW_MV, JOINT_NEW_MV, or JOINT_AMVD_NEW_MV.

[0140] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0141] According to the embodiment, a mode may be used to derive an MVD for a reference frame (L0 or L1 reference frame) in the other direction after parsing an MVD or an MVD index for an L0 or L1 reference frame.

[0142] For example, two JOINT-based modes (JOINT_NEW_MV and JOINT_AMVD_NEW_MV) parse the MVD for one direction, and the MVD for the opposite direction can be derived using the already parsed MVD value. For example, the direction to be parsed is the direction using a reference frame closer to the POC of the current frame, and scaling is performed on the x-direction and / or y-direction of the parsed MVD to derive the MVD for the opposite direction. Here, scaling can be performed at a factor of 1 / 2, 1, and / or 2, but is not limited thereto. In this case, the scaling information can be parsed as index information.

[0143] According to one embodiment of the present disclosure, the motion vector precision of the current block can be signaled in the form of index information, etc.

[0144] For example, a set of candidate motion vector precisions can be determined at a higher level (e.g., frame level). When the types of applicable precisions are {8-pel, 4-pel, 1-pel, 1 / 2-pel, 1 / 4-pel, 1 / 8-pel}, the set can be defined as, as an example, {(4-pel, 1-pel, 1 / 2-pel, 1 / 8-pel), (8-pel, 4-pel, 1-pel, 1 / 4-pel)}.

[0145] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0146] For example, after a precision set is determined at a higher level, a flag can be parsed to determine whether to use a fixed motion vector precision in units such as blocks. For example, if the flag is 1, 1 / 8-pel or 1 / 4-pel can be used as the precision depending on the set.

[0147] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0148] For example, if fixed motion vector precision is not used, any of the remaining precisions excluding the fixed precision in the set can be signaled / parsed as index information. According to an embodiment, any of the remaining precisions excluding the fixed precision can be parsed as index information in block units.

[0149] Alternatively, precision indexes can be signaled / parsed on a block basis. In this case, the precision represented by each index may differ depending on the prediction mode (e.g., WARP (Affine) mode).

[0150] According to one embodiment of the present disclosure, when inter-frame prediction is performed for a current block, a prediction block can be generated from a reference frame through motion compensation using one or more motion information.

[0151] Motion information may include motion vectors and / or motion vector difference values. Motion information may be derived through a candidate list containing multiple candidates. The multiple candidates may include at least one of motion vectors, reference picture indices, etc. Motion vector difference values ​​may be obtained through motion vector difference information. Alternatively, motion vector difference values ​​may be obtained based on index information signaled from a bitstream and a predetermined table. The index information may include at least one of distance index information or direction index information. The distance index information may indicate the magnitude of the motion vector difference value, and the direction index information may indicate the sign of the motion vector difference value. The table may include at least one of a distance table or a direction table. The distance table may define a mapping relationship between the distance index information and the motion vector difference value based on magnitude. The direction table may define a mapping relationship between the direction index information and the motion vector difference value based on sign.

[0152] When using at least two sets of motion information, motion compensation can be performed from one or more reference frames and a weighted sum can be formed to generate a prediction block. Alternatively, the decoder may use the first parsed motion information to derive and use all or part of other motion information.

[0153] FIG. 4 is a diagram illustrating a search location for constructing a candidate list according to the present disclosure. Spatially adjacent / non-adjacent blocks and / or temporally adjacent blocks may be searched to construct the candidate list.

[0154] The numbers within the blocks shown in Fig. 4 may represent the search order, and only some of the search locations shown in Fig. 4 may be used.

[0155] Spatially adjacent blocks may be blocks within the current picture. Spatially adjacent blocks may include at least one of the block to the left of the current block, the top block, the top-left block, the bottom-left block, or the top-right block.

[0156] For example, the left block may include block 1, block 3, and / or block 8. The top block may include block 2, block 4, and / or block 9. The top-left block may include block 7. The bottom-left block may include block 5. The top-right block may include block 6.

[0157] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0158] Spatially non-adjacent blocks may be neighboring blocks designated to be used for MV prediction, in addition to spatially adjacent blocks. Spatially non-adjacent blocks may be blocks containing samples at a location at a distance q or greater from the current block. Here, q may be an integer greater than or equal to 1.

[0159] For example, spatially non-adjacent blocks may include block 10, block 11, block 12, block 13, block 14, block 15, block 16, block 17, and / or block 18.

[0160] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0161] Temporal adjacent blocks may be blocks included in corresponding position blocks within a reference frame. A corresponding position block within a reference frame may refer to a position block corresponding to the current block within the reference frame that is used for inter-frame prediction of the current block.

[0162] For example, temporally adjacent blocks may include a block containing a sample at position 1 (top-left position) of the reference frame, a block containing a sample at position 2 (top-right position), a block containing a sample at position 3, a block containing a sample at position 4 (bottom-left position), and / or a block containing a sample at position 5 (bottom-right position).

[0163] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0164] According to one embodiment of the present disclosure, if a motion vector difference value of the current block exists, the motion vector difference value can be parsed. At this time, the magnitude of the motion vector difference value can be parsed, and the sign can be parsed or derived. According to an embodiment, the motion vector difference value can be obtained based on index information signaled from a bitstream and a predetermined table. Alternatively, the motion vector difference value can be obtained through motion vector difference information.

[0165] Depending on the case, whether the motion vector difference value is obtained based on index information and a predetermined table or through motion vector difference information can be determined according to the motion vector coding mode.

[0166] For example, in the case of unidirectional prediction, NEW_MV and WARP_MV can encode motion vector difference values ​​to signal / parse. In this case, if the motion vector coding mode of the current block is WARP_MV, the MVD can be parsed only if the flag for parsing the MVD is 1.

[0167] For example, in the case of unidirectional prediction, AMVD_NEW_MV can signal / parse motion vector difference values ​​as index information. In this case, by agreement between the decoding / encoding devices, the table of motion vector difference values ​​can be defined as {0, 2, 4, 6, 8, 16, 32, 64, 128}.

[0168] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0169] For example, among motion vector coding modes, AMVD-based modes (e.g., AMVD_NEW_MV) and non-AMVD modes (e.g., NEW_MV) can be distinguished as separate motion vector coding modes. As another example, if the motion vector coding mode is determined to be NEW_MV, additional information can be parsed to determine whether it is an AMVD_NEW_MV mode.

[0170] For example, in the case of bidirectional prediction, NEW_NEW_MV signals / parses both motion vector difference values ​​and can signal / parse each motion vector difference value by encoding, and JOINT_NEW_MV can signal / parse by encoding the motion vector difference value in the direction closer to the current frame's POC.

[0171] For example, in the case of bidirectional prediction, NEW_NEAR_MV and NEAR_NEW_MV can signal / parse motion vector difference values ​​as index information for the NEW direction (L0 and L1), respectively, and JOINT_AMVD_NEW_MV can signal / parse by encoding the motion vector difference values ​​of the direction closer to the POC of the current frame as index information.

[0172] According to one embodiment of the present disclosure, if a motion vector difference value of the current block exists, the magnitude and / or sign of the motion vector difference value can be parsed. In this case, depending on the case, at least one sign of two directions (x-direction and y-direction) can be derived and / or determined by parsing.

[0173] According to one embodiment of the present disclosure, whether to perform code derivation may be determined based on the motion vector precision of the current block. For example, code derivation may be performed under conditions when the motion vector precision of the current block is below or less than a threshold precision. For example, when the available precision of the current block is {8-pel, 4-pel, 1-pel, 1 / 2-pel, 1 / 4-pel, 1 / 8-pel}, code derivation may be performed only when it is below or less than the threshold precision. For example, the threshold precision may be 1-pel.

[0174] Critical precision can be defined by an agreement between the decoding and encoding devices, defined based on specific parameters, or signaled / parsed at a higher level. The specific parameters may include the block size, frame size, temporal layer, or quantization parameters of the current block.

[0175] According to one embodiment of the present disclosure, when the current block is unidirectional prediction and signals / parses by encoding the motion vector difference value, the sign of the motion vector difference value can be derived.

[0176] For example, if only the difference value of one of the two directions (x-direction and y-direction) is not zero, the sign of the non-zero direction can be derived.

[0177] According to an embodiment, if the magnitude of the motion vector difference value in the non-zero direction is even, the sign can be derived as positive, and if the magnitude of the motion vector difference value in the non-zero direction is odd, the sign can be derived as negative. Alternatively, the opposite case can be derived.

[0178] For example, if the difference values ​​of the motion vectors in both directions (x-direction and y-direction) are not both zero, the sign of the x-direction or y-direction can be derived. For example, the sign of the y-direction can be derived in a fixed way.

[0179] For example, when deriving only the sign of the x-direction or y-direction, if the sum of the magnitudes of the motion vector difference values ​​in the two directions is even, the sign of the deriving direction may be induced as positive, and if the sum of the magnitudes of the motion vector difference values ​​in the two directions is odd, the sign of the deriving direction may be induced as negative. Alternatively, the opposite case may be induced. In this case, the sign of the motion vector difference value in the other direction can be signaled / parsed.

[0180] For example, among two directions (x-direction and y-direction), a code in a fixed direction can be derived by agreement between the sub / decoding device, and / or a code in a direction adaptively determined based on at least one of the size of the current block, the aspect ratio, and the resolution of the frame can be derived.

[0181] For example, if the difference values ​​of the motion vectors in both directions (x-direction and y-direction) are not both zero, the signs of the x-direction and y-direction can be derived. For example, the signs of the two directions can be determined based on the remainder after adding the magnitudes of the difference values ​​of the motion vectors in both directions and dividing by 4.

[0182] Table 1 shows an example of deriving the signs of the MVD x-direction and y-direction based on the sum of the magnitudes of the two-direction motion vector difference values.

[0183] -SignSum_of_MVDs % 4MVD_xMVD_y0++1-+2+-3--

[0184] Referring to Table 1, the sign of the two directions can be determined by summing the magnitudes of the motion vector difference values ​​of the two directions (Sum_of_MVDs) and dividing by 4 (Sum_of_MVDs % 4).

[0185] Referring to Table 1, when (Sum_of_MVDs % 4) is 0, the signs of the x-direction and y-direction can be determined as {+, +}.

[0186] Referring to Table 1, when (Sum_of_MVDs % 4) is 1, the signs of the x-direction and y-direction can be determined as {-, +}.

[0187] Referring to Table 1, when (Sum_of_MVDs % 4) is 2, the signs of the x-direction and y-direction can be determined as {+, -}.

[0188] Referring to Table 1, when (Sum_of_MVDs % 4) is 3, the signs of the x-direction and y-direction can be determined as {-, -}.

[0189] In this case, the code representing each remainder value can be defined by an agreement between the decoding and encoding devices.

[0190] According to one embodiment of the present disclosure, when the current block is bidirectional prediction and encodes motion vector values ​​for signaling / parsing, the sign of the motion vector difference value can be derived. At this time, the sign of up to four motion vector difference values ​​can be derived and / or signaled / parsed. All or some of the signs of non-zero motion vector difference values ​​can be derived.

[0191] For example, the number of non-zero motion vector difference values ​​can be 1, 2, 3, or 4. In this case, if the number is 1, a positive or negative value may be defined and determined between the decoding / encoding devices according to the remainder when divided by 2 (Sum_of_MVDs % 2). If the number is 2, a set of codes representing each remainder may be defined and determined between the decoding / encoding devices according to the remainder when divided by 4 (Sum_of_MVDs % 4). If the number is 3, a set of codes representing each remainder may be defined and determined between the decoding / encoding devices according to the remainder when divided by 8 (Sum_of_MVDs % 8).

[0192] Table 2 below shows an example of a set of symbols determined by the remainder when divided by 8 when the number of non-zero motion vector difference values ​​is 3.

[0193] -SignSum_of_MVDs % 8MVD_AMVD_BMVD_C0+++1++-2+--3---4--+5-++6-+-7+-+

[0194] A, B, and C may each correspond to a non-zero motion vector difference value of the x-direction of the L0 direction, the y-direction of the L0 direction, the x-direction of the L1 direction, or the y-direction of the L1 direction.

[0195] Meanwhile, when the number is 4, the code set represented by each remainder can be defined and determined between the decoding / encoding devices according to the remainder divided by 16 (Sum_of_MVDs % 16). For example, if the remainder is 0, the code set can be determined as {+, +, +, +}, and if the remainder is 15, the code set can be determined as {-, -, -, -}.

[0196] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0197] For example, up to k codes may be derived. Here, k is a value that can be defined by an agreement between the decoding and encoding devices, and may be defined based on a predetermined parameter or determined by the decoder after being signaled at a higher level. The predetermined parameter may include the block size, frame size, temporal layer, or quantization parameter of the current block.

[0198] For example, when the number of non-zero motion vector difference values ​​is 4, only 2 signs can be derived. Here, 2 may refer to at least two of the motion vector difference values ​​in the x-direction of the L0 direction, the x-direction of the L1 direction, the y-direction of the L0 direction, or the y-direction of the L1 direction. The signs of the remaining motion vector difference values, excluding k, can be determined by signaling / parsing.

[0199] For example, when the number of non-zero motion vector difference values ​​is 4, only one sign may be derived. Here, the one sign may represent the y-direction in the L1 direction. In this case, if the sum of the absolute values ​​of the non-zero motion vector difference values ​​is even, the derived sign may be positive, and if it is odd, it may be negative. Alternatively, the opposite case may be used.

[0200] For example, when there are two or more non-zero motion vector difference values ​​and both L0 and L1 directions exist, when deriving only the sign of some motion vector difference values, the sign of the motion vector difference value in the direction of the reference frame that is further or closer to the current frame and POC can be derived.

[0201] According to one embodiment of the present disclosure, if the prediction mode of the current block is a WARP mode, one of the modes for deriving WARP parameters can be determined. If it is a bidirectional prediction, a mode for determining how to perform a weighted sum on two prediction signals can be determined. In this case, it may be one of a wedge mode, a difference-based weighted prediction mode, etc.

[0202] Meanwhile, according to one embodiment of the present disclosure, the prediction mode of the current block may be determined as an intra-frame prediction mode. The inter-frame prediction mode may be determined as at least one of a plurality of intra-frame prediction modes. The plurality of intra-frame prediction modes may include a directional prediction mode, a Paeth mode, a DC mode, a Smooth mode, a Recursive prediction mode, or a prediction mode based on inter-component correlation. A prediction mode based on inter-component correlation may include, for example, CfL (Chroma from luma), CCLM (Cross-component linear model), MHCCP (Multi-hypothesis cross-component prediction), CCCM (Convolutional cross-component model), etc.

[0203] According to one embodiment of the present disclosure, when the prediction mode is determined to be an in-frame prediction mode, a geometric partition-based in-frame prediction mode may be selected. A final prediction block for the current block may be generated through a weighted sum operation of prediction blocks generated for each of a plurality of geometric partition blocks according to the geometric partition-based in-frame prediction mode. Here, the plurality of geometric partition blocks (also referred to as partitions or subblocks) may be regions obtained through geometric partitioning of the current block.

[0204] At this time, prediction blocks can be generated for geometric partitioning blocks using an in-frame prediction mode including different directional prediction modes, Paeth mode, DC mode, Smooth mode, etc.

[0205] According to one embodiment of the present disclosure, when the prediction mode is determined to be an in-frame prediction mode, a matrix-based in-frame prediction mode may be selected. The matrix-based in-frame prediction mode may be a mode that performs prediction by signaling / parsing the matrix index information or the matrix using a matrix that is predefined by an agreement between the encoding / decoding devices.

[0206] According to one embodiment of the present disclosure, when the prediction mode is determined to be an in-frame prediction mode, an in-frame template matching prediction mode may be selected. The in-frame template matching prediction mode may be a mode that defines a previously restored area around the current block as a template and generates a prediction block by performing template matching on the previously restored area around the current block. In this case, the template may include areas adjacent to or non-adjacent to the current block.

[0207] According to one embodiment of the present disclosure, when the prediction mode is determined to be an in-frame prediction mode, a previously restored area around the current block may be defined as a template, and the in-frame prediction mode may be derived using the said template. Subsequently, the final predicted block of the current block may be generated using the derived in-frame prediction mode. In this case, the template may include areas adjacent to or non-adjacent to the current block.

[0208] According to one embodiment of the present disclosure, the prediction mode of the current block may be determined to be an IBC mode. In the IBC mode, prediction can be performed using block vectors. Specifically, a prediction block may be generated in a previously restored area within the same frame as the current block using one or more block vectors, and a final prediction block may be generated based thereon. At this time, an encoding device may encode and signal block vector information, and a decoder may parse and obtain block vector information.

[0209] For example, in a decoding device, a block vector candidate list can be constructed according to a predefined position and search order between an encoding device and a decoding device, and information such as an index can be obtained by parsing. Alternatively, initial block vector information can be obtained, and final block vector information can be obtained by correcting the initial block vector information using methods such as template matching.

[0210] According to one embodiment of the present disclosure, when the prediction mode is determined to be an IBC mode, an IBC geometric partitioning-based prediction mode (Wedge mode) may be selected. Through the IBC geometric partitioning-based prediction mode (Wedge mode), a final prediction block for the current block can be generated by performing a weighted sum operation of prediction blocks generated for each of the plurality of geometric partitioning blocks. When an IBC prediction is performed for the current block, an IBC prediction may be performed for at least one of the plurality of geometric partitioning blocks within the current block.

[0211] According to one embodiment of the present disclosure, when the current block is a chrominance block and the prediction mode is determined to be an IBC mode, if the corresponding position luminance block of the chrominance block has already been restored during the process of constructing a block vector candidate list or acquiring a block vector, the block vector information of the corresponding position luminance block can be used.

[0212] For example, when the block partitioning structure of the luminance component and the chrominance component is the same, the block vector information of the corresponding position luminance block can be scaled according to the color format of the input image and used as the block vector and / or block vector candidate of the current chrominance block.

[0213] For example, when the block partitioning structures of the luminance component and the chrominance component are different from each other, one or more block vectors are obtained according to the position and / or order within the corresponding position luminance block that is predefined between the encoding device and the decoder, and the said block vectors are scaled according to the color format of the input image to be used as the block vector and / or block vector candidates of the current chrominance block.

[0214] According to one embodiment of the present disclosure, the block vector precision of the current block can be parsed in the form of index information, etc.

[0215] For example, a set of block vector precision candidates can be determined at a higher level (e.g., frame level). When the types of applicable precision are {8-pel, 4-pel, 1-pel, 1 / 2-pel, 1 / 4-pel, 1 / 8-pel}, the set can be defined as, as an example, {(4-pel, 1-pel, 1 / 2-pel, 1 / 8-pel), (8-pel, 4-pel, 1-pel, 1 / 4-pel)}. Or, it can be defined as {(4-pel, 1-pel), (8-pel, 1-pel)}.

[0216] According to an embodiment, if block vector difference values ​​are not parsed, block vector precision may be determined as a fixed value. For example, the fixed value may include 1-pel.

[0217] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0218] For example, after a precision set is determined at a higher level, a flag can be parsed to determine whether to use a fixed motion vector precision in units such as blocks. For example, if the flag is 1, 4-pel or 8-pel can be used as the precision depending on the set.

[0219] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0220] For example, if fixed motion vector precision is not used, any of the remaining precisions excluding the fixed precision in the set can be signaled / parsed as index information. According to an embodiment, any of the remaining precisions excluding the fixed precision can be signaled / parsed as index information in block units.

[0221] For example, block vector precision can only be in integer form. For example, {8-pel, 4-pel, 1-pel} can be used as block vector precision.

[0222] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0223] According to one embodiment of the present disclosure, a block vector candidate list including at least one block vector candidate may be configured.

[0224] A block vector candidate list can be constructed by searching only some of the locations in the aforementioned Fig. 4. Or / and candidates can be constructed from a filter bank that stores block vectors of blocks coded with the previous IBC. Up to N candidates can be constructed within the filter bank. For example, N can be 4. Candidates within the filter bank can be managed in a First-in-First-Out (FIFO) manner.

[0225] After constructing block vector candidates from the filter bank, if the maximum number is not reached, fixed block vector candidates can be constructed into a candidate list.

[0226] FIG. 5 is a drawing showing an example of a fixed block vector candidate according to the present disclosure.

[0227] Referring to FIG. 5, the fixed block vector candidates may include at least one of BV_A, BV_B, BV_C, or BV_D. The y-direction block vectors of BV_A and BV_B may be 0. The x-direction block vectors of BV_C and BV_D may be 0. BV_B and BV_C may be block vectors indicating the location closest to the boundary of the current CTU in the vertical and horizontal directions from the current block. BV_A may be a block vector pointing to the same location as the current block within the current CTU in the CTU two CTUs prior in z-scan order. BV_D may be a block vector pointing to the same location as the current block within the CTU above the current CTU.

[0228] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0229] Meanwhile, according to an embodiment, reference region information can be parsed at the frame level. Here, the reference region information may include information about the reference region referenced to construct a block vector candidate list. For example, the reference region information may include the current CTU, the CTU above the current CTU, the CTU two CTUs prior to the current CTU in z-scan order, etc.

[0230] For example, the process of constructing fixed block vector candidates may differ depending on whether the current block can be referenced only from CTUs adjacent to it, or from CTUs located beyond a certain range in coding order from the current block.

[0231] However, the embodiments disclosed above are merely examples and are not limited thereto.

[0232] According to one embodiment of the present disclosure, block vector candidates can be constructed, and an index can be parsed to determine a block vector predictor for the current block. Subsequently, if a block vector difference value exists, it can be parsed to generate a block vector. If a block vector difference value does not exist, the block vector predictor can be used as the block vector.

[0233] According to one embodiment of the present disclosure, if a block vector difference value exists, the block vector difference value may be obtained by table and index information based on an agreement between the decoding and encoding devices. Alternatively, the block vector difference value may be obtained through block vector difference information. Subsequently, depending on the conditions, the sign of the block vector difference value may be derived or signaled / parsed.

[0234] According to one embodiment of the present disclosure, whether to perform code derivation may be determined based on the block vector precision of the current block. For example, code derivation may be performed according to conditions when the block vector precision of the current block is below or less than a threshold precision. For example, when the available precision of the current block is {8-pel, 4-pel, 1-pel}, code derivation may be performed only for the case where it is 1-pel.

[0235] Critical precision can be defined by an agreement between the decoding and encoding devices, defined based on specific parameters, or signaled at a higher level. The specific parameters may include the block size, frame size, temporal layer, or quantization parameters of the current block.

[0236] According to one embodiment of the present disclosure, when signaling / parsing by encoding block vector difference values, the sign of the block vector difference values ​​can be derived.

[0237] For example, if only one of the two directions (x-direction and y-direction) has a block vector difference value that is not zero, the sign of the non-zero direction can be derived. According to an embodiment, if the magnitude of the block vector difference value in the non-zero direction is even, the sign can be derived as positive, and if the magnitude of the block vector difference value in the non-zero direction is odd, the sign can be derived as negative. Alternatively, the opposite case can be derived.

[0238] For example, if the block vector difference values ​​in both directions (x-direction and y-direction) are not both zero, the sign of the x-direction or y-direction can be derived.

[0239] For example, when deriving only the sign in the x-direction or y-direction, if the sum of the magnitudes of the block vector difference values ​​in the two directions is even, the sign in the deriving direction may be positive, and if the sum of the magnitudes of the block vector difference values ​​in the two directions is odd, the sign in the deriving direction may be negative. Alternatively, the opposite case may be used. In this case, the sign of the block vector difference value in the other direction can be signaled / parsed.

[0240] For example, among two directions (x-direction and y-direction), a code in a fixed direction can be derived by agreement between the sub / decoding device, and / or a code in a direction adaptively determined based on at least one of the size of the current block, the aspect ratio, and the resolution of the frame can be derived.

[0241] For example, if the block vector difference values ​​in both directions (x-direction and y-direction) are not both zero, the signs of the x-direction and y-direction can be derived.

[0242] For example, the signs of the two directions can be determined based on the remainder obtained by adding the magnitudes of the block vector difference values ​​in two directions and dividing by 4. If the remainder is 0, the signs of the x-direction and y-direction can be determined as {+, +}. If the remainder is 1, the signs of the x-direction and y-direction can be determined as {-, +}. If the remainder is 2, the signs of the x-direction and y-direction can be determined as {+, -}. If the remainder is 3, the signs of the x-direction and y-direction can be determined as {-, -}. In this case, the sign representing each remainder value can be defined by an agreement between the decoding and encoding devices.

[0243] Referring to FIG. 3, a prediction block can be generated for the current block based on the motion vector (S320).

[0244] For the current block, any one of intra-frame prediction, inter-frame prediction, IBC prediction, etc., can be performed.

[0245] When cross-frame prediction is performed on the current block, motion compensation can be performed using the motion information of the current block. Specifically, a prediction block can be generated from a reference frame through motion compensation using the motion information.

[0246] When IBC prediction is performed on the current block, the prediction can be performed using the block vector of the current block. Specifically, using one or more block vectors, a prediction block can be generated from a previously restored area within the same frame as the current block, and a final prediction block can be generated based on this.

[0247] Referring to FIG. 3, the current block can be restored based on the predicted block (S330).

[0248] Transformation coefficients for the current block can be derived based on residual information for the current block. Transformation coefficients for the current block can be restored by parsing residual information and performing entropy decoding.

[0249] Inverse quantization can be performed on the transform coefficients to derive the inverse quantized transform coefficients. At this time, information such as the quantization method and quantization parameter information can be signaled from the encoding device to the decoder.

[0250] A residual block can be derived by performing an inverse transform on the inverse quantized transform coefficients. A residual block may also be understood as a residual signal, residual block, residual signal, residual sample, etc.

[0251] According to one embodiment of the present disclosure, an inverse transformation unit (TU) for performing an inverse transformation may be determined. Here, the inverse transformation unit may refer to a unit that determines whether to perform an inverse transformation on a residual block and signals information regarding the inverse transformation to be decoded. Here, the transformation unit may be a single block or each sub-block formed by dividing the single block into multiple parts. Decoding may be performed by parsing division information including the division depth and division method of the current transformation unit.

[0252] According to one embodiment of the present disclosure, an inverse transform may be performed on an inverse transform unit based on a transform kernel. For example, the inverse transform may be performed on Nth order. Here, N may be an integer greater than or equal to 1. When the inverse transform is performed on Nth order, the size of the transform kernel applied to the inverse transform of each order may be the same for each order or different from one another. That is, the inverse transform may be performed only on some of the inverse quantized transform coefficients.

[0253] According to one embodiment of the present disclosure, at least one inverse transformation, either a separate inverse transformation or a non-separable inverse transformation, may be performed on the current block. For example, a separate inverse transformation may be performed, and if a non-separable transformation is performed during the encoding process, a non-separable inverse transformation may be additionally performed during the decoding process.

[0254] According to one embodiment of the present disclosure, a transformation kernel applied to the inverse transformation can be determined. For example, at least one transformation kernel may be determined for a single TU. The size of the transformation kernel and the size of the inverse transformation unit may be the same or different from each other.

[0255] According to one embodiment of the present disclosure, when a separate inverse transformation is performed, vertical and horizontal transformation kernels for the separate transformation may be determined. Additionally, when a non-separable inverse transformation is performed, a non-separable transformation kernel may be determined.

[0256] Meanwhile, according to one embodiment of the present disclosure, whether inseparable inverse transformation is performed can be determined at a higher level. That is, whether inseparable inverse transformation is performed during the decoding process can be determined at a higher level.

[0257] Meanwhile, according to one embodiment of the present disclosure, whether a non-separable inverse transformation is performed may be determined through signaling, or may be implicitly determined based on the size of the current TU, etc.

[0258] Meanwhile, multiple directional prediction modes may be used in the current TU prediction process. In this case, when a weighted sum of multiple directional prediction modes is performed, the prediction mode with the largest weight is determined as the representative direction of the current TU, and a transformation kernel can be determined using this.

[0259] According to one embodiment of the present disclosure, when a fusion prediction of inter-frame prediction and intra-frame prediction is performed during the prediction process of the current TU, a conversion kernel can be implicitly determined based on the intra-frame prediction mode. For example, based on the directionality of the intra-frame prediction mode, a kernel can be implicitly determined using kernel information defined according to directionality by an agreement between the encoding / decoding devices.

[0260] According to one embodiment of the present disclosure, when a geometric partition (Wedge)-based prediction is performed during the prediction process of the current TU, a transformation kernel can be implicitly determined based on geometric partition (Wedge) information. In this case, the transformation kernel can be implicitly determined based on the directionality of the geometric partition using only the geometric partition angle information included in the Wedge information.

[0261] The final restoration block for the current block can be generated by combining the restored residual block and the prediction block generated in S320.

[0262] FIG. 6 is a flowchart of an image encoding method according to the present disclosure. The image encoding method of the present disclosure may be understood as performing a process corresponding to or corresponding to the image decoding method described with reference to FIG. 3.

[0263] Referring to FIG. 6, prediction parameters such as the motion vector of the current block can be derived (S610).

[0264] According to one embodiment of the present disclosure, a prediction target block, i.e., a prediction unit, for performing a prediction can be determined. In the present disclosure, the prediction unit may correspond to the current block.

[0265] According to one embodiment of the present disclosure, the prediction unit may include size information and / or shape information for performing predictions for luminance components and color difference components.

[0266] According to one embodiment of the present disclosure, the prediction unit may be determined dependently or independently of the luminance component and the color difference component.

[0267] According to one embodiment of the present disclosure, an encoding device may encode information related to the size and / or shape of a determined current block and signal it to a decoder. Herein, the information related to the size and / or shape of the current block may include direct or indirect information necessary to determine the size of the current block.

[0268] Regarding the determination of the prediction unit, as discussed in reference to S310, a detailed explanation will be omitted here.

[0269] According to one embodiment of the present disclosure, a prediction mode for the current block can be determined. Specifically, the prediction mode may include an intra-frame prediction mode, an inter-frame prediction mode, an Intra Block Copy (IBC) mode, a palette mode, a mode combining intra-frame prediction and inter-frame prediction, etc. Accordingly, any one of intra-frame prediction, inter-frame prediction, prediction using IBC mode (IBC prediction), palette mode, or prediction using a mode combining intra-frame prediction and inter-frame prediction modes may be performed for the current block. In some cases, the prediction using a mode combining intra-frame prediction and inter-frame prediction modes may be included in the inter-frame prediction.

[0270] A specific prediction method can be determined based on the determined prediction mode. For example, the direction of intra-frame prediction, the number of reference pictures in inter-frame prediction, and the method for determining the pixel values ​​of reference blocks in inter-frame prediction can be determined.

[0271] Meanwhile, according to one embodiment of the present disclosure, if no in-frame prediction is performed on the current block, a 1-bit flag can be signaled for the current block.

[0272] If the value of the above flag indicates skip, the prediction mode of the current block can be determined as merge mode or IBC prediction merge mode. In this case, the transformation can be omitted, and the prediction sample can be used as the restoration sample.

[0273] According to one embodiment of the present disclosure, when skip prediction is not performed for the current block, a 1-bit flag may be signaled for the current block to determine the prediction mode for the current block. The prediction mode may include an intra-frame prediction mode, an inter-frame prediction mode, an IBC mode, a palette mode, etc.

[0274] When skip prediction is not performed for the current block and inter-frame prediction or IBC prediction is performed, a 1-bit flag is signaled to determine whether to perform prediction for the current block in merge mode or in AMVP (Advanced Motion Vector Prediction) mode.

[0275] According to one embodiment of the present disclosure, when the prediction mode of the current block is determined to be an inter-frame prediction mode, the number of reference frames and the reference frame index to be used by the current block can be determined.

[0276] Regarding the determination of the number of reference frames and the reference frame index of the current block, as examined by referring to S310, a detailed explanation will be omitted here.

[0277] According to one embodiment of the present disclosure, when the prediction mode of the current block is determined to be an inter-frame prediction mode, unidirectional motion or bidirectional motion information can be signaled. At this time, after defining a method for signaling / parsing motion information regarding unidirectional and bidirectional motion information as an agreement between the encoding / decoding devices, index information of the prediction mode and / or information related to the prediction mode can be signaled.

[0278] Regarding unidirectional or bidirectional motion information signaling / parsing, as discussed with reference to S310, a detailed explanation will be omitted here.

[0279] According to one embodiment of the present disclosure, a motion vector coding mode for each reference frame, that is, a method for signaling motion vectors, can be determined according to the prediction direction.

[0280] Regarding the signaling / parsing of motion vectors according to the motion vector coding mode, as examined with reference to S310, a detailed explanation will be omitted here.

[0281] According to one embodiment of the present disclosure, the motion vector precision of the current block can be signaled in the form of index information, etc.

[0282] Regarding the determination of motion vector precision, as discussed in reference to S310, a detailed explanation will be omitted here.

[0283] According to one embodiment of the present disclosure, when inter-frame prediction is performed for a current block, a prediction block can be generated from a reference frame through motion compensation using one or more motion information.

[0284] Specifically, a prediction block can be generated from a single reference frame through motion compensation using one piece of motion information. Alternatively, a prediction block can be generated by performing motion compensation from one or more reference frames using at least two pieces of motion information and summing them. The decoder may also derive and use all or part of other motion information using the first signaled motion information.

[0285] At this time, the motion information may include a motion vector and / or a motion vector difference value. The motion information may be derived through a candidate list containing a plurality of candidates. The plurality of candidates may include at least one of a motion vector, a reference picture index, etc. The motion vector difference value may be obtained through the motion vector difference information. Alternatively, the motion vector difference value may be obtained based on index information signaled from a bitstream and a predetermined table.

[0286] Meanwhile, spatially adjacent / non-adjacent blocks and / or temporally adjacent blocks can be searched to construct a list of motion vector candidates. For example, the search location and / or search order may be as described with reference to FIG. 4, and a detailed description is omitted to avoid duplication.

[0287] According to one embodiment of the present disclosure, if a motion vector difference value of the current block exists, the motion vector difference value can be signaled. At this time, the magnitude of the motion vector difference value can be signaled, and a sign can be signaled or derived. According to an embodiment, the motion vector difference value can be obtained based on index information signaled from a bitstream and a predetermined table. Alternatively, the motion vector difference value can be obtained through motion vector difference information.

[0288] Depending on the case, whether the motion vector difference value is obtained based on index information and a predetermined table or through motion vector difference information can be determined according to the motion vector coding mode.

[0289] As the method for acquiring motion vector difference values ​​has been examined with reference to S310, a detailed explanation will be omitted here.

[0290] According to one embodiment of the present disclosure, if a motion vector difference value of the current block exists, the magnitude and / or sign of the motion vector difference value may be signaled. In this case, depending on the case, at least one sign of two directions (x-direction and y-direction) may be derived and / or signaled and determined by a decoder.

[0291] According to one embodiment of the present disclosure, whether to induce a code can be determined based on the motion vector precision of the current block.

[0292] Regarding the determination of whether to derive a code based on motion vector precision, as discussed in reference to S310, a detailed explanation will be omitted here.

[0293] According to one embodiment of the present disclosure, when the current block is unidirectional prediction and signals / parses by encoding the motion vector difference value, the sign of the motion vector difference value can be derived.

[0294] Regarding the derivation of the sign of the motion vector difference value in the case of unidirectional prediction where the motion vector difference value is encoded and signaled, as examined with reference to S310, a detailed explanation will be omitted here.

[0295] According to one embodiment of the present disclosure, when the current block is bidirectional prediction and signals by encoding motion vector difference values, the sign of the motion vector difference values ​​can be derived. At this time, up to four signs of motion vector difference values ​​can be derived and / or signaled. All or some of the signs of non-zero motion vector difference values ​​can be derived.

[0296] Regarding the derivation of the sign of the motion vector difference value in the case of bidirectional prediction and signaling by encoding the motion vector difference value, as examined with reference to S310, a detailed explanation will be omitted here.

[0297] According to one embodiment of the present disclosure, if the prediction mode of the current block is a WARP mode, one of the modes for deriving WARP parameters can be determined.

[0298] Meanwhile, according to one embodiment of the present disclosure, the prediction mode may be determined as an in-frame prediction mode. As the in-frame prediction mode has been examined with reference to S310, a detailed description thereof will be omitted here.

[0299] Alternatively, the prediction mode can be determined as the IBC mode.

[0300] According to one embodiment of the present disclosure, when the prediction mode is determined to be an IBC mode, an IBC geometric partitioning-based prediction mode (Wedge mode) may be selected.

[0301] According to one embodiment of the present disclosure, when the current block is a chrominance block and the prediction mode is determined to be an IBC mode, if the corresponding position luminance block of the chrominance block has already been restored during the process of constructing a block vector candidate list or acquiring a block vector, the block vector information of the corresponding position luminance block can be used.

[0302] Regarding the configuration of the block vector candidate list and the acquisition of the block vector when the current block is a color difference block and the prediction mode is determined to be IBC mode, as this has been examined with reference to S310, a detailed explanation will be omitted here.

[0303] According to one embodiment of the present disclosure, the block vector precision of the current block can be parsed in the form of index information, etc.

[0304] Regarding the determination of block vector precision, as discussed in reference to S310, a detailed explanation will be omitted here.

[0305] A block vector candidate list can be constructed by searching only some of the locations in the aforementioned Fig. 4. Or / and candidates can be constructed from a filter bank that stores block vectors of blocks coded with the previous IBC.

[0306] Regarding the block vector candidate configuration, as examined with reference to S310, a detailed explanation will be omitted here.

[0307] According to one embodiment of the present disclosure, after configuring block vector candidates from a filter bank, if the maximum number is not reached, fixed block vector candidates can be configured as a candidate group. For example, fixed block vector candidates may be as illustrated in FIG. 5 above. Meanwhile, according to an embodiment, reference region information can be parsed at the frame level.

[0308] As for the fixed block vector candidate and / or reference region information, since this has been examined with reference to S310, a detailed explanation will be omitted here.

[0309] According to one embodiment of the present disclosure, whether to derive a code can be determined based on the block vector precision of the current block.

[0310] Regarding the determination of whether to derive a code based on block vector precision, as discussed in reference to S310, a detailed explanation will be omitted here.

[0311] Referring to FIG. 6, a prediction block for the current block can be generated based on the motion vector of the current block (S620).

[0312] For the current block, any one of intra-frame prediction, inter-frame prediction, IBC prediction, etc., can be performed.

[0313] When cross-frame prediction is performed on the current block, motion compensation can be performed using the motion information of the current block. Specifically, a prediction block can be generated from a reference frame through motion compensation using the motion information.

[0314] When IBC prediction is performed on the current block, the prediction can be performed using the block vector of the current block. Specifically, using one or more block vectors, a prediction block can be generated from a previously restored area within the same frame as the current block, and a final prediction block can be generated based on this.

[0315] Referring to FIG. 6, residual information for the current block can be encoded (S630).

[0316] According to one embodiment of the present disclosure, a residual block can be derived by calculating the difference between the actual pixel value of the current block and the pixel value of the predicted block generated in S620. A transformation coefficient for the current block can be derived by performing a transformation on the residual block.

[0317] According to one embodiment of the present disclosure, a transform unit (TU) for performing a transformation may be determined. Here, the transform unit may refer to a unit that determines whether to perform a transformation on a residual block and in which information regarding the transformation is encoded and signaled. Partition information including the depth and method of partitioning of the current transform unit may be encoded and signaled.

[0318] According to one embodiment of the present disclosure, a conversion can be performed on a conversion unit based on a conversion kernel.

[0319] According to one embodiment of the present disclosure, at least one conversion of a separable conversion or a non-separable conversion may be performed on the current block. For example, a separable conversion may be performed, and additionally, a non-separable conversion may be performed.

[0320] According to one embodiment of the present disclosure, a transformation kernel applied to a transformation may be determined. For example, at least one transformation kernel may be determined for a single TU. The size of the transformation kernel and the size of the transformation unit may be the same or different from each other. When a separate transformation is performed, vertical and horizontal transformation kernels for the separate transformation may be determined. Additionally, when a non-separable transformation is performed, a non-separable transformation kernel may be determined.

[0321] The transformation in the encoding process can be understood as the inverse process of the inverse transformation in the decoding process. As the inverse transformation has been examined by referring to S320, a detailed explanation will be omitted here to avoid redundancy.

[0322] Meanwhile, according to one embodiment of the present disclosure, quantized transform coefficients can be derived by performing quantization on the transform coefficients. At this time, the encoding device can signal information such as a quantization method and quantization parameter information to the decoder. Residual information can be encoded by performing entropy coding on the quantized transform coefficients.

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

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

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

[0326] The present invention can be used to encode / decode images.

Claims

1. A step of generating a prediction block for the current block based on the motion vector or block vector of the current block; A step of deriving a transformation coefficient for the current block based on residual information for the current block; A step of deriving inversely quantized transformation coefficients by performing inverse quantization on the above transformation coefficients; A step of deriving a residual block by performing a transformation on the above-mentioned inverse quantized transformation coefficients; and The method includes the step of restoring the current block from the above residual block, When the prediction block is generated based on the motion vector, the sign of the motion vector difference value corresponding to the motion vector is derived, and An image decoding method in which, when the prediction block is generated based on the block vector, the sign of the block vector difference value corresponding to the block vector is derived.

2. In Paragraph 1, A video decoding method in which the above motion vector difference value is obtained from motion vector difference information or based on index information signaled from a bitstream and a predetermined table.

3. In Paragraph 2, Motion vector coding modes include AMVD-based modes, but, A video decoding method in which, based on the above AMVD-based mode, it is determined whether the motion vector difference value is obtained from the motion vector difference information or obtained based on the index information and the predetermined table.

4. In Paragraph 1, An image decoding method in which the sign of the above motion vector difference value is derived for at least one of the x-direction motion vector difference value and the y-direction motion vector difference value.

5. In Paragraph 1, The sign of the above motion vector difference value is, It is determined that the sign of the motion vector difference value is derived based on whether the precision is below or less than a threshold value, and An image decoding method in which the above threshold includes 1-pel.

6. In Paragraph 1, For the above current block, unidirectional inter-frame prediction is performed, and if the magnitude of either the x-direction motion vector difference value or the y-direction motion vector difference value is not zero, only the sign of the non-zero motion vector difference value is derived, wherein An image decoding method that derives a negative sign for the induced direction when the magnitude of the above non-zero motion vector difference value is even, and derives a positive sign when the magnitude is odd.

7. In Paragraph 1, An image decoding method in which unidirectional inter-frame prediction is performed for the current block above, and when the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, the sign of the y-direction motion vector difference value is derived.

8. In Paragraph 1, If unidirectional inter-frame prediction is performed for the above current block and the magnitudes of the x-direction motion vector difference value and the y-direction motion vector difference value are not zero, Based on the fact that the sum of the magnitude of the x-direction motion vector difference value and the magnitude of the y-direction motion vector difference value is even, the sign of the induced direction is determined to be positive, and An image decoding method in which the sign for the induced direction is determined to be negative based on the fact that the sum of the magnitude of the x-direction motion vector difference value and the magnitude of the y-direction motion vector difference value is odd.

9. In Paragraph 1, A video decoding method in which, when bidirectional inter-frame prediction is performed for the current block, a code is derived for all or part of the x-direction motion vector difference value in the L0 direction, the y-direction motion vector difference value in the L0 direction, the x-direction motion vector difference value in the L1 direction, and the y-direction motion vector difference value in the L1 direction.

10. In Paragraph 9, An image decoding method in which a sign is derived only for the y-direction motion vector difference value in the L1 direction.

11. In Paragraph 9, If the sum of the absolute values ​​of the non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is even, the sign of the induced direction is determined to be positive, and A video decoding method in which the sign of the induced direction is determined to be negative when the sum of the absolute values ​​of non-zero motion vector difference values ​​among the x-direction motion vector difference value of the L0 direction, the y-direction motion vector difference value of the L0 direction, the x-direction motion vector difference value of the L1 direction, and the y-direction motion vector difference value of the L1 direction is odd.

12. In Paragraph 1, A candidate set of block vector precision is determined at the frame level, but, An image decoding method in which the block vector precision candidate set for the current block is determined to be either a first candidate set consisting only of integer pixel precision or a second candidate set including integer pixel precision and sub-pixel precision.

13. A step of generating a prediction block for the current block based on the motion vector or block vector of the current block; A step of deriving a residual block for the current block based on the above prediction block; A step of performing a transformation based on the above residual block to derive a transformation coefficient for the above current block; A step of deriving quantized transformation coefficients by performing quantization on the above transformation coefficients; and The method includes the step of encoding residual information regarding the above-mentioned quantized transformation coefficients, When the prediction block is generated based on the motion vector, the sign of the motion vector difference value corresponding to the motion vector is derived, and An image encoding method in which, when the prediction block is generated based on the block vector, the sign of the block vector difference value corresponding to the block vector is derived.

14. A non-transient digital storage medium for storing a bitstream generated by the image encoding method of claim 13.

15. A transmission method for transmitting a bitstream generated by the image encoding method of claim 13.