SYNTAX DESIGN METHOD AND APPARATUS FOR PERFORMING CODING USING SYNTAX

MX434356BActive Publication Date: 2026-05-19LG ELECTRONICS INC

Patent Information

Authority / Receiving Office
MX · MX
Patent Type
Patents
Current Assignee / Owner
LG ELECTRONICS INC
Filing Date
2021-04-07
Publication Date
2026-05-19

Smart Images

  • Figure MX434356B0
    Figure MX434356B0
Patent Text Reader

Abstract

An image decoding method performed by a decoding apparatus according to the present disclosure comprises the steps of: decoding, on the basis of a bitstream, an affine flag that indicates whether affine prediction is applicable to a current block and a sub-block TMVP flag that indicates whether a temporal motion vector predictor based on a sub-block of the current block is usable; determining whether to decode a predetermined merge mode flag that indicates whether to apply a predetermined merge mode to the current block, on the basis of the decoded affine flag and the decoded sub-block TMVP flag; deriving prediction samples of the current block on the basis of the determining of whether to decode the predetermined merge mode flag; and generating reconstructed samples of the current block based on the prediction samples of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Syntax design method and device for performing coding using syntax

[0001] The present disclosure relates to video coding technology, and more particularly, to a syntax design method and a device for performing coding using syntax in a video coding system.

[0002] Demand for high-resolution, high-quality video, such as 4K or 8K Ultra High Definition (UHD) video, is growing across a variety of fields. As video data becomes higher-resolution and higher-quality, the amount of information or bits transmitted increases relative to conventional video data. Therefore, when transmitting video data using existing media, such as wired or wireless broadband lines, or storing video data using existing storage media, transmission and storage costs increase.

[0003] In addition, interest in and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms have been increasing recently, and broadcasting of images / videos with different image characteristics from reality images, such as game images, is increasing.

[0004] Accordingly, a highly efficient image / video compression technology is required to effectively compress, transmit, store, and play high-resolution, high-quality image / video information having various characteristics as described above.

[0005] The technical problem of the present disclosure is to provide a method and device for improving image coding efficiency.

[0006] Another technical problem of the present disclosure is to provide a syntax design method and a device for performing coding using syntax.

[0007] Another technical challenge of the present disclosure is to provide a high-level syntax and low-level syntax design method and a device for performing coding using the syntax.

[0008] Another technical object of the present disclosure is to provide a method and device using high-level and / or low-level syntax elements for performing motion prediction based on sub-blocks.

[0009] Another technical object of the present disclosure is to provide a method and device using high-level and / or low-level syntax elements for performing motion prediction based on an affine model.

[0010] Another technical problem of the present disclosure is to provide a method and device for determining whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to a current block based on an affine flag and a sub-block TMVP flag.

[0011] According to one embodiment of the present disclosure, a video decoding method performed by a decoding device is provided. The method comprises the steps of: decoding, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used; determining, based on the decoded affine flag and the decoded sub-block TMVP flag, whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block; deriving prediction samples for the current block based on the determination of whether to decode the predetermined merge mode flag; and generating reconstruction samples for the current block based on the prediction samples for the current block, wherein when a value of the affine flag is 1 or a value of the sub-block TMVP flag is 1, it is determined to decode the predetermined merge mode flag.

[0012] According to another embodiment of the present disclosure, a decoding device for performing image decoding is provided. The decoding device includes an entropy decoding unit that decodes, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used, and determines, based on the decoded affine flag and the decoded sub-block TMVP flag, whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block, a prediction unit that derives prediction samples for the current block based on the determination of whether to decode the predetermined merge mode flag, and an adding unit that generates reconstruction samples for the current block based on the prediction samples for the current block, wherein when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, it is determined to decode the predetermined merge mode flag.

[0013] According to another embodiment of the present disclosure, a video encoding method performed by an encoding device is provided. The method comprises the steps of: determining whether affine prediction can be applied to a current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used; determining, based on the determination of whether affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used, whether to encode a predetermined merge mode flag indicating whether a predetermined merge mode is to be applied to the current block; and encoding, based on the determination of whether to encode the predetermined merge mode flag, an affine flag indicating whether affine prediction can be applied to the current block, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the predetermined merge mode flag, wherein when a value of the affine flag is 1 or a value of the sub-block TMVP flag is 1, it is determined to encode the predetermined merge mode flag.

[0014] According to another embodiment of the present disclosure, an encoding device for performing image encoding is provided. The encoding device comprises: a prediction unit which determines whether affine prediction can be applied to a current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used; and, based on the determination of whether affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used, determines whether to encode a predetermined merge mode flag indicating whether a predetermined merge mode is to be applied to the current block; and an entropy encoding unit which encodes, based on the determination of whether to encode the predetermined merge mode flag, an affine flag indicating whether affine prediction can be applied to the current block, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the predetermined merge mode flag, wherein when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, it is determined to encode the predetermined merge mode flag.

[0015] According to another embodiment of the present disclosure, a decoder-readable storage medium is provided, storing information about instructions that cause a video decoding device to perform decoding methods according to some embodiments.

[0016] According to another embodiment of the present disclosure, a decoder-readable storage medium is provided, storing information about instructions that cause a video decoding device to perform a decoding method according to one embodiment. The decoding method according to the above embodiment comprises the steps of: decoding, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used; determining, based on the decoded affine flag and the decoded sub-block TMVP flag, whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block; deriving prediction samples for the current block based on the determination of whether to decode the predetermined merge mode flag; and generating reconstruction samples for the current block based on the prediction samples for the current block, wherein when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, it is determined to decode the predetermined merge mode flag.

[0017] According to the present disclosure, the overall image / video compression efficiency can be improved.

[0018] According to the present disclosure, video coding efficiency can be improved through high-level syntax and low-level syntax design.

[0019] According to the present disclosure, image coding efficiency can be improved by utilizing high-level and / or low-level syntax elements for performing motion prediction based on sub-blocks.

[0020] According to the present disclosure, image coding efficiency can be improved by utilizing high-level and / or low-level syntax elements for performing motion prediction based on an affine model.

[0021] According to the present disclosure, video coding efficiency can be improved by determining whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to a current block based on an affine flag and a sub-block TMVP flag.

[0022] Figure 1 schematically illustrates an example of a video / image coding system to which the present disclosure can be applied.

[0023] FIG. 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which the present disclosure can be applied.

[0024] FIG. 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which the present disclosure can be applied.

[0025] FIG. 4 is a flowchart illustrating the operation of an encoding device according to one embodiment.

[0026] Fig. 5 is a block diagram illustrating the configuration of an encoding device according to one embodiment.

[0027] Figure 6 is a flowchart illustrating the operation of a decoding device according to one embodiment.

[0028] FIG. 7 is a block diagram illustrating a configuration of a decoding device according to one embodiment.

[0029] Figure 8 illustrates an example of a content streaming system to which the disclosure of this document can be applied.

[0030] According to one embodiment of the present disclosure, a video decoding method performed by a decoding device is provided. The method comprises the steps of: decoding, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used; determining, based on the decoded affine flag and the decoded sub-block TMVP flag, whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block; deriving prediction samples for the current block based on the determination of whether to decode the predetermined merge mode flag; and generating reconstruction samples for the current block based on the prediction samples for the current block, wherein when a value of the affine flag is 1 or a value of the sub-block TMVP flag is 1, it is determined to decode the predetermined merge mode flag.

[0031] The present disclosure may have various modifications and embodiments, and thus specific embodiments will be illustrated and described in detail in the drawings. However, this is not intended to limit the present disclosure to specific embodiments. The terminology used herein is only used to describe specific embodiments and is not intended to limit the technical spirit of the present disclosure. The singular expression includes plural expressions unless the context clearly indicates otherwise. It should be understood that the terms "comprises" or "has" in this specification are intended to specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0032] Meanwhile, each component in the drawings described in this disclosure is depicted independently for the convenience of explaining different characteristic functions. This does not imply that each component is implemented with separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of this disclosure, as long as they do not deviate from the essence of this disclosure.

[0033] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the attached drawings. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components may be omitted.

[0034] Figure 1 schematically illustrates an example of a video / image coding system to which the present disclosure can be applied.

[0035] Referring to FIG. 1, a video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.

[0036] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may be configured as a separate device or an external component.

[0037] A video source may obtain video / images through a process of capturing, synthesizing, or generating video / images. The video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process of generating related data.

[0038] An encoding device can encode input video / images. The encoding device can perform a series of procedures, such as prediction, transformation, and quantization, to improve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0039] The transmission unit can transmit encoded video / image information or data output in the form of a bitstream to the receiving unit of a receiving device via a digital storage medium or network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmission unit can include an element for generating a media file via a predetermined file format and an element for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.

[0040] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device.

[0041] The renderer can render decoded video / images. The rendered video / images can be displayed through the display unit.

[0042] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the VVC (versatile video coding) standard, the EVC (essential video coding) standard, the AV1 (AOMedia Video 1) standard, the AVS2 (2nd generation of audio video coding standard), or the next generation video / image coding standard (e.g., H.267 or H.268).

[0043] This document presents various embodiments of video / image coding, and unless otherwise stated, the embodiments may be performed in combination with each other.

[0044] In this document, a video may refer to a set of images over time. A picture generally refers to a unit representing one image at a specific time point, and a slice / tile is a unit that constitutes a part of a picture in coding. A slice / tile may include one or more CTUs (coding tree units). A picture may be composed of one or more slices / tiles. A picture may be composed of one or more tile groups. A tile group may include one or more tiles. A brick may represent a rectangular region of CTU rows within a tile in a picture. A tile may be partitioned into multiple bricks, each of which consisting of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick.A brick scan may represent a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in a CTU raster scan in a brick, bricks within a tile are ordered consecutively in a raster scan of the bricks of the tile, and tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture. The tile column is a rectangular region of CTUs having a height equal to the height of the picture and a width specified by syntax elements in the picture parameter set.The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture. A tile scan may represent a specific sequential ordering of CTUs partitioning a picture, wherein the CTUs are ordered consecutively in a CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A slice includes an integer number of bricks of a picture that may be exclusively contained in a single NAL unit.A slice may consist of either a number of complete tiles or only a consecutive sequence of complete bricks of one tile. In this document, the terms tile group and slice may be used interchangeably. For example, in this document, the terms tile group / tile group header may be referred to as slice / slice header.

[0045] A pixel or pel can refer to the smallest unit that constitutes a picture (or image). Additionally, the term "sample" can be used as a counterpart to a pixel. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luma component, or only the pixel / pixel value of the chroma component.

[0046] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may include a set (or array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.

[0047] In this document, " / " and "," are interpreted as "and / or." For example, "A / B" is interpreted as "A and / or B," and "A, B" is interpreted as "A and / or B." Additionally, "A / B / C" means "at least one of A, B, and / or C." Also, "A, B, C" means "at least one of A, B, and / or C." (In this document, the terms " / " and "," should be interpreted to indicate "and / or." For instance, the expression "A / B" may mean "A and / or B." Further, "A, B" may mean "A and / or B." Further, "A / B / C" may mean "at least one of A, B, and / or C." Also, "A / B / C" may mean "at least one of A, B, and / or C.")

[0048] Additionally, in this document, "or" is interpreted as "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) both "A and B." In other words, "or" in this document can mean "additionally or alternatively." (Furthermore, in the document, the term "or" should be interpreted to indicate "and / or." For instance, the expression "A or B" may comprise 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively.")

[0049] FIG. 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which the present disclosure can be applied. Hereinafter, the term "video encoding device" may include an image encoding device.

[0050] Referring to FIG. 2, the encoding device (200) may be configured to include an image partitioner (210), a prediction unit (predictor) 220, a residual processor (residual processor) 230, an entropy encoder (entropy encoder) 240, an adder (adder) 250, a filter (filter) 260, and a memory (memory) 270. The prediction unit (220) may include an inter prediction unit (221) and an intra prediction unit (222). The residual processor (230) may include a transformer (transformer) 232, a quantizer (quantizer) 233, a dequantizer (dequantizer) 234, and an inverse transformer (inverse transformer) 235. The residual processing unit (230) may further include a subtractor (231). The addition unit (250) may be called a reconstructor or a recontructed block generator. The image segmentation unit (210), the prediction unit (220), the residual processing unit (230), the entropy encoding unit (240), the addition unit (250), and the filtering unit (260) described above may be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory (270) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (270) as an internal / external component.

[0051] The image segmentation unit (210) can segment an input image (or picture, frame) input to the encoding device (200) into one or more processing units. For example, the processing units may be referred to as coding units (CUs). In this case, the coding units may be recursively segmented from a coding tree unit (CTU) or a largest coding unit (LCU) according to a Quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be segmented into a plurality of coding units of deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the ternary structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present disclosure may be performed based on the final coding unit that is no longer segmented. In this case, based on coding efficiency according to image characteristics, etc., the maximum coding unit can be used as the final coding unit, or, if necessary, the coding unit can be recursively divided into coding units of lower depths, and the coding unit of the optimal size can be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration described below. As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may each be divided or partitioned from the final coding unit described above.The above prediction unit may be a unit of sample prediction, and the above transformation unit may be a unit for deriving a transformation coefficient and / or a unit for deriving a residual signal from a transformation coefficient.

[0052] The term "unit" may be used interchangeably with terms such as "block" or "area" depending on the case. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chroma component. A sample can be used as a term corresponding to a pixel or pel in a picture (or image).

[0053] The encoding device (200) can generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from an inter prediction unit (221) or an intra prediction unit (222) from an input video signal (original block, original sample array), and the generated residual signal is transmitted to a conversion unit (232). In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) within the encoder (200) may be called a subtraction unit (231). The prediction unit can perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit can determine whether intra prediction or inter prediction is applied on a current block or CU basis. The prediction unit can generate various information regarding prediction, such as prediction mode information, as described later in the description of each prediction mode, and transmit the information to the entropy encoding unit (240). The information regarding prediction can be encoded in the entropy encoding unit (240) and output in the form of a bitstream.

[0054] The intra prediction unit (222) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of detail in the prediction direction. However, this is merely an example, and a greater or lesser number of directional prediction modes may be used depending on the settings. The intra prediction unit (222) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0055] The inter prediction unit (221) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring block can include a spatial neighboring block existing in the current picture and a temporal neighboring block existing in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The above temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and the reference pictures including the temporal neighboring blocks may be called collocated pictures (colPic). For example, the inter prediction unit (221) may construct a motion information candidate list based on the neighboring blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit (221) may use the motion information of the neighboring blocks as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the motion vector prediction (MVP) mode, the motion vector of the surrounding blocks is used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.

[0056] The prediction unit (220) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, sample values ​​within a picture can be signaled based on information about the palette table and palette index.

[0057] The prediction signal generated through the above prediction unit (including the inter prediction unit (221) and / or the intra prediction unit (222)) can be used to generate a restored signal or a residual signal. The transform unit (232) can apply a transform technique to the residual signal to generate transform coefficients. For example, the transform technique can include at least one of a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Karhunen-Loeve Transform (KLT), a Graph-Based Transform (GBT), or a Conditionally Non-linear Transform (CNT). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on a prediction signal generated by using all previously reconstructed pixels. Additionally, the transformation process can be applied to blocks of pixels of equal size, either square or variable size, non-square.

[0058] The quantization unit (233) quantizes the transform coefficients and transmits them to the entropy encoding unit (240), and the entropy encoding unit (240) can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be called residual information. The quantization unit (233) can rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and can also generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit (240) can perform various encoding methods, such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit (240) may encode, together or separately, information necessary for video / image restoration (e.g., values ​​of syntax elements, etc.) in addition to the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. In this document, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded through the above-described encoding procedure and included in the bitstream.The above bitstream may be transmitted through a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The signal output from the entropy encoding unit (240) may be configured as an internal / external element of the encoding device (200) by a transmitting unit (not shown) and / or a storing unit (not shown), or the transmitting unit may be included in the entropy encoding unit (240).

[0059] The quantized transform coefficients output from the quantization unit (233) can be used to generate a prediction signal. For example, by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit (234) and the inverse transform unit (235), a residual signal (residual block or residual samples) can be reconstructed. The addition unit (155) can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit (221) or the intra prediction unit (222). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as a reconstructed block. The addition unit (250) may be called a reconstructor or a reconstructed block generation unit. The generated restoration signal can be used for intra prediction of the next processing target block within the current picture, and can also be used for inter prediction of the next picture after filtering as described below.

[0060] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture encoding and / or restoration process.

[0061] The filtering unit (260) can improve subjective / objective picture quality by applying filtering to the restoration signal. For example, the filtering unit (260) can apply various filtering methods to the restoration picture to generate a modified restoration picture, and store the modified restoration picture in the memory (270), specifically, in the DPB of the memory (270). The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filtering unit (260) can generate various information regarding filtering and transmit the information to the entropy encoding unit (240), as described later in the description of each filtering method. The information regarding filtering may be encoded by the entropy encoding unit (240) and output in the form of a bitstream.

[0062] The modified restored picture transmitted to the memory (270) can be used as a reference picture in the inter prediction unit (221). Through this, when inter prediction is applied, the encoding device can avoid prediction mismatch between the encoding device (100) and the decoding device, and can also improve encoding efficiency.

[0063] The memory (270) DPB can store the modified restored picture to be used as a reference picture in the inter prediction unit (221). The memory (270) can store motion information of a block from which motion information is derived (or encoded) within the current picture and / or motion information of blocks within a picture that has already been restored. The stored motion information can be transferred to the inter prediction unit (221) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (270) can store restored samples of restored blocks within the current picture and transfer them to the intra prediction unit (222).

[0064] FIG. 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which the present disclosure can be applied.

[0065] Referring to FIG. 3, the decoding device (300) may be configured to include an entropy decoder (310), a residual processor (320), a predictor (330), an adder (340), a filter (350), and a memory (360). The predictor (330) may include an inter-prediction unit (331) and an intra-prediction unit (332). The residual processor (320) may include a dequantizer (321) and an inverse transformer (321). The entropy decoding unit (310), residual processing unit (320), prediction unit (330), addition unit (340), and filtering unit (350) described above may be configured by a single hardware component (e.g., decoder chipset or processor) depending on the embodiment. In addition, the memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (360) as an internal / external component.

[0066] When a bitstream including video / image information is input, the decoding device (300) can restore the image corresponding to the process in which the video / image information is processed in the encoding device of FIG. 3. For example, the decoding device (300) can derive units / blocks based on block division-related information obtained from the bitstream. The decoding device (300) can perform decoding using a processing unit applied in the encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Then, the restored image signal decoded and output by the decoding device (300) can be reproduced through a reproduction device.

[0067] The decoding device (300) can receive a signal output from the encoding device of FIG. 3 in the form of a bitstream, and the received signal can be decoded through the entropy decoding unit (310). For example, the entropy decoding unit (310) can parse the bitstream to derive information (e.g., video / image information) necessary for image restoration (or picture restoration). The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding device can decode the picture further based on the information on the parameter set and / or the general constraint information. The signaling / received information and / or syntax elements described later in this document can be obtained from the bitstream by being decoded through the decoding procedure. For example, the entropy decoding unit (310) can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of syntax elements required for image restoration and the quantized values ​​of transform coefficients for residuals. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information of a syntax element to be decoded and decoding information of surrounding and decoding target blocks or information of symbols / bins decoded in the previous step, and predicts the occurrence probability of a bin according to the determined context model to perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element.At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Information regarding prediction among the information decoded by the entropy decoding unit (310) is provided to the prediction unit (inter prediction unit (332) and intra prediction unit (331)), and residual values ​​on which entropy decoding is performed by the entropy decoding unit (310), i.e., quantized transform coefficients and related parameter information, can be input to the residual processing unit (320). The residual processing unit (320) can derive a residual signal (residual block, residual samples, residual sample array). In addition, information regarding filtering among the information decoded by the entropy decoding unit (310) can be provided to the filtering unit (350). Meanwhile, a receiving unit (not shown) that receives a signal output from an encoding device may be further configured as an internal / external element of the decoding device (300), or the receiving unit may be a component of an entropy decoding unit (310). Meanwhile, the decoding device according to the present document may be called a video / video / picture decoding device, and the decoding device may be divided into an information decoder (video / video / picture information decoder) and a sample decoder (video / video / picture sample decoder). The information decoder may include the entropy decoding unit (310), and the sample decoder may include at least one of the inverse quantization unit (321), the inverse transformation unit (322), the addition unit (340), the filtering unit (350), the memory (360), the inter prediction unit (332), and the intra prediction unit (331).

[0068] The inverse quantization unit (321) can inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit (321) can rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement can be performed based on the coefficient scanning order performed in the encoding device. The inverse quantization unit (321) can perform inverse quantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain transform coefficients.

[0069] In the inverse transform unit (322), the transform coefficients are inversely transformed to obtain a residual signal (residual block, residual sample array).

[0070] The prediction unit can perform a prediction on the current block and generate a predicted block containing prediction samples for the current block. Based on the information regarding the prediction output from the entropy decoding unit (310), the prediction unit can determine whether intra-prediction or inter-prediction is applied to the current block, and can determine a specific intra / inter-prediction mode.

[0071] The prediction unit (320) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, information about the palette table and palette index may be signaled and included in the video / image information.

[0072] The intra prediction unit (331) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it, depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The intra prediction unit (331) can also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0073] The inter prediction unit (332) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter prediction unit (332) can construct a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter prediction can be performed based on various prediction modes, and the information about the prediction can include information indicating the mode of inter prediction for the current block.

[0074] The addition unit (340) can generate a restoration signal (restored picture, restoration block, restoration sample array) by adding the acquired residual signal to the prediction signal (predicted block, prediction sample array) output from the prediction unit (including the inter-prediction unit (332) and / or intra-prediction unit (331)). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as the restoration block.

[0075] The addition unit (340) may be referred to as a restoration unit or restoration block generation unit. The generated restoration signal may be used for intra prediction of the next processing target block within the current picture, may be output after filtering as described below, or may be used for inter prediction of the next picture.

[0076] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.

[0077] The filtering unit (350) can improve subjective / objective image quality by applying filtering to the restored signal. For example, the filtering unit (350) can apply various filtering methods to the restored picture to generate a modified restored picture, and transmit the modified restored picture to the memory (360), specifically, to the DPB of the memory (360). The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0078] The (modified) reconstructed picture stored in the DPB of the memory (360) can be used as a reference picture in the inter prediction unit (332). The memory (360) can store motion information of a block from which motion information is derived (or decoded) within the current picture and / or motion information of blocks within a picture that has already been reconstructed. The stored motion information can be transferred to the inter prediction unit (260) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (360) can store reconstructed samples of reconstructed blocks within the current picture and transfer them to the intra prediction unit (331).

[0079] In this specification, the embodiments described in the filtering unit (260), the inter prediction unit (221), and the intra prediction unit (222) of the encoding device (100) can be applied to the filtering unit (350), the inter prediction unit (332), and the intra prediction unit (331) of the decoding device (300) in the same or corresponding manner, respectively.

[0080] As described above, prediction is performed to increase compression efficiency when performing video coding. Through this, a predicted block including prediction samples for a current block, which is a coding target block, can be generated. Here, the predicted block includes prediction samples in a spatial domain (or pixel domain). The predicted block is derived identically from an encoding device and a decoding device, and the encoding device can increase video coding efficiency by signaling information (residual information) about the residual between the original block and the predicted block, rather than the original sample value of the original block itself, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, and generate a reconstructed block including reconstructed samples by combining the residual block and the predicted block, and can generate a reconstructed picture including the reconstructed blocks.

[0081] The residual information may be generated through a transformation and quantization procedure. For example, the encoding device may derive a residual block between the original block and the predicted block, perform a transformation procedure on residual samples (a residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, thereby signaling the related residual information to a decoding device (via a bitstream). Here, the residual information may include information such as value information, position information, a transformation technique, a transformation kernel, and quantization parameters of the quantized transform coefficients. The decoding device may perform an inverse quantization / inverse transformation procedure based on the residual information to derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device can also inversely quantize / inversely transform the quantized transform coefficients to derive a residual block for reference in inter prediction of a subsequent picture, and generate a restored picture based on the residual block.

[0082] In one embodiment, a sub-block TMVP flag may be used to indicate whether a temporal motion vector predictor based on a sub-block is available to control sub-block-based motion prediction. The sub-block TMVP flag may be signaled at the SPS (Sequence Parameter Set) level and may control on / off of sub-block-based motion prediction. The sub-block TMVP flag may be referred to as sps_sbtmvp_enabled_flag, for example, as shown in Table 1 below.

[0083] Additionally, in order to control the affine motion prediction method, an affine flag may be used to indicate whether affine prediction can be applied to the current block. The affine flag may be signaled at the SPS level and may control the on / off of affine prediction. The affine flag may be referred to as sps_affine_enabled_flag, for example, as shown in Table 1 below. When the value of the affine flag is 1, an affine type flag may be additionally signaled to additionally determine whether to use 6-parameter affine prediction.

[0084] An example of the syntax signaled at the SPS level is shown in Table 1 below.

[0085] seq_parameter_set_rbsp( ) {Descriptorsps_seq_parameter_set_idue(v)chroma_format_idcue(v)if( chroma_format_idc = = 3 )separate_colour_plane_flagu(1)pic_width_in_luma_samplesue(v)pic_height_in_luma_samplesue(v)bit_depth_luma_minus8ue(v)bit_depth_chroma_minus8ue(v)qtbtt_dual_tree_intra_flague(v)log2_ctu_size_minus2ue(v)log2_min_qt_size_intra_slices_minus2ue(v)log2_min_qt_size_inter_slices_minus2ue(v)max_mtt_hierarchy_depth_inter_slicesue(v)max_mtt_hierarchy_depth_intra_slicesue(v)sps_cclm_enabled_flagu(1)sps_alf_enabled_flagu(1)sps_temporal_mvp_enabled_flagu(1)if( sps_temporal_mvp_enabled_flag )sps_sbtmvp_enabled_flagu(1)if( sps_sbtmvp_enabled_flag )log2_sbtmvp_default_size_minus2u(1)sps_amvr_enabled_flagu(1)sps_affine_enabled_flagu(1)if( sps_affine_enabled_flag )sps_affine_type_flagu(1)sps_mts_intra_enabled_flagu(1)sps_mts_inter_enabled_flagu(1)rbsp_trailing_bits( )}

[0086] In one embodiment, in the low level coding syntax, as shown in Table 2 below, if the merge flag (merge_flag) of the current block (coding unit) is 1, and if the affine flag of the SPS is 1, a flag (e.g., a merge affine flag) may be signaled to indicate whether an affine merge or a normal merge is applied to the current block based on the conditions of the current block (e.g., block size, block shape, etc.). The merge affine flag may be represented by, for example, merge_affine_flag. In one example, if the value of the affine flag signaled at the SPS level is 0 and the value of the merge_flag signaled at the coding unit level is 1, it may be determined that a normal merge is applied to the current block without signaling any additional syntax elements.

[0087] An example of syntax signaled at the coding unit level is shown in Table 2 below.

[0088] coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {Descriptorif( slice_type != I ) {cu_skip_flag[ x0 ][ y0 ]ae(v)if( cu_skip_flag[ x0 ][ y0 ] = = 0 )pred_mode_flagae(v)}if( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) {if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {intra_luma_mpm_flag[ x0 ][ y0 ]ae(v)if( intra_luma_mpm_flag[ x0 ][ y0 ] )intra_luma_mpm_idx[ x0 ][ y0 ]ae(v)elseintra_luma_mpm_remainder[ x0 ][ y0 ]ae(v)}if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA )intra_chroma_pred_mode[ x0 ][ y0 ]ae(v)} else { / * MODE_INTER * / if( cu_skip_flag[ x0 ][ y0 ] ) {if( sps_affine_enabled_flag && cbWidth >= 8 && cbHeight >= 8 )merge_affine_flag[ x0 ][ y0 ]ae(v)if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ]ae(v)if( merge_affine_flag[ x0 ][ y0 ] = = 1 && MaxNumAffineMergeCand > 1 )merge_affine_idx[ x0 ][ y0 ]ae(v)} else {merge_flag[ x0 ][ y0 ]ae(v)if( merge_flag[ x0 ][ y0 ] ) {if( sps_affine_enabled_flag && cbWidth >= 8 &&cbHeight >= 8)merge_affine_flag[ x0 ][ y0 ]ae(v)if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 )merge_idx[ x0 ][ y0 ]ae(v)if( merge_affine_flag[ x0 ][ y0 ] = = 1 && MaxNumAffineMergeCand > 1 )merge_affine_idx[ x0 ][ y0 ]ae(v)} else {if( slice_type = = B )inter_pred_idc[ x0 ][ y0 ]ae(v)if( sps_affine_enabled_flag && cbWidth >= 16 && cbHeight >= 16 ) {inter_affine_flag[ x0 ][ y0 ]ae(v)if( sps_affine_type_flag && inter_affine_flag[ x0 ][ y0 ] )cu_affine_type_flag[ x0 ][ y0 ]ae(v)}if( inter_pred_idc[ x0 ][ y0 ] != PRED_L1 ) {if( num_ref_idx_l0_active_minus1 > 0 )ref_idx_l0[ x0 ][ y0 ]ae(v)mvd_coding( x0, y0, 0, 0 )if( MotionModelIdc[ x0 ][ y0 ] > 0 )mvd_coding( x0, y0, 0, 1 )if(MotionModelIdc[ x0 ][ y0 ] > 1 )mvd_coding( x0, y0, 0, 2 )mvp_l0_flag[ x0 ][ y0 ]ae(v)} else {MvdL0[ x0 ][ y0 ][ 0 ] = 0MvdL0[ x0 ][ y0 ][ 1 ] = 0}if( inter_pred_idc[ x0 ][ y0 ] != PRED_L0 ) {if( num_ref_idx_l1_active_minus1 > 0 )ref_idx_l1[ x0 ][ y0 ]ae(v)if( mvd_l1_zero_flag &&inter_pred_idc[ x0 ][ y0 ] = = PRED_BI ) {MvdL1[ x0 ][ y0 ][ 0 ] = 0MvdL1[ x0 ][ y0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 0 ][ 0 ] = 0MvdCpL1[ x0 ][ y0 ][ 0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 1 ][ 0 ] = 0MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 2 ][ 0 ] = 0MvdCpL1[ x0 ][ y0 ][ 2 ][ 1 ] = 0} else {mvd_coding( x0, y0, 1, 0 )if( MotionModelIdc[ x0 ][ y0 ] > 0 )mvd_coding( x0, y0, 1, 1 )if(MotionModelIdc[ x0 ][ y0 ] > 1 )mvd_coding( x0, y0, 1, 2 )mvp_l1_flag[ x0 ][ y0 ]ae(v)} else {MvdL1[ x0 ][ y0 ][ 0 ] = 0MvdL1[ x0 ][ y0 ][ 1 ] = 0}if( sps_amvr_enabled_flag && inter_affine_flag = = 0 && ( MvdL0[ x0 ][ y0 ][ 0 ] != 0 | | MvdL0[ x0 ][ y0 ][ 1 ] != 0 | | MvdL1[ x0 ][ y0 ][ 0 ] != 0 | | MvdL1[ x0 ][ y0 ][ 1 ] != 0 ) )amvr_mode[ x0 ][ y0 ]ae(v)}}}if( CuPredMode[ x0 ][ y0 ] != MODE_INTRA && cu_skip_flag[ x0 ][ y0 ] = = 0 )cu_cbfae(v)if( cu_cbf ) {transform_tree( x0, y0, cbWidth, cbHeight, treeType )}

[0089] Meanwhile, when the high-level syntax design of Table 1 and the low-level syntax design of Table 2 are applied, design problems, logical problems, and conceptual problems may arise if ATMVP is used as an affine merge candidate. For example, if the value of the affine flag signaled at the SPS level is 0 and the value of the sub-block TMVP flag signaled at the SPS level is 1, no ATMVP candidate may be used as a candidate even though the SPS signals the use of ATMVP. In addition to the design problems and logical problems mentioned above, conceptual problems may also exist. ATMVP is a motion prediction method based on a sub-block (in one example, SubPu). It is used as a candidate for an affine merge mode that performs prediction based on a sub-block in order to distinguish between motion prediction candidates based on a non-sub-block (in one example, non-SubPu) motion prediction in a normal merge and motion prediction candidates based on a sub-block, thereby distinguishing whether the merge of the current block is a sub-block merge or a non-sub-block merge. However, despite this purpose, the low-level syntax design according to Table 2 controls the sub-block ATMVP depending on whether an affine merge is used.

[0090] To address the above design, logical and conceptual issues, one embodiment may provide a high-level and / or low-level syntax design based on at least one of Tables 3 to 11 below.

[0091] In one embodiment, a flag for controlling sub-block-based motion prediction can be signaled at the SPS level. The flag for controlling the sub-block-based motion prediction can be represented, for example, as sps_subpumvp_enabled_flag, and can be used to determine whether the sub-block-based motion prediction is turned on or off. When the value of sps_subpumvp_enabled_flag is 1, affine_enabled_flag and sbtmvp_enabled_flag can be signaled as shown in Table 3 below.

[0092] seq_parameter_set_rbsp( ) {Descriptorsps_temporal_mvp_enabled_flagu(1)sps_subpumvp_enabled_flagu(1)if(sps_subpumvp_enabled_flag) {if( sps_temporal_mvp_enabled_flag )sps_sbtmvp_enabled_flagu(1)if( sps_sbtmvp_enabled_flag )log2_sbtmvp_default_size_minus2u(1)sps_affine_enabled_flagu(1)if( sps_affine_enabled_flag )sps_affine_type_flagu(1)}

[0093] When using the SPS level syntax design in Table 3, the availability of affine prediction and ATMVP can be expressed as in Table 4 below. In Table 4 below, 1 indicates that the method is available, and 0 indicates that the method is not available.

[0094] AffineATMVPOn / off011100

[0095] In one embodiment, a high-level syntax design may be provided to control the availability of both affine prediction and ATMVP based on sps_subpumvp_enabled_flag. According to this embodiment, in one example, if the value of sps_subpumvp_enabled_flag is 1, both affine prediction and ATMVP may be determined to be enabled. The high-level syntax design according to this embodiment may be as shown in Table 5 below.

[0096] seq_parameter_set_rbsp() {Descriptorsps_temporal_mvp_enabled_flagu(1)sps_subpumvp_enabled_flagu(1)if(sps_subpumvp_enabled_flag) {log2_sbtmvp_default_size_minus2u(1)sps_affine_type_flagu(1)}

[0097] In one embodiment, a method may be provided to control both affine prediction and availability of ATMVP based on sps_subpumvp_enabled_flag included in the high-level syntax according to Table 5 above, but also to control availability of ATMVP in detail for each slice by using slice_subpumvp_enabled_flag in the slice header syntax. The syntax at the slice header level according to this embodiment may be, for example, as shown in Table 6 below.

[0098] slice_header() {Descriptorif(sps_temporal_mvp_enabled_flag){slice_temporal_mvp_enabled_flagu(1)if(sps_subpumvp_enabled_flag)slice_subpumvp_enabled_flagu(1)}

[0099] In one embodiment, when the affine prediction method is not used and sps_sbtmvp_enabled_flag is 1, a method may be provided to signal merge_affine_flag but configure only ATMVP as a candidate without configuring an affine candidate. An example of low-level syntax for representing this embodiment may be as shown in Table 7 below.

[0100] coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {Descriptor......merge_flag[ sps_sbtmvp_enabled_flag)merge_affine_flag[ x0 ][ y0 ]ae(v)if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 )merge_idx[ MaxNumAffineMergeCand > 1 && (sps_affine_enabled_flag && cbWidth >= 8 && cbHeight >= 8) )merge_affine_idx[ x0 ][ y0 ]ae(v)}

[0101] In Table 7 above, if the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it can be determined by decoding the merge affine flag (merge_affine_flag) indicating whether the merge affine mode is applied.

[0102] In one example, if the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it may be determined by decoding the merge sub-block flag (merge_subblock_flag) indicating whether the merge sub-block mode is applied. In the merge sub-block mode, the merge candidate may be determined based on a sub-block unit.

[0103] In Table 7 above, if the width (cbWidth) and height (cbHeight) of the current block are each 8 or more and the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it can be determined that the merge affine flag (merge_affine_flag) is decoded.

[0104] In one example, if the maximum number of merge candidates of the sub-block of the current block is greater than 0, it may be determined by decoding the pre-determined merge mode flag.

[0105] In one example, when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the maximum number of merge candidates of the sub-block of the current block may be greater than 0.

[0106] In one example, whether to decode the above-determined merge mode flag may be determined based on whether if ( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 ) is satisfied. MaxNumSubblockMergeCand may represent the maximum number of merge candidates of the sub-block, cbWidth may represent the width of the current block, and cbHeight may represent the height of the current block.

[0107] In Table 7 above, if the value of sps_affine_enabled_flag is 0 and the value of sps_sbtmvp_enabled_flag is 1, merge_affine_idx is not signaled and can be inferred as 0. According to the embodiment of Table 7, the availability of affine prediction and ATMVP can be expressed as in Table 8 below.

[0108] AffineATMVPOn / off10110001

[0109] In one embodiment, a method may be provided for controlling the use of ATMVP as a normal merge candidate when the affine prediction method is not used and the value of sps_sbtmvp_enabled_flag is 1. According to this embodiment, the availability of affine prediction and ATMVP may be expressed as shown in Table 9 below.

[0110] AffineATMVPOn / off10110001 (for Normal Merge)

[0111] In one embodiment, a method may be provided for designing a high-level syntax to signal sps_sbtmvp_enabled_flag only when the value of affine_enabled_flag is 1. This may be in consideration of the structure of a low-level coding tool designed so that ATMVP cannot be used when the value of sps_affine_enabled_flag is 0 because ATMVP is used as an affine merge candidate. An example of a high-level syntax according to this embodiment is shown in Table 10 below.

[0112] seq_parameter_set_rbsp( ) {Descriptorsps_temporal_mvp_enabled_flagu(1)sps_affine_enabled_flagu(1)if( sps_affine_enabled_flag ) {sps_affine_type_flagu(1)if( sps_temporal_mvp_enabled_flag )sps_sbtmvp_enabled_flagu(1)if( sps_sbtmvp_enabled_flag )log2_sbtmvp_default_size_minus2u(1)}

[0113] When using the SPS level syntax design of Table 10 according to Table 10, the availability of affine prediction and ATMVP can be expressed as in Table 11 below.

[0114] AffineATMVPOn / off101100

[0115] FIG. 4 is a flowchart illustrating the operation of an encoding device according to one embodiment, and FIG. 5 is a block diagram illustrating the configuration of an encoding device according to one embodiment.

[0116] The encoding device according to FIGS. 4 and 5 can perform operations corresponding to the decoding device according to FIGS. 6 and 7. Accordingly, the operations of the decoding device described below in FIGS. 6 and 7 can also be applied to the encoding device according to FIGS. 4 and 5.

[0117] Each step disclosed in FIG. 4 may be performed by the encoding device (200) disclosed in FIG. 2. More specifically, S400 and S410 may be performed by the prediction unit (220) disclosed in FIG. 2, and S420 may be performed by the entropy encoding unit (240) disclosed in FIG. 2. In addition, the operations according to S400 to S420 are based on some of the contents described above in FIG. 3. Therefore, specific contents overlapping with the contents described above in FIGS. 2 and 3 will be omitted or simplified for brevity.

[0118] As illustrated in FIG. 5, an encoding device according to one embodiment may include a prediction unit (220) and an entropy encoding unit (240). However, in some cases, not all of the components illustrated in FIG. 5 may be essential components of the encoding device, and the encoding device may be implemented with more or fewer components than the components illustrated in FIG. 5.

[0119] In an encoding device according to one embodiment, the prediction unit (220) and the entropy encoding unit (240) may be implemented as separate chips, or at least two or more components may be implemented through one chip.

[0120] An encoding device according to one embodiment can determine whether affine prediction can be applied to a current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used (S400). More specifically, the prediction unit (220) of the encoding device can determine whether affine prediction can be applied to a current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used.

[0121] An encoding device according to one embodiment may determine whether to encode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the determination as to whether the affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used (S410). More specifically, a prediction unit (220) of the encoding device may determine whether to encode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the determination as to whether the affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used.

[0122] In one example, the predetermined merge mode may be a merge affine mode or a merge sub-block mode, and the predetermined merge mode flag may be a merge affine flag or a merge sub-block flag. The merge affine flag may be represented by merge_affine_flag, and the merge sub-block flag may be represented by merge_subblock_flag.

[0123] An encoding device according to one embodiment may encode an affine flag indicating whether the affine prediction can be applied to the current block, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the predetermined merge mode flag based on the determination as to whether to encode the predetermined merge mode flag (S420). More specifically, an entropy encoding unit (240) of the encoding device may encode an affine flag indicating whether the affine prediction can be applied to the current block, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the predetermined merge mode flag based on the determination as to whether to encode the predetermined merge mode flag.

[0124] In one embodiment, if the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, it may be determined to encode the pre-determined merge mode flag.

[0125] In one embodiment, if the width and height of the current block are each 8 or more and the value of the affine flag is 1, or if the value of the sub-block TMVP flag is 1, it may be determined to encode the predetermined merge mode flag.

[0126] In one embodiment, whether to encode the above-determined merge mode flag may be determined based on the following mathematical expression 1.

[0127] [Mathematical Formula 1]

[0128] if((sps_affine_enabled_flag && cbWidth >=8 && cbHeight >=8) || sps_sbtmvp_enabled_flag)

[0129] In the above mathematical expression 1, sps_affine_enabled_flag may represent the affine flag, cbWidth may represent the width of the current block, cbHeight may represent the height of the current block, and sps_sbtmvp_enabled_flag may represent the sub-block TMVP flag.

[0130] In one embodiment, the predetermined merge mode flag may be a merge affine flag indicating whether the affine merge mode is applied to the current block or a merge sub-block flag indicating whether the merge mode is applied to the sub-block unit of the current block.

[0131] In one embodiment, if the maximum number of merge candidates of the sub-block of the current block is greater than 0, it may be determined to encode the predetermined merge mode flag.

[0132] In one embodiment, when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the maximum number of merge candidates of the sub-block of the current block may be greater than 0.

[0133] In one embodiment, whether to encode the above-determined merge mode flag may be determined based on the following mathematical expression 2.

[0134] [Equation 2]

[0135] if ( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )

[0136] In the above mathematical expression 2, MaxNumSubblockMergeCand may represent the maximum number of merge candidates of the sub-block, cbWidth may represent the width of the current block, and cbHeight may represent the height of the current block.

[0137] According to the encoding device and the operating method of the encoding device of FIGS. 4 and 5, the encoding device determines whether affine prediction can be applied to a current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used (S400), and based on the determination of whether the affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used, determines whether to encode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block (S410), and based on the determination of whether to encode the predetermined merge mode flag, encodes an affine flag indicating whether the affine prediction can be applied to the current block, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the predetermined merge mode flag (S420), and when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the predetermined merge mode It can be characterized by being determined by encoding a flag. That is, based on the affine flag and the sub-block TMVP flag, the video coding efficiency can be improved by determining whether to decode the predetermined merge mode flag indicating whether to apply the predetermined merge mode to the current block.

[0138] FIG. 6 is a flowchart illustrating the operation of a decoding device according to one embodiment, and FIG. 7 is a block diagram illustrating the configuration of a decoding device according to one embodiment.

[0139] Each step disclosed in FIG. 6 may be performed by the decoding device (300) disclosed in FIG. 3. More specifically, S600 and S610 may be performed by the entropy decoding unit (310) disclosed in FIG. 3, S620 may be performed by the prediction unit (330) disclosed in FIG. 3, and S630 may be performed by the addition unit (340) disclosed in FIG. 3. In addition, the operations according to S600 to S630 are based on some of the contents described above in FIG. 3. Therefore, specific contents overlapping with the contents described above in FIG. 3 will be omitted or simplified for brevity.

[0140] As illustrated in FIG. 7, a decoding device according to one embodiment may include an entropy decoding unit (310), a prediction unit (330), and an addition unit (340). However, in some cases, not all of the components illustrated in FIG. 7 may be essential components of the decoding device, and the decoding device may be implemented with more or fewer components than the components illustrated in FIG. 7.

[0141] In a decoding device according to one embodiment, the entropy decoding unit (310), the prediction unit (330), and the addition unit (340) may each be implemented as separate chips, or at least two or more components may be implemented through one chip.

[0142] According to one embodiment, a decoding device can decode, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used (S600). More specifically, an entropy decoding unit (310) of the decoding device can decode, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used.

[0143] In one example, the affine flag may be represented as sps_affine_enabled_flag, and the sub-block TMVP flag may be represented as sps_sbtmvp_enabled_flag. The sub-block TMVP flag may also be referred to as a sub-PU TMVP flag in some cases.

[0144] In one example, the affine flag and the sub-block TMVP flag can be signaled at the SPS level.

[0145] According to one embodiment, a decoding device may determine whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the decoded affine flag and the decoded sub-block TMVP flag (S610). More specifically, an entropy decoding unit (310) of the decoding device may determine whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the decoded affine flag and the decoded sub-block TMVP flag.

[0146] In one example, the predetermined merge mode may be a merge affine mode or a merge sub-block mode, and the predetermined merge mode flag may be a merge affine flag or a merge sub-block flag. The merge affine flag may be represented by merge_affine_flag, and the merge sub-block flag may be represented by merge_subblock_flag.

[0147] According to one embodiment, a decoding device can derive prediction samples for the current block based on the determination as to whether to decode the predetermined merge mode flag (S620). More specifically, the prediction unit (330) of the decoding device can derive prediction samples for the current block based on the determination as to whether to decode the predetermined merge mode flag.

[0148] A decoding device according to one embodiment can derive a prediction mode to be applied to the current block based on the determination of whether to decode the pre-determined merge mode flag, and can derive prediction samples for the current block based on the derived prediction mode.

[0149] According to one embodiment, a decoding device can generate restoration samples for the current block based on the prediction samples for the current block (S630). More specifically, an adding unit (340) of the decoding device can generate restoration samples for the current block based on the prediction samples for the current block.

[0150] In one embodiment, if the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, it may be determined to decode the pre-determined merge mode flag.

[0151] In one example, if the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it may be determined by decoding the above-determined merge mode flag.

[0152] In another example, if the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it can be determined by decoding the merge affine flag (merge_affine_flag).

[0153] In another example, if the value of sps_affine_enabled_flag is 1 or the value of sps_sbtmvp_enabled_flag is 1, it can be determined by decoding the merge subblock flag (merge_subblock_flag).

[0154] In one embodiment, if the width and height of the current block are each 8 or more and the value of the affine flag is 1, or if the value of the sub-block TMVP flag is 1, it may be determined to decode the predetermined merge mode flag.

[0155] In one embodiment, whether to decode the above-determined merge mode flag may be determined based on the following mathematical expression 3.

[0156] [Equation 3]

[0157] if((sps_affine_enabled_flag && cbWidth >=8 && cbHeight >=8) || sps_sbtmvp_enabled_flag)

[0158] In the above mathematical expression 3, sps_affine_enabled_flag may represent the affine flag, cbWidth may represent the width of the current block, cbHeight may represent the height of the current block, and sps_sbtmvp_enabled_flag may represent the sub-block TMVP flag.

[0159] In one embodiment, if the maximum number of merge candidates of the sub-block of the current block is greater than 0, it may be determined by decoding the predetermined merge mode flag.

[0160] In one embodiment, when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the maximum number of merge candidates of the sub-block of the current block may be greater than 0.

[0161] In one embodiment, whether to decode the above-determined merge mode flag may be determined based on the following mathematical expression 4.

[0162] [Equation 4]

[0163] if ( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )

[0164] In the above mathematical expression 4, MaxNumSubblockMergeCand may represent the maximum number of merge candidates of the sub-block, cbWidth may represent the width of the current block, and cbHeight may represent the height of the current block.

[0165] According to the decoding device and the operating method of the decoding device disclosed in FIGS. 6 and 7, the decoding device decodes, based on a bitstream, an affine flag indicating whether affine prediction can be applied to a current block and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used (S600), and determines, based on the decoded affine flag and the decoded sub-block TMVP flag, whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block (S610), and based on the determination of whether to decode the predetermined merge mode flag, derives prediction samples for the current block (S620), and generates reconstruction samples for the current block based on the prediction samples for the current block (S630), wherein when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the predetermined merge mode flag is decoded. It can be characterized by being determined. That is, by determining whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on an affine flag and a sub-block TMVP flag, the video coding efficiency can be improved.

[0166] While the methods described in the above-described embodiments are described based on a flowchart as a series of steps or blocks, the present disclosure is not limited to the order of the steps, and certain steps may occur in a different order or simultaneously with other steps described above. Furthermore, those skilled in the art will appreciate that the steps depicted in the flowchart are not exclusive, and that other steps may be included, or one or more steps in the flowchart may be deleted, without affecting the scope of the present disclosure.

[0167] The method according to the present disclosure described above can be implemented in the form of software, and the encoding device and / or decoding device according to the present disclosure can be included in a device that performs image processing, such as a TV, a computer, a smartphone, a set-top box, a display device, etc.

[0168] When the embodiments of the present disclosure are implemented in software, the above-described method may be implemented as a module (process, function, etc.) that performs the above-described function. The module may be stored in memory and executed by a processor. The memory may be internal or external to the processor and may be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, logic circuit, and / or data processing device. The memory may include a read-only memory (ROM), a random access memory (RAM), flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described in the present disclosure may be implemented and performed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in each drawing may be implemented and performed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information for implementation (e.g., information on instructions) or an algorithm may be stored on a digital storage medium.

[0169] In addition, the decoding device and encoding device to which the present disclosure is applied may be included in a multimedia broadcasting transmitting and receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a video-on-demand (VoD) service providing device, an OTT (Over the top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, a VR (virtual reality) device, an AR (argumente reality) device, a video phone video device, a transportation terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the OTT (Over the top video) device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.

[0170] In addition, the processing method to which the present disclosure is applied can be produced in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the present disclosure can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes media implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by an encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0171] Additionally, embodiments of the present disclosure may be implemented as a computer program product by program code, and the program code may be executed on a computer by embodiments of the present disclosure. The program code may be stored on a computer-readable carrier.

[0172] Figure 8 illustrates an example of a content streaming system to which the disclosure of this document may be applied.

[0173] Referring to FIG. 8, a content streaming system to which the present disclosure is applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0174] The encoding server compresses content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data, generates a bitstream, and transmits it to the streaming server. Alternatively, if multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server may be omitted.

[0175] The above bitstream can be generated by an encoding method or a bitstream generation method to which the present disclosure is applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0176] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits the multimedia data to the user. At this time, the content streaming system may include a separate control server, in which case the control server controls commands / responses between each device within the content streaming system.

[0177] The streaming server can receive content from a media repository and / or an encoding server. For example, when receiving content from the encoding server, the content can be received in real time. In this case, to provide a smooth streaming service, the streaming server can store the bitstream for a certain period of time.

[0178] Examples of the user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, HMDs), digital TVs, desktop computers, digital signage, etc.

[0179] Each server within the above content streaming system can be operated as a distributed server, in which case data received from each server can be processed in a distributed manner.

Claims

1. In a video decoding method performed by a decoding device, A step of decoding an affine flag indicating whether affine prediction can be applied to a current block based on a bitstream and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used; A step of determining whether to decode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the decoded affine flag and the decoded sub-block TMVP flag; A step of deriving prediction samples for the current block based on the decision on whether to decode the above-determined merge mode flag; and A step of generating restoration samples for the current block based on the prediction samples for the current block, A video decoding method characterized in that when the value of the above affine flag is 1 or the value of the above sub-block TMVP flag is 1, it is determined to decode the above-determined merge mode flag.

2. In paragraph 1, A video decoding method characterized in that, when the width and height of the current block are each 8 or more and the value of the affine flag is 1, or the second condition is satisfied that the value of the sub-block TMVP flag is 1, it is determined to decode the predetermined merge mode flag.

3. In paragraph 2, Whether to decode the above-determined merge mode flag is determined based on the mathematical formula below. if((sps_affine_enabled_flag && cbWidth >=8 && cbHeight >=8) || sps_sbtmvp_enabled_flag) A video decoding method, characterized in that in the mathematical expression of the third clause, sps_affine_enabled_flag represents the affine flag, cbWidth represents the width of the current block, cbHeight represents the height of the current block, and sps_sbtmvp_enabled_flag represents the sub-block TMVP flag.

4. In paragraph 2, A video decoding method, characterized in that the above-determined merge mode flag is a merge affine flag indicating whether an affine merge mode is applied to the current block or a merge sub-block flag indicating whether a merge mode is applied to each sub-block of the current block.

5. In paragraph 1, A video decoding method, characterized in that when the maximum number of merge candidates of the sub-block of the current block is greater than 0, it is determined by decoding the predetermined merge mode flag.

6. In paragraph 5, A video decoding method, characterized in that when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the maximum number of merge candidates of the sub-block of the current block is greater than 0.

7. In paragraph 6, Whether to decode the above-determined merge mode flag is determined based on the mathematical formula below. if ( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 ) A video decoding method, characterized in that in the mathematical formula of the seventh clause, MaxNumSubblockMergeCand represents the maximum number of merge candidates of the sub-block, cbWidth represents the width of the current block, and cbHeight represents the height of the current block.

8. In a video encoding method performed by an encoding device, A step of determining whether affine prediction can be applied to the current block and whether a temporal motion vector predictor based on a sub-block of the current block can be used; A step of determining whether to encode a predetermined merge mode flag indicating whether to apply a predetermined merge mode to the current block based on the determination of whether the affine prediction can be applied to the current block and whether the temporal motion vector predictor based on the sub-block of the current block can be used; and A step of encoding an affine flag indicating whether the affine prediction can be applied to the current block based on the determination as to whether to encode the pre-determined merge mode flag, a sub-block TMVP flag indicating whether the temporal motion vector predictor based on the sub-block of the current block can be used, and the pre-determined merge mode flag, A video decoding method characterized in that when the value of the above affine flag is 1 or the value of the above sub-block TMVP flag is 1, it is determined to encode the above-determined merge mode flag.

9. In paragraph 8, A video decoding method characterized in that when the width and height of the current block are each 8 or more and the value of the affine flag is 1, or when the value of the sub-block TMVP flag is 1, the predetermined merge mode flag is encoded.

10. In paragraph 9, Whether to encode the above-determined merge mode flag is determined based on the mathematical formula below, if((sps_affine_enabled_flag && cbWidth >=8 && cbHeight >=8) || sps_sbtmvp_enabled_flag) A video encoding method, characterized in that in the mathematical expression of the 10th clause, sps_affine_enabled_flag represents the affine flag, cbWidth represents the width of the current block, cbHeight represents the height of the current block, and sps_sbtmvp_enabled_flag represents the sub-block TMVP flag.

11. In paragraph 9, A video encoding method, characterized in that the above-determined merge mode flag is a merge affine flag indicating whether the affine merge mode is applied to the current block or a merge sub-block flag indicating whether the merge mode is applied to the sub-block unit of the current block.

12. In paragraph 8, A video encoding method characterized in that, when the maximum number of merge candidates of the sub-block of the current block is greater than 0, it is determined to encode the predetermined merge mode flag.

13. In paragraph 12, A video encoding method, characterized in that when the value of the affine flag is 1 or the value of the sub-block TMVP flag is 1, the maximum number of merge candidates of the sub-block of the current block is greater than 0.

14. In paragraph 13, Whether to encode the above-determined merge mode flag is determined based on the mathematical formula below, if ( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 ) A video encoding method, characterized in that in the mathematical formula of the above clause 14, MaxNumSubblockMergeCand represents the maximum number of merge candidates of the sub-block, cbWidth represents the width of the current block, and cbHeight represents the height of the current block.

15. In a decoding device that performs video decoding, An entropy decoding unit that decodes an affine flag indicating whether affine prediction can be applied to a current block based on a bitstream and a sub-block TMVP flag indicating whether a temporal motion vector predictor based on a sub-block of the current block can be used, and determines whether to decode a predetermined merge mode flag indicating whether a predetermined merge mode is to be applied to the current block based on the decoded affine flag and the decoded sub-block TMVP flag; A prediction unit that derives prediction samples for the current block based on the decision on whether to decode the above-determined merge mode flag; and Including an addition unit for generating restoration samples for the current block based on the prediction samples for the current block, A decoding device characterized in that when the value of the above affine flag is 1 or the value of the above sub-block TMVP flag is 1, it is determined to decode the above-determined merge mode flag.