Method and apparatus for processing video signals using affine prediction

By adaptively selecting affine prediction modes and parameters, the problem of efficient coding of high-resolution video signals is solved, reducing coding complexity and improving coding efficiency.

CN118214883BActive Publication Date: 2025-12-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410534253.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-08-03
Filing Date
2018-08-03
Publication Date
2025-12-26
Estimated Expiration
2038-08-03

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle the high spatial resolution, high frame rate, and high scene performance of next-generation video content, leading to a significant increase in storage and processing power requirements.

Method used

The optimal compilation mode is adaptively selected using affine prediction modes (AF4 mode and AF6 mode), and affine prediction is performed using four or six parameters based on block size and the compilation status of neighboring blocks.

Benefits of technology

Adaptive affine prediction reduces coding complexity and improves coding efficiency and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118214883B_ABST
    Figure CN118214883B_ABST
Patent Text Reader

Abstract

The disclosure provides a method for decoding a video signal including a current block based on an affine motion prediction mode (affine mode, AF mode), the method including checking whether the AF mode is applied to the current block, the AF mode indicating a motion prediction mode using an affine motion model; when the AF mode is applied to the current block, checking whether the AF4 mode is used, the AF4 mode indicating a mode in which four parameters constituting the affine motion model are used to predict a motion vector; when the AF4 mode is used, generating a motion vector predictor using the four parameters, and when the AF4 mode is not used, generating a motion vector predictor using six parameters constituting the affine motion model; and obtaining a motion vector of the current block based on the motion vector predictor.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The disclosure relates to a method and apparatus for encoding / decoding a video signal, and more particularly, to a method and apparatus for adaptively performing affine prediction. BACKGROUND

[0002] Compression encoding refers to a series of signal processing techniques for transmitting digitized information through a communication line or storing digitized information in a form suitable for a storage medium. Media such as video, image, and voice can be a target of compression encoding, and in particular, a technique of performing compression encoding using video as a target is referred to as video compression.

[0003] Next-generation video content will have a high-dimensional characteristic of high spatial resolution, high frame rate, and high scene representation. In order to process such content, memory storage, memory access rate, and processing power technology will significantly increase.

[0004] Therefore, it is necessary to design a coding tool for more efficiently processing next-generation video content. SUMMARY

[0005] TECHNICAL PROBLEM

[0006] The disclosure proposes a method for more efficiently encoding and decoding a video signal.

[0007] In addition, the disclosure proposes a method for performing encoding or decoding considering both an AF4 mode which is an affine prediction mode using four parameters and an AF6 mode which is an affine prediction mode using six parameters.

[0008] In addition, the disclosure proposes a method for adaptively determining (or selecting) an optimal coding mode according to at least one of the AF4 mode and the AF6 mode based on a block size.

[0009] In addition, the disclosure proposes a method for adaptively determining (or selecting) an optimal coding mode according to at least one of the AF4 mode and the AF6 mode based on whether a neighboring block has been coded according to affine prediction.

[0010] TECHNICAL SOLUTION

[0011] To solve the foregoing technical problems,

[0012] The disclosure provides a method for adaptively performing affine prediction based on a block size.

[0013] In addition, the disclosure provides a method for adaptively performing affine prediction based on whether a neighboring block has been coded according to affine prediction.

[0014] Further, the disclosure provides a method for adaptively determining (or selecting) an optimal coding mode based on at least one of an AF4 mode and an AF6 mode.

[0015] Further, the disclosure provides a method for adaptively performing affine prediction based on whether at least one predetermined condition is satisfied. In this case, the predetermined condition can include at least one of a block size, a number of pixels of a block, a block width, a block height, and whether a neighboring block has been coded according to affine prediction.

[0016] Advantageous Effects

[0017] The disclosure can improve the performance of affine prediction by providing a method for adaptively performing affine prediction, and can perform more efficient coding by reducing the complexity of affine prediction. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a block diagram illustrating a configuration of an encoder for encoding a video signal according to an embodiment of the disclosure.

[0019] Figure 2 is a block diagram illustrating a configuration of a decoder for decoding a video signal according to an embodiment of the disclosure.

[0020] Figure 3 is a diagram for explaining a QT (Quad Tree, hereinafter referred to as "QT") block partitioning structure which is an embodiment to which the disclosure is applicable.

[0021] Figure 4 is a diagram for explaining a BT (Binary Tree, hereinafter referred to as "BT") block partitioning structure which is an embodiment to which the disclosure is applicable.

[0022] Figure 5 is a diagram for explaining a TT (Triangular Tree, hereinafter referred to as "TT") block partitioning structure which is an embodiment to which the disclosure is applicable.

[0023] Figure 6 is a diagram for explaining an AT (Asymmetric Tree, hereinafter referred to as "AT") block partitioning structure which is an embodiment to which the disclosure is applicable.

[0024] Figure 7 is a diagram for explaining an inter prediction mode which is an embodiment to which the disclosure is applied.

[0025] Figure 8 is a diagram for explaining an affine motion model which is an embodiment to which the disclosure is applied.

[0026] Figure 9 is a diagram for explaining an affine motion prediction method using a control point motion vector which is an embodiment to which the disclosure is applied.

[0027] Figure 10 is a flowchart illustrating a process of processing a video signal including a current block using an affine prediction mode as an embodiment to which the disclosure is applied.

[0028] Figure 11 is a flowchart illustrating a process of adaptively determining a best coding mode based on at least one of an AF4 mode and an AF6 mode as an embodiment (1-1) to which the disclosure is applied.

[0029] Figure 12 is a flowchart illustrating a process of adaptively performing decoding based on an AF4 mode or an AF6 mode as an embodiment (1-2) to which the disclosure is applied.

[0030] Figure 13 illustrates a syntax structure in which decoding is performed based on an AF4 mode or an AF6 mode as an embodiment (1-3) to which the disclosure is applied.

[0031] Figure 14 is a flowchart illustrating a process of adaptively determining a best coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode based on a condition A as an embodiment (2-1) to which the disclosure is applied.

[0032] Figure 15 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on a condition A as an embodiment (2-2) to which the disclosure is applied.

[0033] Figure 16 illustrates a syntax structure in which decoding is performed according to an AF4 mode or an AF6 mode based on a condition A as an embodiment (2-3) to which the disclosure is applied.

[0034] Figure 17 is a flowchart illustrating a process of adaptively determining a best coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode based on at least one of a condition B and a condition C as an embodiment (3-1) to which the disclosure is applied.

[0035] Figure 18 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on at least one of a condition B and a condition C as an embodiment (3-2) to which the disclosure is applied.

[0036] Figure 19 illustrates a syntax structure in which decoding is performed according to an AF4 mode or an AF6 mode based on at least one of a condition B and a condition C as an embodiment (3-3) to which the disclosure is applied.

[0037] Figure 20is a flowchart illustrating a process of adaptively determining a best inter coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode as an embodiment (4-1) to which the disclosure is applied.

[0038] Figure 21 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode as an embodiment (4-2) to which the disclosure is applied.

[0039] Figure 22 is a syntax structure in which an inter coding mode based on a neighboring block performs decoding according to an AF4 mode or an AF6 mode as an embodiment (4-3) to which the disclosure is applied.

[0040] Figure 23 is a flowchart illustrating a process of adaptively determining a best inter coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode based on at least one of a condition A, a condition B, and a condition C as an embodiment (5-1) to which the disclosure is applied.

[0041] Figure 24 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on at least one of a condition A, a condition B, and a condition C as an embodiment (5-2) to which the disclosure is applied.

[0042] Figure 25 is a syntax structure in which an inter coding mode based on at least one of a condition A, a condition B, and a condition C performs decoding according to an AF4 mode or an AF6 mode as an embodiment (5-3) to which the disclosure is applied.

[0043] Figure 26 is a flowchart illustrating a process of adaptively determining a best inter coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode based on at least one of a condition A and an inter coding mode of a neighboring block as an embodiment (6-1) to which the disclosure is applied.

[0044] Figure 27 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on at least one of a condition A and an inter coding mode of a neighboring block as an embodiment (6-2) to which the disclosure is applied.

[0045] Figure 28 is a syntax structure in which an inter coding mode based on at least one of a condition A and an inter coding mode of a neighboring block performs decoding according to an AF4 mode or an AF6 mode as an embodiment (6-3) to which the disclosure is applied.

[0046] Figure 29is a flowchart illustrating a process of generating a motion vector predictor based on at least one of an AF4 mode and an AF6 mode as an embodiment to which the disclosure is applied.

[0047] Figure 30 is a flowchart illustrating a process of generating a motion vector predictor based on an AF4_flag and an AF6_flag as an embodiment to which the disclosure is applied.

[0048] Figure 31 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on whether a neighboring block is coded in an AF mode as an embodiment to which the disclosure is applied.

[0049] Figure 32 illustrates a syntax in which decoding is adaptively performed based on an AF4_flag and an AF6_flag as an embodiment to which the disclosure is applied.

[0050] Figure 33 illustrates a syntax in which decoding is adaptively performed according to an AF4 mode or an AF6 mode based on whether a neighboring block is coded in an AF mode as an embodiment to which the disclosure is applied.

[0051] Figure 34 illustrates a video coding system to which the disclosure is applied.

[0052] Figure 35 illustrates a content streaming system to which the disclosure is applied.

[0053] Preferred Embodiment

[0054] The disclosure provides a method for decoding a video signal including a current block based on an affine motion prediction mode (affine mode, AF mode), the method including: checking whether the AF mode is applied to the current block, the AF mode indicating a motion prediction mode using an affine motion model; when the AF mode is applied to the current block, checking whether an AF4 mode is used, the AF4 mode indicating a mode in which a motion vector is predicted using four parameters constituting the affine motion model; when the AF4 mode is used, generating a motion vector predictor using the four parameters, and when the AF4 mode is not used, generating a motion vector predictor using six parameters constituting the affine motion model; and obtaining a motion vector of the current block based on the motion vector predictor.

[0055] In the disclosure, the method can further include obtaining an affine flag from the video signal, wherein the affine flag indicates whether the AF mode is applied to the current block, and checking whether the AF mode is applied to the current block based on the affine flag.

[0056] In the disclosure, the method can further include obtaining an affine parameter flag from the video signal when the AF mode is applied to the current block according to the affine flag, wherein the affine parameter flag indicates whether a motion vector predictor is generated using four parameters or using six parameters.

[0057] In the disclosure, the affine flag and the affine parameter flag can be defined at at least one level of a slice, a maximum coding unit, a coding unit, and a prediction unit.

[0058] In the disclosure, the method can further include checking whether a size of the current block satisfies a predetermined condition, wherein the predetermined condition represents whether a number of pixels in the current block and at least one of a width and / or a height of the current block is greater than a predetermined threshold, and when the size of the current block satisfies the predetermined condition, performing the checking of whether the AF mode is applied to the current block.

[0059] In the disclosure, when the size of the current block does not satisfy the predetermined condition, the current block can be decoded based on a coding mode other than the AF mode.

[0060] In the disclosure, the method can further include, when the AF mode is applied to the current block, checking whether the AF mode has been applied to a neighboring block, wherein, when the AF mode has been applied to the neighboring block, the motion vector predictor is generated using four parameters, and, when the AF mode has not been applied to the neighboring block, the checking of whether the AF4 mode is used is performed.

[0061] The disclosure provides an apparatus for decoding a video signal including a current block based on an affine motion prediction mode (AF mode), the apparatus including an inter prediction unit configured to: check whether the AF mode is applied to the current block; when the AF mode is applied to the current block, check whether an AF4 mode is used; when the AF4 mode is used, generate a motion vector predictor using four parameters, and when the AF4 mode is not used, generate the motion vector predictor using six parameters constituting an affine motion model; and obtain a motion vector of the current block based on the motion vector predictor, wherein the AF mode represents a motion prediction mode using the affine motion model, and the AF4 mode represents a mode in which a motion vector is predicted using four parameters constituting the affine motion model.

[0062] In the disclosure, the apparatus can further include a parser configured to parse an affine flag from the video signal, wherein the affine flag indicates whether the AF mode is applied to the current block, and check whether the AF mode is applied to the current block based on the affine flag.

[0063] In the disclosure, the apparatus can include a parser configured to obtain an affine parameter flag from the video signal when an affine mode is applied to the current block according to an affine flag, wherein the affine parameter flag indicates whether a motion vector predictor is generated using four parameters or using six parameters.

[0064] In the disclosure, the apparatus can include an inter prediction unit configured to check whether a size of the current block satisfies a predetermined condition, wherein the predetermined condition indicates whether a number of pixels in the current block and at least one of a width and / or a height of the current block is greater than a predetermined threshold, and when the size of the current block satisfies the predetermined condition, perform a check whether an AF mode is applied to the current block.

[0065] In the disclosure, the apparatus can include an inter prediction unit configured to check whether an AF mode has been applied to a neighboring block when the AF mode is applied to the current block, wherein when the AF mode has been applied to the neighboring block, a motion vector predictor is generated using four parameters, and when the AF mode has not been applied to the neighboring block, perform a check whether an AF4 mode is used. DETAILED DESCRIPTION

[0066] Hereinafter, configurations and operations of embodiments of the disclosure will be described in detail with reference to the accompanying drawings, the configurations and operations of the disclosure described with reference to the accompanying drawings are described as embodiments, and the scope, core configurations and operations of the disclosure are not limited thereto.

[0067] Further, the terms used in the disclosure are selected from general terms widely used at present, but in specific cases, terms randomly selected by the applicant are used. In this case, in the detailed description of the corresponding part, since the meaning thereof is clearly described, the term should not be simply interpreted only by the name of the term used in the description of the disclosure and the meaning of the corresponding term should be understood and interpreted.

[0068] Further, when there is a general term for describing the disclosure or another term having a similar meaning, the term used in the disclosure can be replaced to be more appropriately interpreted. For example, signal, data, sample, picture, frame, and block can be appropriately replaced and interpreted in each compiling process. Further, partition, split, separate, and divide can be appropriately replaced and interpreted in each compiling process.

[0069] Figure 1 A schematic block diagram of an encoder for encoding a video signal according to one embodiment of the disclosure is shown.

[0070] REFERENCE Figure 1The encoder 100 can include an image partitioning unit 110, a transform unit 120, a quantization unit 130, a dequantization unit 140, an inverse transform unit 150, a filter unit 160, a DPB (decoded picture buffer) 170, an inter prediction unit 180, an intra prediction unit 185, and an entropy encoding unit 190.

[0071] The image partitioning unit 110 can divide an input image (or picture, frame) input to the encoder 100 into one or more processing units. For example, the processing units can be a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Here, the partitioning can be performed by at least one of QT (quad tree), BT (binary tree), TT (ternary tree), and AT (asymmetric tree).

[0072] However, these terms are used only for convenience in explaining the present disclosure, and the present disclosure is not limited to the definitions of these terms. In the present specification, the term "coding unit" is used for convenience in explanation as a unit used in a process of encoding or decoding a video signal, but the present disclosure is not limited thereto, and another processing unit can be appropriately selected based on the content of the present disclosure.

[0073] The encoder 100 can generate a residual signal by subtracting a prediction signal output from the inter prediction unit 180 or the intra prediction unit 185 from an input image signal. The generated residual signal can be transmitted to the transform unit 120.

[0074] The transform unit 120 can apply a transform technique to the residual signal to produce transform coefficients. The transform process can be applied to a block of pixels having the same size of a square, or to a block having a variable size other than a square.

[0075] The quantization unit 130 can quantize the transform coefficients and transmit the quantized coefficients to the entropy encoding unit 190. The entropy encoding unit 190 can entropy-encode the quantized signal and then output the entropy-encoded signal as a bitstream.

[0076] The quantized signal output from the quantization unit 130 can be used to generate a prediction signal. For example, the quantized signal can be dequantized and inverse-transformed to reconstruct a residual signal via the dequantization unit 140 and the inverse transform unit 150 in a loop, respectively. The reconstructed residual signal can be added to the prediction signal output from the inter prediction unit 180 or the intra prediction unit 185 to generate a reconstructed signal.

[0077] Meanwhile, in the compression process, neighboring blocks can be quantized by different quantization parameters, and thus degradation of a block boundary can occur. This phenomenon is referred to as blocking artifacts. This is one of important factors in evaluating image quality. Filtering processing can be performed to reduce such degradation. Using the filtering processing, the blocking artifacts can be removed, and at the same time, errors of the current picture can be reduced, thereby improving the image quality.

[0078] The filtering unit 160 can apply filtering to the reconstructed signal and then output the filtered reconstructed signal to a rendering device or a decoded picture buffer 170. The filtered signal transmitted to the decoded picture buffer 170 can be used as a reference picture in the inter prediction unit 180. In this way, using the filtered picture as a reference picture in the inter picture prediction mode not only improves the picture quality but also improves the coding efficiency.

[0079] The decoded picture buffer 170 can store the filtered picture to be used as a reference picture in the inter prediction unit 180.

[0080] The inter prediction unit 180 can perform temporal prediction and / or spatial prediction with reference to the reconstructed picture to remove temporal redundancy and / or spatial redundancy. In this case, the reference picture for prediction can be a transformed signal obtained in a unit of a block via quantization and dequantization in the previous encoding / decoding. Thus, this can cause blocking artifacts or ringing artifacts.

[0081] Accordingly, to solve the performance degradation due to discontinuity of a signal or quantization, the inter prediction unit 180 can interpolate a signal between pixels in a unit of a sub-pixel using a low-pass filter. In this case, the sub-pixel can mean a virtual pixel generated by applying an interpolation filter. The integer pixel refers to an actual pixel present in the reconstructed picture. The interpolation method can include linear interpolation, bilinear interpolation, and Wiener filter, etc.

[0082] The interpolation filter is applied to the reconstructed picture, and thus is capable of improving the accuracy of prediction. For example, the inter prediction unit 180 can generate an interpolated pixel by applying the interpolation filter to the integer pixel, and can perform prediction using an interpolation block configured with the interpolated pixel as a prediction block.

[0083] The intra prediction unit 185 can predict the current block with reference to samples around the block to be now encoded. The intra prediction unit 185 can perform the following processes in order to perform the intra prediction. First, the prediction unit can prepare reference samples necessary to generate a prediction signal. Also, the prediction unit can generate the prediction signal using the prepared reference samples. Thereafter, the prediction unit encodes the prediction mode. In this case, the reference samples can be prepared through reference sample padding and / or reference sample filtering. The reference samples can include quantization errors because the prediction and reconstruction processes have been performed on the reference samples. Accordingly, in order to reduce such errors, a reference sample filtering process can be performed on each prediction mode used for the intra prediction.

[0084] The prediction signal generated by the inter prediction unit 180 or the intra prediction unit 185 can be used to generate a reconstructed signal or can be used to generate a residual signal.

[0085] Figure 2 is an embodiment to which the disclosure is applied, and shows a schematic block diagram of a decoder through which decoding of a video signal is performed.

[0086] Reference Figure 2 The decoder 200 can be configured to include a parsing unit (not shown), an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, a filtering unit 240, a decoded picture buffer (DPB) unit 250, an inter prediction unit 260, an intra prediction unit 265, and a reconstruction unit (not shown).

[0087] The decoder 200 can receive a signal output by the encoder 100 of Figure 1 The syntax elements can be parsed or obtained by the parsing unit (not shown). The parsed or obtained signal can be entropy-decoded by the entropy decoding unit 210.

[0088] The inverse quantization unit 220 obtains transform coefficients from the entropy-decoded signal using quantization step size information.

[0089] The inverse transform unit 230 obtains a residual signal by inversely transforming the transform coefficients.

[0090] The reconstruction unit (not shown) generates a reconstructed signal by adding the obtained residual signal to the prediction signal output by the inter prediction unit 260 or the intra prediction unit 265.

[0091] The filtering unit 240 applies filtering to the reconstructed signal and transmits the filtered signal to a playback device or transmits the filtered signal to the decoded picture buffer unit 250. The filtered signal transmitted to the decoded picture buffer unit 250 can be used as a reference picture in the inter prediction unit 260.

[0092] In this specification, the embodiments described in the filter unit 160, the inter prediction unit 180, and the intra prediction unit 185 of the encoder 100 can be identically applied to the filter unit 240, the inter prediction unit 260, and the intra prediction unit 265 of the decoder, respectively.

[0093] The reconstructed video signal output by the decoder 200 can be played back by a playback device.

[0094] Figure 3 is a diagram for explaining a QT (Quadruple Tree, hereinafter referred to as "QT") block partitioning structure as an embodiment applicable to the present disclosure.

[0095] In video coding, a single block can be partitioned based on QT (Quadruple Tree). Further, the single sub-block partitioned according to the QT can be further recursively partitioned using QT. The leaf block no longer partitioned according to the QT can be partitioned according to at least one of BT (Binary Tree), TT (Ternary Tree), and AT (Asymmetric Tree). The BT can have two types of partitioning: horizontal BT (2NxN, 2NxN); and vertical BT (Nx2N, Nx2N). The TT can have two types of partitioning: horizontal TT (2Nx1 / 2N, 2NxN, 2Nx1 / 2N); and vertical TT (1 / 2Nx2N, Nx2N, 1 / 2Nx2N). The AT can have four types of partitioning: horizontal-up AT (2Nx1 / 2N, 2Nx3 / 2N); horizontal-down AT (2Nx3 / 2N, 2Nx1 / 2N); vertical-left AT (1 / 2Nx2N, 3 / 2Nx2N); and vertical-right AT (3 / 2Nx2N, 1 / 2Nx2N). The BT, TT, and AT can be further recursively partitioned using the BT, TT, and AT.

[0096] Figure 3 An example of QT partitioning is shown. Block A can be partitioned into four sub-blocks A0, A1, A2, and A3 using QT. Sub-block A1 can be further partitioned into four sub-blocks B0, B1, B2, and B3 using QT.

[0097] Figure 4 is a diagram for explaining a BT (Binary Tree, hereinafter referred to as "BT") block partitioning structure as an embodiment applicable to the present disclosure.

[0098] Figure 4 An example of BT partitioning is shown. Block B3, which is no longer partitioned by QT, can be partitioned into vertical BTs C0 and C1 or horizontal BTs D0 and D1. Each sub-block such as block C0 can be further recursively partitioned into horizontal BTs E0 and E1 or vertical BTs F0 and F1.

[0099] Figure 5is a diagram for explaining a TT (Triangular Tree, hereinafter referred to as "TT") block partitioning structure as an embodiment to which the present disclosure is applicable.

[0100] Figure 5 An example of TT partitioning is shown. A block B3, which is no longer partitioned by QT, can be partitioned into vertical TTs C0, C1 and C2 or horizontal TTs D0, D1 and D2. Each sub-block such as block C1 can be further recursively partitioned into horizontal TTs E0, E1 and E2 or vertical TTs F0, F1 and F2.

[0101] Figure 6 is a diagram for explaining an AT (Asymmetric Tree, hereinafter referred to as "AT") block partitioning structure as an embodiment to which the present disclosure is applicable.

[0102] Figure 6 An example of AT partitioning is shown. A block B3, which is no longer partitioned by QT, can be partitioned into vertical ATs C0 and C1 or horizontal ATs D0 and D1. Each sub-block such as block C1 can be further recursively partitioned into horizontal ATs E0 and E1 or vertical ATs F0 and F1.

[0103] Meanwhile, BT, TT and AT partitioning can be used together. For example, a sub-block partitioned by BT can be partitioned by TT or AT. Also, a sub-block partitioned by TT can be partitioned by BT or AT. A sub-block partitioned by AT can be partitioned by BT or TT. For example, after horizontal BT partitioning, each sub-block can be partitioned into vertical BT, and after vertical BT partitioning, each sub-block can be partitioned into horizontal BT. These two partitioning methods have different partitioning orders, but the final obtained partitioning shapes are the same.

[0104] Also, when partitioning a block, a block search order can be defined in various ways. Generally, a search is performed from left to right and from top to bottom, and a block search can mean an order of determining additional block partitioning of each partitioned sub-block, an encoding order of each sub-block when a block is no longer partitioned, or a search order when a sub-block refers to information about other neighboring blocks.

[0105] Figure 7 is a diagram for explaining an inter prediction mode to which an embodiment of the present disclosure is applied.

[0106] Inter prediction mode

[0107] In the inter prediction mode to which the present disclosure is applied, a merge mode, an AMVP (Advanced Motion Vector Prediction) mode or an affine prediction mode (hereinafter referred to as "AF mode") can be used in order to reduce the amount of motion information.

[0108] 1) Merge mode

[0109] Merge mode refers to a method of deriving motion parameters (or information) from a spatially or temporally neighboring block.

[0110] The set of candidates available in the merge mode includes spatial neighboring candidates, temporal candidates, and generated candidates.

[0111] Referring to Figure 7 In (a) of FIG. 1, it is determined in the order of {A1, B1, B0, A0, B2} whether each spatial candidate block is available. Here, when a candidate block is coded in the intra prediction mode and thus there is no motion information, or the candidate block is located outside the current picture (or slice), the candidate block cannot be used.

[0112] After determining the availability of the spatial candidates, the spatial merge candidates can be configured by excluding unnecessary candidate blocks from the candidate blocks of the current processing block. For example, when a candidate block of the current prediction block is the first prediction block in the same coding block, the candidate block can be excluded, and a candidate block having the same motion information can be excluded.

[0113] When the spatial merge candidate configuration is completed, the temporal merge candidate configuration process is performed in the order of {T0, T1}.

[0114] In the temporal candidate configuration, if a right-bottom block T0 of the collocated block of the reference picture is available, the corresponding block is configured as a temporal merge candidate. The collocated block refers to a block existing at a position in the selected reference picture, which corresponds to the current processing block. If not, a block T1 located at the center of the collocated block is configured as a temporal merge candidate.

[0115] The maximum number of merge candidates can be specified in the slice header. If the number of merge candidates is greater than the maximum number, the number of spatial candidates and temporal candidates smaller than the maximum number is maintained. If not, the candidates added so far are combined to generate additional merge candidates (i.e., combined bi-predictive merge candidates) until the number of merge candidates reaches the maximum number.

[0116] The encoder configures the merge candidate list by the above-described method, and performs motion estimation to signal information about a candidate block selected from the merge candidate list to the decoder as a merge index (e.g., merge_idx[x0][y0]') Figure 7 (b) of FIG. 1 illustrates a case in which a block B1 is selected from the merge candidate list. In this case, "index 1" can be signaled to the decoder as a merge index.

[0117] The decoder configures the merge candidate list as in the encoder and derives the motion information on the current block from the motion information of the candidate block in the merge candidate list corresponding to the merge index received from the encoder. In addition, the decoder generates the prediction block on the current processing block based on the derived motion information.

[0118] 2) AMVP (Advanced Motion Vector Prediction) mode

[0119] The AMVP mode refers to a method of deriving a motion vector predictor from neighboring blocks. Thus, horizontal and vertical motion vector differences (MVDs), reference indices, and inter prediction modes are signaled to the decoder. The horizontal and vertical motion vector values are calculated using the derived motion vector predictor and the motion vector differences (MVDs) provided by the encoder.

[0120] That is, the encoder configures a motion vector predictor candidate list and performs motion estimation to signal to the decoder a motion reference flag (i.e., candidate block information) selected from the motion vector predictor candidate list (e.g., mvp_lx_flag[x0][y0]'). The decoder configures the motion vector predictor candidate list as in the encoder and derives a motion vector predictor of the current processing block using the motion information of the candidate block indicated by the motion reference flag received from the encoder in the motion vector predictor candidate list. In addition, the decoder obtains the motion vector value of the current processing block using the derived motion vector predictor and the motion vector difference transmitted from the encoder. Then, the decoder generates a prediction block on the current processing block based on the derived motion information (i.e., motion compensation).

[0121] In the case of the AMVP mode, two spatial motion candidates are selected from five available candidates in Figure 7 The first spatial motion candidate is selected from the left set {A0, A1} and the second spatial motion candidate is selected from the top set {B0, B1, B2}. Here, when the reference indices of the neighboring candidate blocks are different from the reference index of the current prediction block, the motion vector is scaled.

[0122] If the number of candidates selected as the spatial motion candidate search result is 2, the candidate configuration ends. If the number is less than 2, a temporal motion candidate is added.

[0123] The decoder (e.g., inter prediction unit) decodes the motion parameters on the processing block (e.g., prediction unit).

[0124] For example, when the processing block uses the merge mode, the decoder can decode the merge index signaled from the encoder. Then, the decoder can derive the motion parameters of the current processing block from the motion parameters of the candidate block indicated by the merge index.

[0125] Further, when the AMVP mode is applied to process a block, the decoder can decode a horizontal and vertical motion vector difference (MVD), a reference index, and an inter prediction mode signaled from the encoder. In addition, the decoder can derive a motion vector predictor from motion parameters of a candidate block indicated by a motion reference flag, and derive a motion vector value of the current processing block using the motion vector predictor and the received motion vector difference.

[0126] The decoder performs motion compensation on the prediction unit using the decoded motion parameters (or information).

[0127] That is, the encoder / decoder performs motion compensation for predicting an image of a current unit from a previously decoded picture using the decoded motion parameters.

[0128] 3) AF mode (affine mode)

[0129] The AF mode refers to a motion prediction mode using an affine motion model, and can include at least one of an affine merge mode and an affine inter mode. The affine inter mode can include at least one of an AF4 mode and an AF6 mode. Here, the AF4 mode denotes a four-parameter affine prediction mode using four parameters, and the AF6 mode denotes a six-parameter affine prediction mode using six parameters.

[0130] Although expressed as the AF4 mode or the AF6 mode in the disclosure for convenience, the AF4 mode and the AF6 mode need not be defined as separate prediction modes, and can be distinguished from each other according to whether four parameters are used or six parameters are used.

[0131] Reference will be made to Figure 8 to Figure 10 Detailed description of the AF mode.

[0132] Figure 8 is a diagram for explaining an affine motion model applied to the disclosure.

[0133] A general image coding technique uses a translational motion model to represent motion of a coded block. Here, the translational motion model denotes a prediction method of a block based on translation. That is, a single motion vector is used to represent motion information of a coded block. However, pixels in an actual coded block can have different optimal motion vectors. If a small amount of information can be used to determine an optimal motion vector for each pixel or sub-block, coding efficiency can be improved.

[0134] Accordingly, the disclosure proposes an inter prediction-based image processing method reflecting various motions of an image and a prediction method based on a translational block in order to improve inter prediction performance.

[0135] Further, the disclosure proposes an affine motion prediction method for performing encoding / decoding using an affine motion model. The affine motion model represents a prediction method of deriving a motion vector in a pixel or sub-block unit using a control point motion vector. In the description, an affine motion prediction mode using the affine motion model is referred to as an AF mode (affine mode).

[0136] Further, the disclosure provides a method for adaptively performing affine prediction based on a block size.

[0137] Further, the disclosure provides a method for adaptively performing affine prediction based on whether a neighboring block has been encoded according to an affine prediction.

[0138] Further, the disclosure provides a method for adaptively determining (or selecting) an optimal encoding mode based on at least one of an AF4 mode and an AF6 mode. Here, the AF4 mode represents a four-parameter affine prediction mode using four parameters, and the AF6 mode represents a six-parameter affine prediction mode using six parameters.

[0139] Reference Figure 8 Various methods can be used to express a distortion of an image as motion information, and in particular, an affine motion model can express Figure 8 four kinds of motions illustrated in FIG. 1.

[0140] For example, the affine motion model can model any image distortion including a translation of an image, a scaling of an image, a rotation of an image, and a shear of an image.

[0141] Although the affine motion model can be expressed by various methods, the disclosure proposes a method for displaying (or identifying) a distortion at a specific reference point (or reference pixel / sample) of a block using motion information and performing inter prediction using the same. Here, the reference point can be referred to as a control point (CP) (or control pixel or control sample), and a motion vector at the reference point can be referred to as a control point motion vector (CPMV). The degree of distortion that can be expressed can depend on the number of control points.

[0142] The affine motion model can be expressed using six parameters a, b, c, d, e, and f, as expressed in Equation 1 below.

[0143] [Equation 1]

[0144]

[0145] Here, (x, y) represents a position of a top-left pixel of an encoded block. In addition, v x and v y represent a motion vector at (x, y).

[0146] Figure 9 is a diagram for explaining an affine motion prediction method using control point motion vectors to which embodiments of the present disclosure are applied.

[0147] Referring to Figure 9 In (a) of FIG. 9, a top-left control point CP0 902 (hereinafter, referred to as a first control point), a top-right control point CP1 903 (hereinafter, referred to as a second control point), and a bottom-left control point CP2 904 (hereinafter, referred to as a third control point) of the current block 901 can have independent pieces of motion information. These can be denoted as CP0, CP1, and CP2. However, this corresponds to embodiments of the present disclosure, and the present disclosure is not limited thereto. For example, the control points can be defined in various ways as a bottom-right control point, a center control point, and other control points for the positions of sub-blocks.

[0148] In embodiments of the present disclosure, at least one of the first control point to the third control point can be a pixel included in the current block. Alternatively, at least one of the first control point to the third control point can be a pixel not included in the current block and adjacent to the current block.

[0149] The motion information of each pixel or sub-block of the current block 901 can be derived using the motion information of one or more of the aforementioned control points.

[0150] For example, an affine motion model using the motion vectors of the top-left control point 902, the top-right control point 903, and the bottom-left control point 904 of the current block 901 can be defined as represented in Equation 2 below.

[0151] [Equation 2]

[0152]

[0153] Here, when denotes a motion vector of the top-left control point 902, denotes a motion vector of the top-right control point 903, and denotes a motion vector of the bottom-left control point 904, these motion vectors can be defined as and Further, in Equation 2, w denotes a width of the current block 901, and h denotes a height of the current block 901. In addition, k denotes a motion vector at {x, y}.

[0154] The present disclosure can define an affine motion model that represents three kinds of motion, among motions that can be represented by an affine motion model, of translation, scaling, and rotation. This is referred to as a simplified affine motion model or a similar affine motion model in the specification.

[0155] A simplified affine motion model can be expressed using four parameters a, b, c, and d, as expressed in Equation 3 below.

[0156] [Equation 3]

[0157]

[0158] Here, {v x , v y} denotes a motion vector at {x, y}. An affine motion model using four parameters can be referred to as AF4. The disclosure is not limited thereto, and a case where six parameters are used will be referred to as AF6, and the above-described embodiments can be identically applied thereto.

[0159] Referring to Figure 9 , when denotes a motion vector of a top-left control point 1001 of a current block and denotes a motion vector of a top-right control point 1002, these motion vectors can be defined as and Here, an affine motion model of AF4 can be defined as expressed in Equation 4 below.

[0160] [Equation 4]

[0161]

[0162] In Equation 4, w denotes a width of a current block, and h denotes a height of the current block. In addition, denotes a motion vector at {x, y}.

[0163] An encoder or a decoder can determine (or derive) a motion vector of each pixel position using control point motion vectors (e.g., motion vectors of the top-left control point 1001 and the top-right control point 1002).

[0164] In the disclosure, a set of motion vectors determined through affine motion prediction can be defined as an affine motion vector field. The affine motion vector field can be determined using at least one of Equations 1 to 4.

[0165] In an encoding / decoding process, a motion vector through affine motion prediction can be determined in units of pixels or a predetermined (or preset) block (or sub-block). For example, when a motion vector is determined in units of pixels, a motion vector can be derived based on each pixel in a block, and when a motion vector is determined in units of sub-blocks, a motion vector can be derived based on each sub-block in a current block. Alternatively, when a motion vector is determined in units of sub-blocks, a motion vector of a corresponding sub-block can be derived based on a top-left pixel or a center pixel.

[0166] Hereinafter, although a case in which motion vectors predicted by affine motion are determined in units of 4x4 blocks will be mainly described in the disclosure for convenience of description, the disclosure is not limited thereto, and the disclosure can be applied in units of pixels or in units of blocks having different sizes.

[0167] Meanwhile, referring to (b) in FIG. 10, Figure 9 assuming a case in which the size of the current block is 16x16. The encoder or the decoder can determine motion vectors in units of 4x4 sub-blocks using motion vectors of the top-left control point 1001 and the top-right control point 1002 of the current block. In addition, the motion vectors of the sub-blocks can be determined based on the center pixel values of the sub-blocks.

[0168] In (b) in FIG. 10, Figure 9 the arrows indicated at the center of each sub-block indicate motion vectors obtained by an affine motion model.

[0169] The affine motion prediction can be used in an affine merge mode (hereinafter referred to as an "AF merge mode") and an affine inter mode (hereinafter referred to as an "AF inter mode"). The AF merge mode is a method of deriving and encoding or decoding two control point motion vectors without decoding a motion vector difference, similar to a skip mode or a merge mode. The AF inter mode is a method of determining a motion vector predictor and a control point motion vector, and then encoding or decoding a control point motion vector difference (CPMVD) corresponding to a difference between the motion vector predictor and the control point motion vector. In this case, two control point motion vector differences are transmitted in the AF4 mode, and three control point motion vector differences are transmitted in the AF6 mode.

[0170] Here, the AF4 mode has an advantage in that it can represent control point motion vectors (CPMVs) using a small amount of bits, because the AF4 mode transmits a smaller number of motion vector differences than the AF6 mode, whereas the AF6 mode has an advantage in that it can reduce the number of bits for residual coding because the AF6 mode transmits three CPMVDs and thus can generate an excellent predictor.

[0171] Accordingly, the disclosure proposes a method of considering both the AF4 mode and the AF6 mode in the AF inter mode.

[0172] Figure 10 is a flowchart illustrating a process of processing a video signal including a current block using an affine prediction mode (hereinafter referred to as an "AF mode"), which is an embodiment to which the disclosure is applied.

[0173] The disclosure provides a method for processing a video signal including a current block using an AF mode.

[0174] First, the video signal processing apparatus can generate a candidate list of motion vector pairs using motion vectors of pixels or blocks neighboring at least two control points of the current block (S1010). Here, the control points can refer to corner pixels of the current block, and the motion vector pairs can include motion vectors of a top-left corner pixel and a top-right corner pixel of the current block.

[0175] In one embodiment, the control points can include at least two of a top-left corner pixel, a top-right corner pixel, a bottom-left corner pixel, and a bottom-right corner pixel, and the candidate list can include pixels or blocks neighboring the top-left corner pixel, the top-right corner pixel, and the bottom-left corner pixel.

[0176] In one embodiment, the candidate list can be generated based on motion vectors of diagonal neighboring pixels A, upper neighboring pixels B, and left neighboring pixels C of the top-left corner pixel, motion vectors of upper neighboring pixels D and diagonal neighboring pixels E of the top-right corner pixel, and motion vectors of left neighboring pixels F and diagonal neighboring pixels G of the bottom-left corner pixel.

[0177] In an embodiment, the aforementioned method can further include the step of adding an AMVP candidate list to the candidate list when the number of motion vector pairs included in the candidate list is less than 2.

[0178] In an embodiment, when the size of the current block is N4, the control point motion vectors of the current block can be determined as motion vectors derived based on centers of left and right sub-blocks in the current block, and when the size of the current block is 4xN, the control point motion vectors of the current block can be determined as motion vectors derived based on centers of upper and lower sub-blocks of the current block.

[0179] In an embodiment, when the size of the current block is Nx4, the control point motion vectors of the left sub-block in the current block are determined by an average of the first and third control point motion vectors, and the control point motion vectors of the right sub-block are determined by an average of the second and fourth control point motion vectors, whereas when the size of the current block is 4xN, the control point motion vectors of the upper sub-block in the current block are determined by an average of the first and second control point motion vectors, and the control point motion vectors of the lower sub-block are determined by an average of the third and fourth control point motion vectors.

[0180] In another embodiment, the aforementioned method can signal prediction mode or flag information indicating whether the AF mode is performed.

[0181] In this case, the video signal processing apparatus can receive the prediction mode or the flag information, perform the AF mode according to the prediction mode or the flag information, and derive the motion vector according to the AF mode. Here, the AF mode denotes a mode of deriving the motion vector in units of pixels or sub-blocks using the control point motion vectors of the current block.

[0182] Meanwhile, the video signal processing apparatus can determine a final candidate list of a predetermined number of motion vector pairs based on the divergence values of the motion vector pairs (S1020). Here, the final candidate list is determined in an ascending order of the divergence values, and the divergence value refers to a value indicating similarity of a direction of a motion vector.

[0183] The video signal processing apparatus can determine a control point motion vector of the current block based on rate-distortion costs from the final candidate list (S1030).

[0184] The video signal processing apparatus can generate a motion vector predictor of the current block based on the control point motion vector (S1040).

[0185] Figure 11 is a flowchart illustrating a procedure of adaptively determining an optimal encoding mode based on at least one of AF4 mode and AF6 mode as an embodiment (1-1) to which the disclosure is applied.

[0186] The video signal processing apparatus can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S1110). Here, the merge mode can include the aforementioned AF merge mode as well as a normal merge mode, and the inter mode can include the aforementioned AF inter mode as well as a normal inter mode.

[0187] The video signal processing apparatus can perform motion vector prediction based on at least one of AF4 mode and AF6 mode (S1120). Here, the step S1110 and the step S1120 are not limited to the order thereof.

[0188] The video signal processing apparatus can determine an optimal encoding mode from the aforementioned modes by comparing results of the step S1120 (S1130). Here, the results of the step S1120 can be compared based on rate-distortion costs.

[0189] Then, the video signal processing apparatus can generate a motion vector predictor of the current block based on the optimal encoding mode, and obtain a motion vector difference by subtracting the motion vector predictor from a motion vector of the current block.

[0190] Thereafter, the encoding / decoding procedures described in Figure 1 and Figure 2 may be equally applied.

[0191] Figure 12 is a flowchart illustrating a procedure of adaptively performing decoding based on AF4 mode or AF6 mode as an embodiment (1-2) to which the disclosure is applied.

[0192] The decoder can receive a bitstream (S1210). The bitstream can include information about a coding mode of a current block in a video signal.

[0193] The decoder can check whether the coding mode of the current block is an AF mode (S1220). Here, the AF mode refers to an affine motion prediction mode using an affine motion model, and can include at least one of an affine merge mode and an affine inter mode, for example, and the affine inter mode can include at least one of an AF4 mode and an AF6 mode.

[0194] Here, step S1220 can be checked by an affine flag indicating whether the AF mode is performed. For example, the affine flag can be denoted by affine_flag. When affine_flag = 1, this indicates that the AF mode is performed for the current block. When affine_flag = 0, this indicates that the AF mode is not performed for the current block.

[0195] When the AF mode is not performed for the current block, the decoder can perform decoding (i.e., motion vector prediction) according to a coding mode other than the AF mode (S1230). For example, a skip mode, a merge mode, or an inter mode can be used.

[0196] When the AF mode is performed for the current block, the decoder can check whether the AF4 mode is applied to the current block (S1240).

[0197] Here, step S1240 can be checked by an affine parameter flag indicating whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters). For example, the affine parameter flag can be denoted by affine_param_flag. When affine_param_flag = 0, this indicates that motion vector prediction is performed according to the AF4 mode (S1250). When affine_param_flag = 1, this indicates that motion vector prediction is performed according to the AF6 mode (S1260). However, the present disclosure is not limited thereto.

[0198] For example, the affine parameter flag can include at least one of an AF4_flag and an AF6_flag.

[0199] The AF4_flag indicates whether the AF4 mode is performed for the current block. When AF4_flag = 1, the AF4 mode is performed for the current block; when AF4_flag = 0, the AF4 mode is not performed for the current block. Here, performing the AF4 mode means performing motion vector prediction using an affine motion model represented by four parameters.

[0200] The AF6_flag indicates whether the AF6 mode is performed for the current block. When the AF6_flag = 1, the AF6 mode is performed for the current block, and when the AF6_flag = 0, the AF6 mode is not performed for the current block. Here, performing the AF6 mode means performing the motion vector prediction using the affine motion model represented by four parameters.

[0201] The affine flag and the affine parameter flag can be defined at at least one level of a slice, a maximum coding unit, a coding unit, and a prediction unit.

[0202] For example, at least one of the AF_flag, the AF4_flag, and the AF6_flag can be defined at a slice level, and additionally defined at a block level or a prediction unit level.

[0203] Figure 13 A syntax structure to which Embodiment (1-3) of the disclosure is applied is shown, in which decoding is performed based on the AF4 mode or the AF6 mode.

[0204] The decoder can obtain the merge_flag and check whether the merge mode is applied to the current block (S1310).

[0205] When the merge mode is not applied to the current block, the decoder can obtain the affine_flag (S1320). Here, the affine_flag indicates whether the AF mode is performed.

[0206] When the affine_flag = 1, that is, when the AF mode is performed for the current block, the decoder can obtain the affine_param_flag (S1330). Here, the affine_param_flag indicates whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters).

[0207] When the affine_param_flag = 0, that is, when the motion vector prediction is performed according to the AF4 mode, the decoder can obtain two motion vector differences, mvd_CP0 and mvd_CP1 (S1340). Here, the mvd_CP0 indicates a motion vector difference with respect to the control point 0, and the mvd_CP1 indicates a motion vector difference with respect to the control point 1.

[0208] When the affine_param_flag = 1, that is, when the motion vector prediction is performed according to the AF6 mode, the decoder can obtain three motion vector differences, mvd_CP0, mvd_CP1, and mvd_CP2 (S1350).

[0209] Figure 14is a flowchart illustrating a process of adaptively determining an optimal coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode as an embodiment (2-1) to which the disclosure is applied.

[0210] The encoder can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S1410).

[0211] The encoder can check whether a condition A is satisfied for the current block in order to determine an optimal coding mode for motion vector prediction (S1420).

[0212] Here, the condition A can refer to a condition regarding a block size. For example, the following Table 1 embodiment can be applied.

[0213] [Table 1]

[0214] Condition A TH1 value Example 1 pixNum(=width*height) > TH1 TH1 = 64, 128, 256, 512, 1024,... Example 2 width > TH1 && height > TH1 TH1 = 4, 8, 16, 32,... Example 3 width > TH1 || height > TH1 TH1 = 4, 8, 16, 32,...

[0215] In example 1 of Table 1, the condition A indicates whether the number of pixels pixNum of the current block is greater than a threshold TH1. Here, the threshold can be 64, 128, 256, 512, 1024, …. For example, TH1=64 indicates that the block size is 4x16, 8x8, or 16x4, and TH1=128 indicates that the block size is 32x4, 16x8, 8x16, or 4x32.

[0216] Example 2 indicates whether the width and the height of the current block are both greater than the threshold TH1.

[0217] Example 3 indicates whether the width of the current block is greater than the threshold TH1 or whether the height of the current block is greater than the threshold TH1.

[0218] When the condition A is satisfied, the encoder can perform motion vector prediction based on at least one of the AF4 mode and the AF6 mode (S1430).

[0219] The encoder can determine the optimal coding mode from among the motion vector prediction modes including the AF4 mode or the AF6 mode by comparing the results of steps S1410 and S1430 (S1440).

[0220] On the other hand, when the condition A is not satisfied, the encoder can determine the optimal coding mode from among modes other than the AF mode (S1440).

[0221] Then, the encoder can generate a motion vector predictor of the current block based on the optimal coding mode and obtain a motion vector difference by subtracting the motion vector predictor from the motion vector of the current block.

[0222] Thereafter, the following can be equally applied Figure 1 and Figure 2The encoding / decoding process described in the specification.

[0223] Figure 15 FIG. 2-2 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on a condition A, which is an embodiment to which the disclosure is applied.

[0224] The decoder can receive a bitstream (S1510). The bitstream can include information on a coding mode of a current block in a video signal.

[0225] The decoder can check whether a condition A is satisfied for the current block in order to determine an optimal coding mode for motion vector prediction (S1520). Here, the condition A can refer to a condition on a block size. For example, the embodiment of Table 1 above can be applied.

[0226] When the condition A is satisfied, the decoder can check whether the coding mode of the current block is an AF mode (S1530). Here, the AF mode refers to an affine motion prediction mode using an affine motion model, and the embodiment described in the specification can be applied.

[0227] Here, step S1530 can be checked by an affine flag indicating whether the AF mode is performed. For example, the affine flag can be denoted by affine_flag. When affine_flag = 1, this indicates that the AF mode is performed for the current block. When affine_flag = 0, this indicates that the AF mode is not performed for the current block.

[0228] When the condition A is not satisfied or the AF mode is not performed for the current block, the decoder can perform decoding (i.e., motion vector prediction) according to a coding mode other than the AF mode (S1540). For example, a skip mode, a merge mode, or an inter mode can be used.

[0229] When the AF mode is performed for the current block, the decoder can check whether an AF4 mode is applied to the current block (S1550).

[0230] Here, step S1550 can be checked by an affine parameter flag indicating whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters). For example, the affine parameter flag can be denoted by affine_param_flag. When affine_param_flag = 0, this indicates that motion vector prediction is performed according to the AF4 mode (S1560). When affine_param_flag = 1, this indicates that motion vector prediction is performed according to the AF6 mode (S1570). However, the disclosure is not limited thereto.

[0231] Figure 16FIG. 13 illustrates a syntax structure as an embodiment (2-3) to which the disclosure is applied, in which decoding is performed according to an AF4 mode or an AF6 mode based on a condition A.

[0232] The decoder can obtain the merge_flag and check whether the merge mode is applied to the current block (S1610).

[0233] When the merge mode is not applied to the current block, the decoder can check whether a condition A is satisfied (S1620). Here, the condition A can refer to a condition regarding a block size. For example, the embodiment of Table 1 can be applied.

[0234] When the condition A is satisfied, the decoder can obtain the affine_flag (S1620). Here, the affine_flag indicates whether the AF mode is performed.

[0235] When affine_flag = 1, that is, when the AF mode is performed on the current block, the decoder can obtain the affine_param_flag (S1630). Here, the affine_param_flag indicates whether the AF4 mode is performed (or whether affine motion prediction is performed using four parameters).

[0236] When affine_param_flag = 0, that is, when the motion vector prediction is performed according to the AF4 mode, the decoder can obtain two motion vector differences, mvd_CP0 and mvd_CP1 (S1640). Here, mvd_CP0 indicates a motion vector difference with respect to a control point 0, and mvd_CP1 indicates a motion vector difference with respect to a control point 1.

[0237] In addition, when affine_param_flag = 1, that is, when the motion vector prediction is performed according to the AF6 mode, the decoder can obtain three motion vector differences, mvd_CP0, mvd_CP1, and mvd_CP2 (S1650).

[0238] Figure 17 FIG. 14 is a flowchart illustrating a process of adaptively determining an optimal coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode, as an embodiment (3-1) to which the disclosure is applied.

[0239] The disclosure provides a method for adaptively selecting an AF4 mode and an AF6 mode based on a size of a current block.

[0240] For example, one more motion vector difference is additionally transmitted in the AF6 mode than in the AF4 mode, and thus the AF6 mode is effective for a larger block. Accordingly, when the size of the current block is less than (or equal to or less than) a predetermined size, encoding can be performed considering only the AF4 mode; when the size of the current block is equal to or greater than (or greater than) the predetermined size, encoding can be performed considering only the AF6 mode.

[0241] Meanwhile, in a domain where only one of the AF4 mode and the AF6 mode is not determined to be clearly advantageous, both the AF4 mode and the AF6 mode are considered, and only the mode that is best between the two can be signaled.

[0242] Reference Figure 17 The encoder can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S1710).

[0243] The encoder can check whether a condition B is satisfied for the current block (S1720). Here, the condition B can refer to a condition regarding a block size. For example, the following Table 2 embodiment can be applied.

[0244] [Table 2]

[0245] Condition B TH2 value Example 1 pixNum(=width*height) < TH2 TH2 = 64, 128, 256, 512, 1024,... Example 2 width < TH2 && height < TH2 TH2 = 4, 8, 16, 32,... Example 3 width < TH2 || height < TH2 TH2 = 4, 8, 16, 32,...

[0246] In example 1 of Table 2, the condition B indicates whether the number of pixels pixNum of the current block is less than a threshold TH2. Here, the threshold can be 64, 128, 256, 512, 1024,.... For example, TH2=64 can indicate that the block size is 4x16, 8x8, or 16x4, and TH2=128 can indicate that the block size is 32x4, 16x8, 8x16, or 4x32.

[0247] Example 2 indicates whether the width and the height of the current block are both less than the threshold TH2.

[0248] Example 3 indicates whether the width of the current block is less than the threshold TH2 or whether the height of the current block is less than the threshold TH2.

[0249] When the condition B is satisfied, the encoder can perform motion vector prediction based on the AF4 mode (S1730).

[0250] When the condition B is not satisfied, the encoder can check whether a condition C is satisfied for the current block (S1740). Here, the condition C can refer to a condition regarding a block size. For example, the following Table 3 embodiment can be applied.

[0251] [Table 3]

[0252] Condition C TH3 value Example 1 pixNum(=width*height) >= TH3 TH3 = 64, 128, 256, 512, 1024,... Example 2 width >= TH3 && height >= TH3 TH3 = 4, 8, 16, 32,... Example 3 width >= TH3 || height >= TH3 TH3 = 4, 8, 16, 32,...

[0253] In example 1 of Table 3, condition A indicates whether the number of pixels pixNum of the current block is equal to or greater than a threshold TH3. Here, the threshold can be 64, 128, 256, 512, 1024,.... For example, TH3 = 64 can indicate that the block size is 4x16, 8x8, or 16x4, and TH3 = 128 can indicate that the block size is 32x4, 16x8, 8x16, or 4x32.

[0254] Example 2 indicates whether the width and height of the current block are both equal to or greater than the threshold TH3.

[0255] Example 3 indicates whether the width of the current block is equal to or greater than the threshold TH1 or whether the height of the current block is equal to or greater than the threshold TH1.

[0256] When condition C is satisfied, the encoder can perform motion vector prediction based on the AF6 mode (S1760).

[0257] When condition C is not satisfied, the encoder can perform motion vector prediction based on the AF4 mode and the AF6 mode (S1750).

[0258] Meanwhile, in conditions B and C, the thresholds TH2 and TH3 can be determined to satisfy the following Equation 5.

[0259] [Equation 5]

[0260] TH_2 ≤ TH_3

[0261] The encoder can determine the best encoding mode from among the motion vector prediction modes including the AF4 mode or the AF6 mode by comparing the results of steps S1710, S1730, S1750, and S1760 (S1770).

[0262] Then, the encoder can generate a motion vector predictor of the current block based on the best encoding mode and obtain a motion vector difference by subtracting the motion vector predictor from the motion vector of the current block.

[0263] Thereafter, the encoding / decoding processes described in Figure 1 and Figure 2 may be equally applied.

[0264] Figure 18 is a flowchart illustrating a process of adaptively performing decoding according to the AF4 mode or the AF6 mode based on at least one of conditions B and C as an embodiment (3-2) to which the disclosure is applied.

[0265] The decoder can check whether the coding mode of the current block is the AF mode (S1810). Here, the AF mode refers to an affine motion prediction mode using an affine motion model, and embodiments described in the specification can be applied, and redundant descriptions are omitted.

[0266] When the AF mode is performed on the current block, the decoder can check whether condition B is satisfied for the current block (S1820). Here, condition B can refer to a condition regarding the block size. For example, embodiments of Table 2 can be applied, and redundant descriptions are omitted.

[0267] When condition B is satisfied, the decoder can perform motion vector prediction based on the AF4 mode (S1830).

[0268] When condition B is not satisfied, the decoder can check whether condition C is satisfied for the current block (S1840). Here, condition C can refer to a condition regarding the block size. For example, embodiments of Table 3 can be applied, and redundant descriptions are omitted.

[0269] Meanwhile, in conditions B and C, the threshold values TH2 and TH3 can be determined so that they satisfy Equation 5.

[0270] When condition C is satisfied, the decoder can perform motion vector prediction based on the AF6 mode (S1860).

[0271] When condition C is not satisfied, the decoder can check whether the AF4 mode is applied to the current block (S1850).

[0272] Here, step S1850 can be checked by an affine parameter flag indicating whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters).

[0273] For example, the affine parameter flag can be denoted by affine_param_flag. When affine_param_flag = 0, this can mean that motion vector prediction is performed according to the AF4 mode (S1830). When affine_param_flag = 1, this can mean that motion vector prediction is performed according to the AF6 mode (S1860). However, the present disclosure is not limited thereto.

[0274] Meanwhile, when the AF mode is not performed on the current block, the decoder can perform decoding (i.e., motion vector prediction) according to a coding mode other than the AF mode (S1870). For example, a skip mode, a merge mode, or an inter mode can be used.

[0275] Figure 19FIG. 13 illustrates a syntax structure in which decoding is performed according to an AF4 mode or an AF6 mode based on at least one of a condition B and a condition C, as an embodiment (3-3) to which the disclosure is applied.

[0276] The decoder can obtain the merge_flag and check whether the merge mode is applied to the current block (S1910).

[0277] When the merge mode is not applied to the current block, the decoder can obtain the affine_flag (S1920). Here, the affine_flag indicates whether the AF mode is performed.

[0278] When the affine_flag = 1, that is, when the AF mode is performed on the current block, the decoder can check whether the condition B is satisfied (S1920). Here, the condition B can refer to a condition regarding a block size. For example, the embodiment of Table 2 can be applied.

[0279] When the condition B is satisfied, the decoder can set the affine_param_flag to 0 (S1930). Here, the affine_param_flag indicates whether the AF4 mode is performed (or whether affine motion prediction is performed using four parameters). The affine_param_flag = 0 indicates that motion vector prediction is performed according to the AF4 mode.

[0280] When the condition B is not satisfied and the condition C is satisfied, the decoder can set the affine_param_flag to 1 (S1940). Here, the affine_param_flag = 1 indicates that motion vector prediction is performed according to the AF6 mode.

[0281] When neither the condition B nor the condition C is satisfied, the decoder can obtain the affine_param_flag (S1950).

[0282] When the affine_param_flag = 0, the decoder can obtain two motion vector differences, mvd_CP0 and mvd_CP1 (S1960).

[0283] When the affine_param_flag = 1, the decoder can obtain three motion vector differences, mvd_CP0, mvd_CP1, and mvd_CP2 (S1970).

[0284] Figure 20 FIG. 13 illustrates a syntax structure in which decoding is performed according to an AF4 mode or an AF6 mode based on at least one of a condition B and a condition C, as an embodiment (3-3) to which the disclosure is applied.

[0285] The encoder can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S2010).

[0286] The encoder can check whether a neighboring block has been coded in the AF mode (S2020). Here, whether the neighboring block has been coded in the AF mode can be represented by isNeighborAffine(). For example, when isNeighborAffine() = 0, this can indicate that the neighboring block has not been coded in the AF mode. When isNeighborAffine() = 1, this can indicate that the neighboring block has been coded in the AF mode.

[0287] When the neighboring block has not been coded in the AF mode, the encoder can perform motion vector prediction based on the AF4 mode (S2030).

[0288] When the neighboring block has been coded in the AF mode, the encoder can perform motion vector prediction based on the AF4 mode, and can also perform motion vector prediction based on the AF6 mode (S2040).

[0289] The encoder can determine the best coding mode from among the motion vector prediction modes including the AF4 mode or the AF6 mode by comparing the results of steps S2030 and S2040 (S2050).

[0290] Then, the encoder can generate a motion vector predictor of the current block based on the best coding mode, and obtain a motion vector difference by subtracting the motion vector predictor from a motion vector of the current block.

[0291] Thereafter, the encoding / decoding processes described in Figure 1 and Figure 2 may be equally applied.

[0292] Figure 21 is a flowchart illustrating a process of adaptively performing decoding according to the AF4 mode or the AF6 mode based on a neighboring block-based coding mode, which is an embodiment (4-2) to which the disclosure is applied.

[0293] The decoder can receive a bitstream (S2110). The bitstream can include information about a coding mode of a current block in a video signal.

[0294] The decoder can check whether the coding mode of the current block is the AF mode (S2120).

[0295] When the AF mode is not performed on the current block, the decoder can perform decoding (i.e., motion vector prediction) according to a coding mode other than the AF mode (S2170). For example, a skip mode, a merge mode, or an inter mode can be used.

[0296] When the AF mode is performed on the current block, the decoder can check whether a neighboring block has been coded in the AF mode (S2130). Here, whether the neighboring block has been coded in the AF mode can be represented by isNeighborAffine(). For example, when isNeighborAffine() = 0, this can indicate that the neighboring block has not been coded in the AF mode. When isNeighborAffine() = 1, this can indicate that the neighboring block has been coded in the AF mode.

[0297] When the neighboring block has been coded in the AF mode, the decoder can perform motion vector prediction based on the AF4 mode (S2140).

[0298] When the neighboring block has not been coded in the AF mode, the decoder can check whether the AF4 mode is applied to the current block (S2150).

[0299] Here, step S2150 can be checked by an affine parameter flag indicating whether the AF4 mode is performed (or whether affine motion prediction is performed using four parameters). For example, the affine parameter flag can be represented by affine_param_flag. When affine_param_flag = 0, motion vector prediction is performed according to the AF4 mode (S2140). When affine_param_flag = 1, motion vector prediction is performed according to the AF6 mode (S2160).

[0300] Figure 22 FIG. 13 illustrates a syntax structure to which embodiments (4-3) of the disclosure are applied, in which decoding is performed according to the AF4 mode or the AF6 mode based on a coded mode of a neighboring block.

[0301] The decoder can obtain merge_flag and check whether the merge mode is applied to the current block (S2210).

[0302] When the merge mode is not applied to the current block, the decoder can obtain affine_flag (S2220). Here, the affine_flag indicates whether the AF mode is performed.

[0303] When affine_flag = 1, that is, when the AF mode is performed on the current block, the decoder can check whether a neighboring block has been coded in the AF mode (S2230).

[0304] When the neighboring block has been coded in the AF mode, the decoder can obtain affine_param_flag (S2230). Here, the affine_param_flag indicates whether the AF4 mode is performed (or whether affine motion prediction is performed using four parameters).

[0305] When the neighboring block is not coded in the AF mode, the decoder can set affine_param_flag to 0 (S2240).

[0306] When affine_param_flag = 0, that is, when motion vector prediction is performed according to the AF4 mode, the decoder can obtain two motion vector differences mvd_CP0 and mvd_CP1 (S2250).

[0307] When affine_param_flag = 1, that is, when motion vector prediction is performed according to the AF6 mode, the decoder can obtain three motion vector differences mvd_CP0, mvd_CP1, and mvd_CP2 (S2260).

[0308] Figure 23 is a flowchart illustrating a process of adaptively determining an optimal coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode based on at least one of Condition A, Condition B, and Condition C, which is an embodiment to which the disclosure is applied (5-1).

[0309] The disclosure provides an embodiment of a combination of the second embodiment and the third embodiment. Figure 23 An example in which all of Conditions A, B, and C are considered and the conditions can be applied in different orders is illustrated.

[0310] Referring to Figure 23 , the encoder can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S2310).

[0311] The encoder can check whether Condition A is satisfied for the current block (S2320). Here, Condition A can be a condition regarding a block size, and the embodiment of Table 1 above can be applied thereto.

[0312] When Condition A is satisfied, the encoder can determine an optimal coding mode from among modes other than the AF mode (S2330).

[0313] On the other hand, when Condition A is not satisfied, the encoder can check whether Condition B is satisfied for the current block (S2330). Here, Condition B can refer to a condition regarding a block size, and the embodiment of Table 2 above can be applied thereto.

[0314] When Condition B is satisfied, the encoder can perform motion vector prediction based on the AF4 mode (S2340).

[0315] When condition B is not satisfied, the encoder can check whether condition C is satisfied for the current block (S2350). Here, condition C can refer to a condition regarding the block size, and the embodiment of Table 3 can be applied thereto.

[0316] When condition C is satisfied, the encoder can perform motion vector prediction based on the AF6 mode (S2370).

[0317] When condition C is not satisfied, the encoder can perform motion vector prediction based on the AF4 mode, and can perform motion vector prediction based on the AF6 mode (S2360).

[0318] Meanwhile, in condition B and condition C, the threshold values TH2 and TH3 can be determined so that they satisfy Equation 5.

[0319] The encoder can determine the best coding mode by comparing the results of steps S2310, S2340, S2360, and S2370 (2380).

[0320] Then, the encoder can generate a motion vector predictor for the current block based on the best coding mode, and obtain a motion vector difference by subtracting the motion vector predictor from the motion vector of the current block.

[0321] Thereafter, the encoding / decoding processes described in Figure 1 to Figure 2 may be equally applied.

[0322] Figure 24 is a flowchart illustrating a process of adaptively performing decoding according to the AF4 mode or the AF6 mode based on at least one of condition A, condition B, and condition C, which is an embodiment (5-2) to which the disclosure is applied.

[0323] The decoder can check whether condition A is satisfied for the current block (S2410). Here, condition A can refer to a condition regarding the block size. For example, the embodiment of Table 1 above can be applied thereto.

[0324] When condition A is satisfied, the decoder can check whether the coding mode of the current block is the AF mode (S2420). Here, the AF mode refers to an affine motion prediction mode using an affine motion model, and the embodiments described in the specification can be applied, and a redundant description is omitted.

[0325] When condition A is not satisfied or the AF mode is not performed for the current block, the decoder can perform decoding (i.e., motion vector prediction) according to a coding mode other than the AF mode (S2480). For example, a skip mode, a merge mode, or an inter mode can be used.

[0326] When the AF mode is performed for the current block, the decoder checks whether a condition B is satisfied for the current block (S2430). Here, the condition B can refer to a condition regarding the block size. For example, the embodiment of Table 2 can be applied thereto, and a redundant description is omitted.

[0327] When the condition B is satisfied, the decoder can perform motion vector prediction based on the AF4 mode (S2440).

[0328] When the condition B is not satisfied, the decoder can check whether a condition C is satisfied for the current block (S2450). Here, the condition C can refer to a condition regarding the block size. For example, the embodiment of Table 3 can be applied thereto, and a redundant description is omitted.

[0329] Meanwhile, in the condition B and the condition C, the threshold values TH2 and TH3 can be determined so that they satisfy Equation 5.

[0330] When the condition C is satisfied, the decoder can perform motion vector prediction based on the AF6 mode (S2470).

[0331] When the condition C is not satisfied, the decoder can check whether the AF4 mode is applied to the current block (S2460).

[0332] Here, the step S2460 can be checked by an affine parameter flag indicating whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters).

[0333] For example, the affine parameter flag can be denoted by affine_param_flag. When affine_param_flag = 0, this can indicate that the motion vector prediction is performed according to the AF4 mode (S2440). When affine_param_flag = 1, this can indicate that the motion vector prediction is performed according to the AF6 mode (S2470). However, the disclosure is not limited thereto.

[0334] Figure 25 FIG. 13 illustrates a syntax structure as an embodiment (5-3) to which the disclosure is applied, in which decoding is performed according to the AF4 mode or the AF6 mode based on at least one of the condition A, the condition B, and the condition C.

[0335] The decoder can obtain the merge_flag and check whether the merge mode is applied to the current block (S2510).

[0336] When the merge mode is not applied to the current block, the decoder can check whether the condition A is satisfied (S2520). Here, the condition A can refer to a condition regarding the block size. For example, the embodiment of Table 1 above can be applied thereto.

[0337] When condition A is satisfied, the decoder can obtain affine_flag (S2520). Here, affine_flag indicates whether the AF mode is performed.

[0338] When affine_flag = 1, that is, when the AF mode is performed for the current block, the decoder can check whether condition B is satisfied (S2530). Here, condition B can refer to a condition regarding a block size. For example, the embodiment of Table 2 can be applied thereto.

[0339] When condition B is satisfied, the decoder can set affine_param_flag to 0 (S2540). Here, affine_param_flag indicates whether the AF4 mode is performed (or whether the affine motion prediction is performed using four parameters). affine_param_flag = 0 indicates that the motion vector prediction is performed according to the AF4 mode.

[0340] When condition B is not satisfied and condition C is satisfied, the decoder can set affine_param_flag to 1 (S2550). Here, affine_param_flag = 1 indicates that the motion vector prediction is performed according to the AF6 mode.

[0341] When both condition B and condition C are not satisfied, the decoder can obtain affine_param_flag (S2560).

[0342] When affine_param_flag = 0, the decoder can obtain two motion vector differences mvd_CP0 and mvd_CP1 (S2570).

[0343] When affine_param_flag = 1, the decoder can obtain three motion vector differences mvd_CP0, mvd_CP1, and mvd_CP2 (S2580).

[0344] Figure 26 is a flowchart illustrating a process of adaptively determining an optimal coding mode from among motion vector prediction modes including an AF4 mode or an AF6 mode in a condition A and neighboring block-based coding mode to which an embodiment (6-1) of the disclosure is applied.

[0345] The encoder can perform prediction based on at least one of a skip mode, a merge mode, and an inter mode (S2610).

[0346] The encoder can check whether condition A is satisfied for the current block (S2620). Here, condition A can refer to a condition regarding a block size, and the embodiment of Table 1 above can be applied thereto.

[0347] When condition A is satisfied, the encoder can determine the best coding mode from among modes other than the AF mode (S2660).

[0348] On the other hand, when condition A is not satisfied, the encoder can check whether a neighboring block has been coded in the AF mode (S2630). Here, whether the neighboring block is coded in the AF mode can be represented by isNeighborAffine(). For example, when isNeighborAffine() = 0, this can indicate that the neighboring block is not coded in the AF mode. When isNeighborAffine() = 1, this can indicate that the neighboring block has been coded in the AF mode.

[0349] When the neighboring block is not coded in the AF mode, the encoder can perform motion vector prediction based on the AF4 mode (S2640).

[0350] When the neighboring block has been coded in the AF mode, the encoder can perform motion vector prediction based on the AF4 mode, and can also perform motion vector prediction based on the AF6 mode (S2650).

[0351] The encoder can determine the best coding mode by comparing the results of steps S2610, S2640, and S2650 (S2660).

[0352] Then, the encoder can generate a motion vector predictor for the current block based on the best coding mode, and obtain a motion vector difference by subtracting the motion vector predictor from the motion vector of the current block.

[0353] Thereafter, the encoding / decoding processes described in Figure 1 and Figure 2 may be equally applied.

[0354] Figure 27 is a flowchart illustrating a process of adaptively performing decoding according to the AF4 mode or the AF6 mode in a coding mode based on at least one of condition A and a neighboring block, which is an embodiment (6-2) to which the disclosure is applied.

[0355] The decoder can receive a bitstream (S2710). The bitstream can include information about a coding mode of a current block in a video signal.

[0356] The decoder can check whether condition A is satisfied for the current block in order to determine the best coding mode for motion vector prediction (S2720). Here, condition A can refer to a condition about a block size. For example, the above embodiment of Table 1 can be applied thereto.

[0357] When condition A is satisfied, the decoder can check whether the coding mode of the current block is an AF mode (S2730).

[0358] In Figure 21 The details described in S2120 to S2170 of the above embodiment can be applied to the following steps S2730 to S2780, and a redundant description is omitted.

[0359] Figure 28 FIG. is a flowchart illustrating a process of generating a motion vector predictor based on at least one of an AF4 mode and an AF6 mode as an embodiment to which the disclosure is applied.

[0360] The decoder can obtain a merge_flag and check whether a merge mode is applied to the current block (S2810).

[0361] When the merge mode is not applied to the current block, the decoder can check whether condition A is satisfied (S2820). Here, condition A can refer to a condition regarding a block size. For example, the above embodiment of Table 1 can be applied thereto.

[0362] When condition A is satisfied, the decoder can obtain an affine_flag (S2820). Here, the affine_flag indicates whether an AF mode is performed.

[0363] In Figure 22 The details described in S2230 to S2260 of the above embodiment can be applied to the following steps S2830 to S2860, and a redundant description is omitted.

[0364] Figure 29 is a flowchart illustrating a process of generating a motion vector predictor based on at least one of an AF4 mode and an AF6 mode as an embodiment to which the disclosure is applied.

[0365] The decoder can check whether an AF mode is applied to the current block (S2910). Here, the AF mode denotes a motion prediction mode using an affine motion model.

[0366] For example, the decoder can acquire an affine flag from a video signal and check whether the AF mode is applied to the current block based on the affine flag.

[0367] When the AF mode is applied to the current block, the decoder can check whether an AF4 mode is used (S2920). Here, the AF4 mode denotes a mode in which four parameters constituting an affine motion model are used to predict a motion vector.

[0368] For example, when the affine flag indicates that the AF mode is applied to the current block, the decoder can obtain the affine parameter flag from the video signal, and the affine parameter flag indicates whether the motion vector predictor is generated using four parameters or using six parameters.

[0369] Here, the affine flag and the affine parameter flag can be defined at at least one level of a slice, a maximum coding unit, a coding unit, and a prediction unit.

[0370] When the AF4 mode is used, the decoder can generate the motion vector predictor using four parameters, and when the AF4 mode is not used, the decoder can generate the motion vector predictor using six parameters constituting an affine motion model (S2930).

[0371] The decoder can obtain the motion vector of the current block based on the motion vector predictor (S2940).

[0372] In one embodiment, the decoder can check whether the size of the current block satisfies a predetermined condition. Here, the predetermined condition indicates whether at least one of the number of pixels in the current block, the width, and / or the height of the current block is greater than a predetermined threshold.

[0373] For example, when the size of the current block satisfies the predetermined condition, the decoder can check whether the AF mode is applied to the current block.

[0374] On the other hand, when the size of the current block does not satisfy the predetermined condition, the current block can be decoded based on a coding mode other than the AF mode.

[0375] In one embodiment, when the AF mode is applied to the current block, the decoder can check whether the AF mode has been applied to a neighboring block.

[0376] When the AF mode has been applied to the neighboring block, the motion vector predictor is generated using four parameters, and when the AF mode has not been applied to the neighboring block, the decoder can perform the step of checking whether the AF4 mode is used.

[0377] Figure 30 is a flowchart illustrating a process of generating a motion vector predictor based on AF4_flag and AF6_flag, to which embodiments of the disclosure are applied.

[0378] The decoder can obtain at least one of an AF4 flag and an AF6 flag from a video signal (S3010). Here, the AF4_flag indicates whether the AF4 mode is performed on the current block, and the AF6_flag indicates whether the AF6 mode is performed on the current block.

[0379] Here, at least one of the AF4_flag and the AF6_flag can be defined at a slice level, and additionally defined at a block level or a prediction unit level. However, the present disclosure is not limited thereto, and at least one of the AF4_flag and the AF6_flag can be defined at at least one level of a slice, a largest coding unit, a coding unit, and a prediction unit.

[0380] The decoder can check values of the AF4_flag and the AF6_flag (S3020).

[0381] When the AF4_flag = 1, the AF4 mode is performed for the current block, and when the AF4_flag = 0, the AF4 mode is not performed for the current block. Here, performing the AF4 mode means performing motion vector prediction using an affine motion model represented by four parameters.

[0382] When the AF6_flag = 1, the AF6 mode is performed for the current block, and when the AF6_flag = 0, the AF6 mode is not performed for the current block. Here, performing the AF6 mode means performing motion vector prediction using an affine motion model represented by four parameters.

[0383] When the AF4_flag = 0 and the AF6_flag = 0, the decoder can perform motion vector prediction according to a mode other than the AF4 mode and the AF6 mode (S3030).

[0384] When the AF4_flag = 1 and the AF6_flag = 0, the decoder can perform motion vector prediction according to the AF4 mode (S3040).

[0385] When the AF4_flag = 0 and the AF6_flag = 0, the decoder can perform motion vector prediction according to the AF6 mode (S3050).

[0386] When the AF4_flag = 1 and the AF6_flag = 1, the decoder can perform motion vector prediction according to the AF4 mode or the AF6 mode (S3060).

[0387] Figure 31 is a flowchart illustrating a process of adaptively performing decoding according to an AF4 mode or an AF6 mode based on whether a neighboring block has been coded in an AF mode, as an embodiment to which the present disclosure is applied.

[0388] The decoder can check whether an AF mode is applied to a current block (S3110).

[0389] When the AF mode is applied to the current block, the decoder can check whether a neighboring block has been coded in an AF mode (S3120).

[0390] When the neighboring block is coded in the AF mode, the decoder can obtain at least one of AF4_flag and AF6_flag (S3130).

[0391] The decoder can generate a motion vector predictor using four parameters or six parameters based on at least one of AF4_flag and AF6_flag (S3140). For example, when AF4_flag = 1, the decoder can perform motion vector prediction according to the AF4 mode, and when AF6_flag = 1, can perform motion vector prediction according to the AF6 mode.

[0392] The decoder can obtain a motion vector of the current block based on the motion vector predictor (S3150).

[0393] Figure 32 FIG. illustrates a syntax to which embodiments of the disclosure are applied, in which decoding is adaptively performed based on AF4_flag and AF6_flag.

[0394] The decoder can obtain AF4_flag and AF6_flag at a slice level (S3010). Here, AF4_flag indicates whether the AF4 mode is performed on a current block, and AF6_flag indicates whether the AF6 mode is performed on the current block. AF4_flag can be represented by affine_4_flag, and AF6_flag can be represented by affine_6_flag.

[0395] The decoder can adaptively perform decoding at a block level or a prediction unit level based on AF4_flag and AF6_flag.

[0396] When affine_4_flag is not 0 or affine_6_flag is not 0 (that is, in a case other than affine_4_flag = 0 && affine_6_flag = 0), the decoder can obtain an affine flag (S3220). The affine flag can indicate whether the AF mode is performed.

[0397] When the AF mode is performed, the decoder can adaptively perform decoding according to the values of AF4_flag and AF6_flag.

[0398] When affine_4_flag = 1 && affine_6_flag = 0, the decoder can set affine_param_flag to 0. That is, affine_param_flag = 0 indicates that the AF4 mode is performed.

[0399] When affine_4_flag = 0 && affine_6_flag = 1, the decoder can set affine_param_flag to 1. That is, affine_param_flag = 1 indicates that the AF6 mode is performed.

[0400] When affine_4_flag = 1 && affine_6_flag = 1, the decoder can parse or obtain affine_param_flag. Here, the decoder can perform decoding in the AF4 mode or the AF6 mode according to the value of affine_param_flag at the block level or the prediction unit level.

[0401] The above-described embodiments can be applied to other syntax structures, and redundant descriptions are omitted.

[0402] Figure 33 A syntax to which embodiments of the disclosure are applied is illustrated, in which decoding is adaptively performed in the AF4 mode or the AF6 mode based on whether a neighboring block has been coded in the AF mode.

[0403] In the present embodiment, the above description can be applied to redundant parts in Figure 32 to Figure 33 and only different parts are described.

[0404] When affine_4_flag = 1 && affine_6_flag = 1, the decoder can check whether a neighboring block has been coded in the AF mode.

[0405] When the neighboring block has been coded in the AF mode, the decoder can parse or obtain affine_param_flag (S3310). Here, the decoder can perform decoding in the AF4 mode or the AF6 mode according to the value of affine_param_flag at the block level or the prediction unit level.

[0406] On the other hand, when the neighboring block has not been coded in the AF mode, the decoder can set affine_param_flag to 0. That is, affine_param_flag = 0 indicates that the AF4 mode is performed.

[0407] Figure 34 A video coding system to which the disclosure is applied is illustrated.

[0408] The video coding system can include a source device and a receiving device. The source device can transmit encoded video / image information or data in a file or stream format to the receiving device through a digital storage medium or a network.

[0409] The source device can include a video source, an encoding apparatus, and a transmitter. The receiving device can include a receiver, a decoding apparatus, and a renderer. The encoding apparatus can be referred to as a video / image encoding apparatus, and the decoding apparatus can be referred to as a video / image decoding apparatus. The transmitter can be included in the encoding apparatus. The receiver can be included in the decoding apparatus. The renderer can include a display, and the display can be configured in the form of a separate device or an external component.

[0410] The video source can obtain a video / image through video / image capturing, composition, generation, etc. The video source can include a video / image capturing device and / or a video / image generating device. For example, the video / image capturing device can include one or more cameras, a video / image archive including previously captured video / images, etc. The video / image generating device can include, for example, a computer, a tablet, a smart phone, etc., and (electronically) generate a video / image. For example, a virtual video / image can be generated through a computer, etc., and in this case, a video / image capturing process can be replaced by a process of generating relevant data.

[0411] The encoding apparatus can encode a video / image. The encoding apparatus can perform a series of processes such as prediction, transform, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

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

[0413] The decoding apparatus can decode a video / image by performing a series of processes such as inverse quantization, inverse transform, and prediction corresponding to the operations of the encoding apparatus.

[0414] The renderer can render the decoded video / image. The rendered video / image can be displayed through a display.

[0415] Figure 35 A content streaming system to which the disclosure is applied is illustrated.

[0416] Reference Figure 35 The content streaming system to which the disclosure is applied can include an encoding server, a streaming server, a web (Web) server, a media storage, a user device, and a multimedia input device.

[0417] The encoding server serves to compress content input from a multimedia input device such as a smartphone, a camera, and a camcorder into digital content to generate a bitstream and transmit the bitstream to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, and a camcorder directly generates a bitstream, the encoding server can be omitted.

[0418] A bitstream can be generated by applying the encoding method or the bitstream generation method of the present disclosure, and the streaming server can temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0419] The streaming server serves to transmit multimedia data to a user device based on a user request through a web server, and the web server serves as a medium to inform a 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 multimedia data to the user. Here, the content streaming system can include an additional control server. In this case, the control server serves to control commands / responses between devices in the content streaming system.

[0420] The streaming server can receive content from a media storage and / or an encoding server. For example, when receiving content from the encoding server, the streaming server can receive the content in real time. In this case, the streaming server can store a bitstream for a predetermined time in order to facilitate provision of a smooth streaming service.

[0421] Examples of the user device can include a cellular phone, a smartphone, a laptop computer, a digital broadcasting terminal, a PDA (Personal Digital Assistant), a PMP (Portable Multimedia Player), a navigation system, a slate PC, a tablet PC, an ultrabook, a wearable device (for example, a smartwatch, smartglasses, and an HMD (Head-Mounted Display)), a digital TV, a desktop computer, a digital signage, etc.

[0422] The servers in the content streaming system can operate as distributed servers. In this case, data received by the servers can be processed in a distributed manner.

[0423] As described above, the embodiments described in the present disclosure can be implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in Figure 1 , Figure 2 , Figure 34 and Figure 35 can be implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip.

[0424] Further, the decoder and the encoder according to the present disclosure can be included in a multimedia broadcast transmission / reception apparatus, a mobile communication terminal, a home theater video apparatus, a digital theater video apparatus, a surveillance camera, a video chat apparatus, a real-time communication apparatus such as a video communication, a mobile streaming apparatus, a storage medium, a camcorder, a VoD service providing apparatus, an Internet streaming service providing apparatus, a three-dimensional (3D) video apparatus, a teleconference video apparatus, and a medical video apparatus, and can be used to process a video signal and a data signal

[0425] Further, the decoding / encoding method according to the present disclosure can be produced in the form of a program to be executed by a computer, 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 in which data readable by a computer system is stored. For example, the computer-readable recording medium can include a BD, a USB, a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. Further, the computer-readable recording medium includes a medium implemented in the form of a carrier wave, such as transmission over the Internet. Further, a bitstream generated by the encoding method can be stored in a computer-readable recording medium or can be transmitted through a wired / wireless communication network.

[0426]

INDUSTRIAL APPLICABILITY

[0427] Exemplary embodiments of the present disclosure have been disclosed for illustrative purposes, and those skilled in the art can improve, alter, replace, or add various other embodiments within the technical spirit and scope of the present disclosure disclosed in the appended claims.

Claims

1. A method for decoding a video signal comprising a current block based on an affine motion prediction mode, the method comprising: obtaining a merge flag from the video signal, wherein the merge flag indicates whether motion parameters are inferred from a neighboring block; checking whether a width and a height of the current block are equal to or larger than a predetermined value based on that motion parameters are not inferred from the neighboring block; obtaining an affine flag from the video signal based on that the width and the height of the current block are larger than the predetermined value, wherein the affine flag indicates whether an AF mode is applied to the current block, and the AF mode indicates a motion prediction mode using an affine motion model; obtaining an affine parameter flag based on the AF mode applied to the current block, the affine parameter flag indicating whether 4 parameters or 6 parameters are used for the affine motion model; obtaining a motion vector predictor based on that 4 parameters or 6 parameters are used for the affine motion model; and obtaining prediction samples for the current block based on the motion vector predictor, wherein the affine parameter flag is obtained based on that the width and the height of the current block are larger than the predetermined value, wherein the predetermined value is 16.

2. The method of claim 1, wherein, the affine flag and the affine parameter flag are defined at CU level.

3. The method of claim 1, wherein, decoding the current block based on a coding mode other than the AF mode based on that the width and the height of the current block are smaller than the predetermined value.

4. A method for encoding a video signal comprising a current block based on an affine motion prediction mode, the method comprising: generating a merge flag indicating whether motion parameters are inferred from a neighboring block; checking whether a width and a height of the current block are equal to or larger than a predetermined value based on that motion parameters are not inferred from the neighboring block; generating an affine flag from the video signal based on that the width and the height of the current block are larger than the predetermined value, wherein the affine flag indicates whether an AF mode is applied to the current block, and the AF mode indicates a motion prediction mode using an affine motion model; generating an affine parameter flag based on the AF mode applied to the current block, the affine parameter flag indicating whether 4 parameters or 6 parameters are used for the affine motion model; obtaining a motion vector predictor based on that 4 parameters or 6 parameters are used for the affine motion model; and generating prediction samples for the current block based on the motion vector predictor, wherein the affine parameter flag is generated based on that the width and the height of the current block are larger than the predetermined value, wherein the predetermined value is 16.

5. The method of claim 4, wherein, the affine flag and the affine parameter flag are defined at CU level.

6. The method of claim 4, wherein, encoding the current block based on a coding mode other than the AF mode based on that the width and the height of the current block are smaller than the predetermined value.

7. An apparatus for decoding a video signal comprising a current block based on an affine motion prediction mode, the apparatus comprising an inter prediction unit configured to: obtain a merge flag from the video signal, wherein the merge flag indicates whether motion parameters are inferred from a neighboring block; checking whether a width and a height of the current block are equal to or larger than a predetermined value based on that no motion parameters are inferred from the neighboring blocks; generating an affine flag from the video signal based on that the width and the height of the current block are larger than the predetermined value, wherein the affine flag indicates whether an AF mode is applied to the current block, and the AF mode indicates a motion prediction mode using an affine motion model; generating an affine parameter flag based on the AF mode applied to the current block, the affine parameter flag indicating whether 4 parameters or 6 parameters are used for the affine motion model; obtaining a motion vector predictor based on that 4 parameters or 6 parameters are used for the affine motion model; and generating prediction samples for the current block based on the motion vector predictor, wherein the affine parameter flag is generated based on that the width and the height of the current block are larger than the predetermined value, wherein the predetermined value is 16.

8. The apparatus of claim 7, wherein, the affine flag and the affine parameter flag are defined at a CU level.

9. The apparatus of claim 7, wherein, decoding the current block based on a coding mode other than the AF mode based on that the width and the height of the current block are smaller than the predetermined value.

10. An apparatus for encoding a video signal comprising a current block based on an affine motion prediction mode, the apparatus comprising an inter prediction unit configured to: generate a merge flag indicating whether motion parameters are inferred from neighboring blocks; check whether a width and a height of the current block are equal to or larger than a predetermined value based on that no motion parameters are inferred from the neighboring blocks; generate an affine flag from the video signal based on that the width and the height of the current block are larger than the predetermined value, wherein the affine flag indicates whether an AF mode is applied to the current block, and the AF mode indicates a motion prediction mode using an affine motion model; generate an affine parameter flag based on the AF mode applied to the current block, the affine parameter flag indicating whether 4 parameters or 6 parameters are used for the affine motion model; obtain a motion vector predictor based on that 4 parameters or 6 parameters are used for the affine motion model; and generate prediction samples for the current block based on the motion vector predictor, wherein the affine parameter flag is generated based on that the width and the height of the current block are larger than the predetermined value, wherein the predetermined value is 16.

11. The apparatus of claim 10, wherein, the affine flag and the affine parameter flag are defined at a CU level.

12. The apparatus of claim 10, wherein, decode the current block based on a coding mode other than the AF mode based on that the width and the height of the current block are smaller than the predetermined value.

13. A computer readable storage medium having stored thereon a computer program and a bitstream, wherein, The computer program, which when executed by a processor, implements the encoding method of any one of claims 4-6 to generate the bitstream.

Citation Information

Patent Citations

  • Image prediction method and relevant device

    CN104539966A

  • Method and apparatus for encoding and decoding video signal using motion compensation based on affine transformation

    US20100329347A1