Method and apparatus for image encoding / decoding
An image encoding/decoding method that performs inter-frame prediction using affine transformations utilizes four control point motion vectors for image prediction, solving the problem of high data transmission and storage costs for high-resolution images and achieving efficient image compression and decoding.
Patent Information
- Application Number
- CN202480034311.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-21
- Filing Date
- 2024-04-16
- Publication Date
- 2025-12-19
AI Technical Summary
With the increasing demand for high-resolution and high-quality images, the cost of transmitting and storing existing image data is rising, necessitating efficient image compression technologies to reduce data volume.
An image encoding/decoding method that uses affine transformation to perform inter-frame prediction predicts by determining the four control point motion vectors (CPMV) of the current block and generating a bit stream during the encoding process.
It effectively compresses and decodes image data, reducing transmission and storage costs and improving encoding efficiency.
Smart Images

Figure CN121176019A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to an image encoding / decoding method and apparatus, and more particularly, to an image encoding / decoding method and apparatus performing inter prediction according to an affine transform. BACKGROUND
[0002] Recently, in various application fields, the demand for high-resolution, high-quality images such as high definition (HD) images and ultra high definition (UHD) images is increasing. As the resolution and quality of image data become higher, the amount of data relatively increases compared to existing image data. Accordingly, when transmitting image data using a medium such as an existing wired and wireless broadband line or storing image data using an existing storage medium, the transmission and storage costs increase. To solve these problems that occur as the resolution and quality of image data become higher, a high-efficiency image compression technique for images can be utilized.
[0003] As an image compression technique, there are various techniques such as an inter prediction technique of predicting pixel values included in a current picture from pictures before or after the current picture, an intra prediction technique of predicting pixel values included in a current picture using pixel information within the current picture, and an entropy encoding technique of assigning a short code to a value having a high occurrence frequency and a long code to a value having a low occurrence frequency. Using these image compression techniques, image data can be efficiently compressed and transmitted or stored.
[0004] Meanwhile, as the demand for high-resolution images increases, as a new image service, the demand for stereoscopic image content increases. Video compression techniques are being discussed to efficiently provide high-resolution and ultra high-resolution stereoscopic image content. SUMMARY
[0005] TECHNICAL PROBLEM
[0006] An object of the present application is to provide an image encoding / decoding method and apparatus performing inter prediction according to an affine transform.
[0007] Another object of the present application is to provide a recording medium for storing a bitstream generated by the image encoding method or apparatus of the present application.
[0008] The technical problems solved by the present application are not limited to the above technical problems, and other technical problems not described herein can be clearly understood by those skilled in the art to which the present application pertains from the following description.
[0009] TECHNICAL SOLUTION
[0010] In the present disclosure, a video decoding method is provided, which comprises: determining that a current block is predicted by an affine model; determining four control point motion vectors (CPMVs) of the current block; and predicting the current block according to the four CPMVs.
[0011] According to one embodiment, determining the four CPMVs of the current block can comprise: when a prediction mode of the current block is a merge mode, determining a merge candidate list comprising at least one of a spatial merge candidate, a temporal merge candidate or a combined merge candidate of the current block; and determining the four CPMVs of the current block according to a merge candidate selected from the merge candidate list of the current block.
[0012] According to one embodiment, determining the merge candidate list of the current block can comprise: when a spatial neighboring block of the current block is predicted by the affine model, determining a spatial merge candidate of the current block according to CPMVs of the spatial neighboring block of the current block; and when a temporal corresponding block of the current block is predicted by the affine model, determining a temporal merge candidate of the current block according to CPMVs of the temporal corresponding block of the current block.
[0013] According to one embodiment, determining the spatial merge candidate of the current block can comprise: when three CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first CPMV, a second CPMV and a third CPMV of the spatial merge candidate from the three CPMVs; and deriving a fourth CPMV of the spatial merge candidate from the first CPMV, the second CPMV and the third CPMV of the spatial merge candidate.
[0014] According to one embodiment, deriving the fourth CPMV of the spatial merge candidate can comprise: determining a predictor of the fourth CPMV according to the first CPMV, the second CPMV and the third CPMV of the spatial merge candidate; determining a difference value of the fourth CPMV; and deriving the fourth CPMV from the predictor of the fourth CPMV and the difference value.
[0015] According to one embodiment, determining the spatial merge candidate of the current block can comprise: when two CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first CPMV and a second CPMV of the spatial merge candidate from the two CPMVs; and deriving a third CPMV and a fourth CPMV of the spatial merge candidate from the first CPMV and the second CPMV of the spatial merge candidate.
[0016] According to an embodiment, deriving the third and fourth CPMVs of the spatial merge candidate can include determining a predictor of the third and fourth CPMVs from the first and second CPMVs of the spatial merge candidate, determining a difference value of the third CPMV and a difference value of the fourth CPMV, and deriving the third CPMV from the predictor and the difference value of the third CPMV and deriving the fourth CPMV from the predictor and the difference value of the fourth CPMV.
[0017] According to an embodiment, determining the merge candidate list of the current block can include extracting a plurality of motion vectors from spatially neighboring blocks and temporally corresponding blocks of the current block, and determining a combined merge candidate by combining the plurality of motion vectors.
[0018] According to an embodiment, extracting the plurality of motion vectors can include deriving a first CPMV, a second CPMV, and a third CPMV from a plurality of spatially neighboring blocks of the current block, and deriving a fourth CPMV from a temporally corresponding block corresponding to a center position or a lower right position of the current block.
[0019] According to an embodiment, extracting the plurality of motion vectors can include deriving a first CPMV, a second CPMV, and a third CPMV from a plurality of spatially neighboring blocks and temporally corresponding blocks of the current block, and deriving a fourth CPMV from the first, second, and third CPMVs.
[0020] According to an embodiment, deriving the fourth CPMV can include determining a predictor block of the fourth CPMV from the first, second, and third CPMVs, determining a difference value of the fourth CPMV, and deriving the fourth CPMV based on the predictor and the difference value of the fourth CPMV.
[0021] According to an embodiment, determining the fourth CPMV of the current block can include, when a prediction mode of the current block is a motion vector prediction (MVP) mode, determining an MVP candidate list including at least one of a spatial MVP candidate of the current block, a temporal MVP block, or a combined MVP candidate, and determining the four CPMVs of the current block from an MVP candidate selected from the MVP candidate list of the current block.
[0022] According to an embodiment, determining the MVP candidate list of the current block can include, when spatially neighboring blocks of the current block are predicted by an affine model, determining a spatial MVP candidate of the current block from CPMVs of the spatially neighboring blocks of the current block, and when a temporally corresponding block of the current block is predicted by the affine model, determining a temporal MVP candidate of the current block from CPMVs of the temporally corresponding block of the current block.
[0023] According to one embodiment, determining the spatial MVP candidate of the current block can include: determining, from three CPMVs of spatially neighboring blocks, a first control point motion vector predictor (CPMVP), a second CPMVP, and a third CPMVP of the spatial MVP candidate when three CPMVs of the spatially neighboring blocks are used for prediction of the spatially neighboring blocks; and deriving a fourth CPMVP of the spatial MVP candidate from the first CPMVP, the second CPMVP, and the third CPMVP of the spatial MVP candidate.
[0024] According to one embodiment, determining the spatial MVP candidate of the current block can include: determining, from three CPMVs of spatially neighboring blocks, a first control point motion vector predictor (CPMVP), a second CPMVP, and a third CPMVP of the spatial MVP candidate when three CPMVs of the spatially neighboring blocks are used for prediction of the spatially neighboring blocks; and deriving a fourth CPMVP of the spatial MVP candidate from the first CPMVP, the second CPMVP, and the third CPMVP of the spatial MVP candidate.
[0025] According to one embodiment, determining the MVP candidate list of the current block can include: extracting a plurality of motion vectors from spatially neighboring blocks and temporally corresponding blocks of the current block; and determining a combined MVP candidate by combining the plurality of motion vectors.
[0026] According to one embodiment, extracting the plurality of motion vectors can include: deriving a first CPMVP, a second CPMVP, and a third CPMVP from the plurality of spatially neighboring blocks of the current block; and deriving a fourth CPMVP from a temporally corresponding block corresponding to a center position or a lower right position of the current block.
[0027] According to one embodiment, extracting the plurality of motion vectors can include: deriving a first CPMVP, a second CPMVP, and a third CPMVP from the plurality of spatially neighboring blocks of the current block; and deriving a fourth CPMVP from the first CPMVP, the second CPMVP, and the third CPMVP.
[0028] In the present disclosure, a video encoding method is provided, which includes: determining that a current block is predicted by an affine model; determining four CPMVs of the current block; and encoding the four CPMVs, and predicting the current block according to the four CPMVs.
[0029] According to one embodiment, it can be determined whether a prediction mode of a current block is a merge mode or a MVP mode.
[0030] According to one embodiment, if the prediction mode of the current block is the merge mode, a merge candidate list including at least one of a spatial merge candidate, a temporal merge candidate, or a combined merge candidate of the current block can be determined. According to one embodiment, the merge candidate list of the current block can be determined according to the embodiments discussed in the decoding method of one embodiment of the present disclosure.
[0031] According to one embodiment, information indicating a merge candidate in the merge candidate list of the current block can be encoded. In addition, a difference value of a fourth CPMV for determining a fourth CPMV applied to the merge candidate of the current block can be encoded. In addition, according to an embodiment, a difference value of a third CPMV for determining a third CPMV applied to the merge candidate of the current block can be further encoded.
[0032] According to one embodiment, when the prediction mode of the current block is the MVP mode, an MVP candidate list including at least one of a spatial MVP candidate, a temporal MVP block, or a combined MVP candidate of the current block can be determined. According to one embodiment, the MVP candidate list of the current block can be determined according to the embodiments discussed in the decoding method of one embodiment of the present disclosure.
[0033] According to one embodiment, information indicating an MVP candidate from the MVP candidate list of the current block can be encoded. In addition, four difference values indicating a difference between four CPMVs applied to the current block and four CPMVPs of the MVP candidate can be encoded.
[0034] In the present disclosure, a data transmission method of transmitting image data is provided, the data transmission method including: generating a bitstream by encoding image data based on an image encoding method according to an embodiment of the present disclosure; and transmitting the generated bitstream.
[0035] In the present disclosure, a computer-readable recording medium storing a bitstream generated by an image encoding method according to an embodiment of the present disclosure is provided.
[0036] Advantageous Effects
[0037] According to the present disclosure, an image encoding / decoding method and apparatus performing inter prediction according to affine transformation can be provided.
[0038] In addition, according to the present disclosure, a method and apparatus for transmitting or storing a bitstream generated by an image encoding method / apparatus according to the present disclosure can be provided.
[0039] In addition, according to the present disclosure, a computer-readable recording medium storing a bitstream generated by an image encoding method / apparatus according to the present disclosure can be provided.
[0040] In addition, by the image encoding method / apparatus according to the present application, image data can be efficiently encoded and decoded. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 is a schematic diagram showing a configuration of an image encoding apparatus.
[0042] Figure 2 is an exemplary diagram showing an embodiment of a prediction unit of an image encoding apparatus.
[0043] Figure 3 shows a block to which a 4-parameter affine motion model is applied.
[0044] Figure 4 shows a block to which a 6-parameter affine motion model is applied.
[0045] Figure 5 shows a block from which a fourth CPMV, MV3, is additionally derived in the 6-parameter affine motion model.
[0046] Figure 6 shows pixel positions referred to in generating a merge candidate list in a current block.
[0047] Figure 7 shows a spatial merge candidate derived from a left neighboring block.
[0048] Figure 8 shows a spatial merge candidate derived from an upper neighboring block.
[0049] Figure 9 shows a flowchart of a video decoding method of the present application.
[0050] Figure 10 shows a flowchart of a video encoding method of the present application.
[0051] Figure 11 shows a method of deriving six CPMVs of two partitions of a current block from one neighboring block.
[0052] Figure 12 shows a method of deriving six CPMVs of two partitions of a current block from two neighboring blocks.
[0053] Figure 13 shows a first prediction block, a second prediction block, and a final prediction block obtained by summing them.
[0054] Figure 14 shows an embodiment of a weight of each sample used in the calculation of the final prediction block.
[0055] Figure 15An embodiment in which a low pass filter is applied to samples at a partition boundary of a current block is shown.
[0056] Figure 16 An embodiment in which a low pass filter is applied to samples at a partition boundary of a current block and samples adjacent to the current partition boundary is shown.
[0057] Best mode
[0058] In the disclosure, a video decoding method is provided, including determining that a current block is predicted by an affine model, determining four control point motion vectors (CPMVs) of the current block, and predicting the current block according to the four CPMVs. DETAILED DESCRIPTION
[0059] Hereinafter, embodiments of the present application will be described in detail with reference to accompanying drawings so as to be easily carried out by those skilled in the art. However, the present application can be implemented in various different forms and is not limited to the embodiments described herein. Also, in the drawings, parts irrelevant to the description are omitted for the sake of clarity of the present application, and like parts are designated by like reference numerals throughout the specification.
[0060] Throughout the specification, when a part is referred to as being "connected" to another part, it not only includes the case where they are directly connected, but also the case where they are electrically connected with another element in between.
[0061] Also, throughout the specification, whenever a part is referred to as "including" a component, it does not mean that other components are excluded, but it means that other components can be further included, unless otherwise specified.
[0062] Also, although terms such as first, second, etc. can be used to describe various components, the components should not be limited by the terms. The terms are only used to distinguish one component from another component.
[0063] Also, in the embodiments of the apparatus and method described herein, some components of the apparatus or some steps of the method can be omitted. In addition, the order of some components of the apparatus or some steps of the method can be changed. Furthermore, other components or steps can be inserted into some components of the apparatus or some steps of the method.
[0064] In addition, some components or steps in the first embodiment of the present application can be added to the second embodiment of the present application, or some components or steps in the second embodiment can be replaced.
[0065] Also, components shown in the embodiments of the present application are independently shown to represent different characteristic functions, and this does not mean that each component is composed of a separate hardware or a single software component. That is, each component is described by listing each component for convenience of explanation, and at least two components among the components can be combined to form a single component, or a single component can be divided into a plurality of components to perform functions. Such integration and separate implementation of each component are also included in the scope of the present application as long as the essence of the present application is not deviated.
[0066] First, terms used in the present application are briefly explained as follows.
[0067] The decoding apparatus (video decoding apparatus) described below can be an apparatus included in a server terminal such as a civil security camera, a civil security system, a military security camera, a military security system, a personal computer (PC), a laptop computer, a portable multimedia player (PMP), a wireless communication terminal, a smart phone, a TV application server, a service server, etc., and can refer to various apparatuses including a user terminal such as various devices, a communication device such as a communication modem for communication with a wired or wireless communication network, a memory for storing various programs and data for decoding a video or performing inter prediction or intra prediction for decoding, and a microprocessor for executing programs for calculation and control.
[0068] Also, the image encoded into a bitstream by the encoder can be transmitted to an image decoding apparatus in real time or non-real time through a wired or wireless communication network such as the Internet, a local area network, a wireless LAN, a WiBro network, a mobile communication network, etc., or through various communication interfaces such as a cable or a universal serial bus (USB), and can be decoded, reconstructed into an image, and played back. Alternatively, the bitstream generated by the encoder can be stored in a memory. The memory can include both a volatile memory and a non-volatile memory. In the present specification, the memory can be denoted as a recording medium storing the bitstream.
[0069] Generally, a video can be composed of a series of pictures, and each picture can be divided into coding units such as blocks. Also, it will be understood by those of ordinary skill in the art to which the present embodiments belong that the term picture described below can be replaced with other terms having equivalent meanings such as an image, a frame, etc. Also, it will be understood by those of ordinary skill in the art to which the present embodiments belong that the term coding unit can be replaced with other terms having equivalent meanings such as a unit block, a block, etc.
[0070] Hereinafter, the embodiments of the present application will be described in greater detail with reference to the accompanying drawings. In describing the present application, repeated description of the same components will be omitted.
[0071] Figure 1 is a schematic diagram showing a configuration of an image encoding apparatus.
[0072] The image encoding apparatus 100 can include an image partitioning unit 101, an intra prediction unit 102, an inter prediction unit 103, a subtractor 104, a transform unit 105, a quantization unit 106, an entropy encoding unit 107, an inverse quantization unit 108, an inverse transform unit 109, an adder 110, a filter unit 111, and a memory 112.
[0073] In order to select the best information in each apparatus, RD-Cost (Rate Distortion Cost) can be compared. The RD-Cost refers to a cost value calculated using distortion information between an original block and a reconstructed block and an amount of bits generated during prediction mode transmission. At this time, SAD (Sum of Absolute Difference), SATD (Sum of Absolute Transformed Difference), SSE (Sum of Squared Error) can also be used to calculate the cost value.
[0074] Figure 1 The components shown in FIG. 1 are independently shown to indicate different feature functions in the image encoding apparatus, and do not mean that each component is composed of a separate hardware or a single software configuration unit. That is, for convenience of explanation, each component is listed and included as a separate component, and at least two of the components can be combined to form a single component, or one component can be divided into a plurality of components to perform functions, and such integration and separate implementation of each component is also included in the scope of the present application as long as it does not depart from the essence of the present application.
[0075] In addition, some components can not be essential components to perform essential functions of the present application, but can be optional components for improving performance only. The present application can be implemented by including only components necessary to implement the essence of the present application without including components for improving performance only, and a structure including only essential components without including optional components for improving performance only is also included in the scope of the present application.
[0076] The image segmentation unit 100 can segment an input image into at least one block. At this time, the input image can have various shapes and sizes, such as a picture, a slice, a tile, and a segment. The block can mean a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The segmentation can be performed based on at least one of a quad tree, a binary tree, or a ternary tree. The quad tree is a method of dividing a parent block into four sub-blocks, the width and height of which are half of the parent block. The binary tree is a method of dividing a parent block into two sub-blocks, the width or height of which is half of the parent block. The ternary tree is a method of dividing a parent block into three sub-blocks based on the width or height. Through the segmentation based on the binary tree and the ternary tree described above, the block can not only have a square shape but also have a non-square shape.
[0077] The prediction units 102 and 103 can include an inter-prediction unit 103 that performs inter-prediction and an intra-prediction unit 102 that performs intra-prediction. It can be determined whether to use inter-prediction or intra-prediction for a prediction unit, and it can be determined specific information according to each prediction method (e.g., an intra-prediction mode, a motion vector, a reference picture, etc.). At this time, the processing unit that performs prediction and the processing unit that determines the prediction method and the details can be different. For example, the prediction method and the prediction mode can be determined in the prediction unit, and the prediction can be performed in the transform unit.
[0078] A residual value (a residual block) between the generated prediction block and the original block can be input to the transform unit 105. In addition, prediction mode information, motion vector information, etc. for prediction can be encoded together with the residual value by the entropy encoding unit 107 and transmitted to the decoder. In the case of using a specific encoding mode, the original block can also be encoded as it is and transmitted to the decoding unit without generating a prediction block through the prediction units 102 and 103.
[0079] The intra-prediction unit 102 can generate a prediction block based on reference pixel information (which is pixel information within a current picture) around a current block. If the prediction mode of a neighboring block of the current block for which intra-prediction is to be performed is inter-prediction, the reference pixel included in the neighboring block to which inter-prediction is applied can be replaced with a reference pixel within another neighboring block to which intra-prediction is applied. That is, if the reference pixel is not available, the unavailable reference pixel information can be used by replacing the unavailable reference pixel information with at least one of the available reference pixel information.
[0080] In intra-prediction, the prediction mode can have a directional prediction mode using reference pixel information according to a prediction direction and a non-directional mode not using direction information. The mode for predicting luminance information and the mode for predicting chrominance information can be different. To predict chrominance information, the intra-prediction mode information or the prediction luminance signal information used to predict luminance information can be utilized.
[0081] The intra prediction unit 102 can include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a filter that filters reference pixels of a current block, and can be adaptively determined whether to apply the filter according to a prediction mode of a current prediction unit. If the prediction mode of the current block is a mode in which the AIS filtering is not performed, the AIS filter can not be applied.
[0082] The reference pixel interpolation unit of the intra prediction unit 102 can interpolate reference pixels to generate reference pixels at a fractional unit position when the intra prediction mode of the prediction unit is a mode in which intra prediction is performed based on pixel values obtained by interpolating the reference pixels. When the prediction mode of the current prediction unit is a prediction mode in which the prediction block is generated without interpolating the reference pixels, the reference pixels can not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter can generate the prediction block by filtering.
[0083] The inter prediction unit 103 generates a prediction block using a previously reconstructed reference picture and motion information stored in the memory 112. The motion information can include, for example, a motion vector, a reference picture index, a list 1 prediction flag, a list 0 prediction flag, etc.
[0084] A residual block including residual value information, which is a difference value between the prediction blocks generated in the prediction units 102 and 103 and the original block, can be generated. The generated residual block can be input to the transform unit 105 and transformed.
[0085] The inter prediction unit 103 can derive a prediction block based on information about at least one of a previous picture or a next picture of a current picture. In addition, the prediction block of the current block can also be derived based on information about a portion of the current picture that has already been encoded. The inter prediction unit 103 according to an embodiment of the present application can include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0086] The reference picture interpolation unit can receive reference picture information from the memory 112 and generate pixel information smaller than an integer pixel from the reference picture. In the case of a luminance pixel, an 8-tap interpolation filter based on DCT with different filter coefficients can be used to generate pixel information smaller than an integer pixel in units of 1 / 4 pixel. In the case of a chrominance signal, a 4-tap interpolation filter based on DCT with different filter coefficients can be used to generate pixel information smaller than an integer pixel in units of 1 / 8 pixel.
[0087] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full Search Based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three Step Search Algorithm) can be used as a method of calculating a motion vector. Based on the interpolated pixel, the motion vector can have a motion vector value in units of 1 / 2 or 1 / 4 pixel. The motion prediction unit can predict a prediction block of the current block by using different motion prediction methods. Various methods such as a skip method, a merge method, and an advanced motion vector prediction (AMVP) method can be used as a motion prediction method.
[0088] The subtractor 104 subtracts the current block to be encoded from the prediction block generated from the intra prediction unit 102 or the inter prediction unit 103 to generate a residual block of the current block.
[0089] The transform unit 105 can transform the residual block including the residual data using a transform method such as DCT, DST, KLT (Karhunen Loeve Transform), etc. At this time, the transform method can be determined based on the intra prediction mode of the prediction unit used to generate the residual block. For example, according to the intra prediction mode, DCT can be used in the horizontal direction, and DST can be used in the vertical direction. Alternatively, according to the aspect ratio, size, etc. of the current block, different transform techniques can be used in the horizontal and vertical directions.
[0090] The quantization unit 106 can quantize the values transformed into the frequency domain by the transform unit 105. The quantization coefficient can vary according to the block or importance of the image. The values generated by the quantization unit 106 can be provided to the inverse quantization unit 108 and the entropy encoding unit 107.
[0091] The transform unit 105 and / or the quantization unit 106 can be optionally included in the image encoding apparatus 100. That is, the image encoding apparatus 100 can encode the residual block by performing at least one of transform or quantization on the residual data of the residual block, or skipping both the transform and the quantization. Even in the case where neither the transform nor the quantization is performed in the image encoding apparatus 100, or neither the transform nor the quantization is performed, the block input to the entropy encoding unit 107 is generally referred to as a transform block.
[0092] The entropy encoding unit 107 entropy-encodes the input data. The entropy encoding can use various encoding methods such as exponential Golomb, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC).
[0093] The entropy encoding unit 107 can encode various information, such as coefficient information of a transform block, block type information, prediction mode information, partition unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information. The coefficients of the transform block can be encoded in units of sub-blocks within the transform block.
[0094] For the encoding of the coefficients of the transform block, various syntax elements can be encoded, such as Last_sig, a syntax element indicating the position of the first non-zero coefficient in the reverse scan order, Coded_sub_blk_flag, a flag indicating whether there is at least one non-zero coefficient in a sub-block, Sig_coeff_flag, a flag indicating whether it is a non-zero coefficient, Abs_greater1_flag, a flag indicating whether the absolute value of the coefficient is greater than 1, Abs_greater2_flag, a flag indicating whether the absolute value of the coefficient is greater than 2, and Sign_flag, a flag indicating the sign of the coefficient. The remaining values of the coefficients not separately encoded by the syntax elements can be encoded by the syntax element remaining_coeff.
[0095] The inverse quantization unit 108 and the inverse transform unit 109 inverse quantize the values quantized in the quantization unit 106 and inverse transform the values transformed in the transform unit 105. The residual values generated in the inverse quantization unit 108 and the inverse transform unit 109 can be combined with the prediction units predicted by the motion estimation unit, the motion compensation unit, and the intra prediction unit 102 included in the prediction units 102 and 103 to generate a reconstructed block. The adder 110 adds the prediction block generated in the prediction units 102 and 103 and the residual block generated by the inverse transform unit 109 to generate a reconstructed block.
[0096] The filter unit 111 can include at least one of a deblocking filter, an offset correction unit, or an ALF (adaptive loop filter).
[0097] The deblocking filter can remove blocking distortion caused by the boundaries between blocks in a reconstructed picture. To determine whether to perform deblocking, whether to apply a deblocking filter to a current block can be determined based on pixels included in several columns or rows included in the block. When the deblocking filter is applied to the block, depending on the deblocking filter strength required, a strong filter or a weak filter can be applied. In addition, when the deblocking filter is applied, when vertical filtering and horizontal filtering are performed, horizontal filtering and vertical filtering can be processed in parallel.
[0098] The offset correction unit can correct the offset with respect to the original image pixel by pixel for the image for which deblocking has been performed. In order to perform offset correction for a specific picture, a method of dividing the pixels included in the image into a specific number of regions, determining a region in which offset is to be performed, and applying offset to the region, or a method of applying offset by considering edge information of each pixel can be used.
[0099] Adaptive loop filtering (ALF) can be performed based on a value obtained through a comparison between a filtered reconstructed image and an original image. After dividing the pixels included in the image into predetermined groups, a filter to be applied to the group is determined, and filtering can be performed differently for each group. In information related to whether ALF is applied, a luma signal can be transmitted for each coding unit (CU), and the shape of the ALF filter to be applied and the filter coefficients can vary according to each block. In addition, the same shape (fixed shape) of the ALF filter can be applied regardless of the characteristics of the target block.
[0100] The memory 112 can store the reconstructed block or picture calculated by the filter unit 111, and can provide the stored reconstructed block or picture to the prediction units 102 and 103 when inter prediction is performed.
[0101] Figure 2 is an exemplary diagram illustrating an embodiment of a prediction unit of an image encoding apparatus.
[0102] If the prediction mode of the current block is an intra prediction mode, the intra prediction unit 201 can generate reference pixels by deriving the reference pixels from the periphery of the current block and filtering the reference pixels. The reference pixels are determined using reconstructed pixels around the current block. If some of the reconstructed pixels are not available or do not exist around the current block, the unavailable regions can be filled with available reference pixels or filled with an intermediate value among a range of values that the pixels can have. After deriving all of the reference pixels, the reference pixels can be filtered using an adaptive intra smoothing (AIS) filter.
[0103] The intra prediction mode search unit 202 can determine one mode among M intra prediction modes, where M denotes the total number of intra prediction modes. The intra prediction modes include directional prediction modes and non-directional prediction modes.
[0104] The predicted block is generated using the determined prediction mode and the filtered reference pixels. The RD cost can be compared for each intra prediction mode to select the intra prediction mode having the lowest cost.
[0105] According to the method of deriving the motion information, the inter prediction unit 203 can be divided into a merge candidate search unit 204 and an AMVP candidate search unit 206. The merge candidate search unit 204 sets a reference block using inter prediction among blocks reconstructed around the current block as a merge candidate. The merge candidate is derived in the same manner in the encoding / decoding device, and the same number is used. The number of the merge candidates is transmitted from the encoding device to the decoding device, or a predetermined number is used. If the predetermined number of the merge candidates cannot be derived from the reference blocks reconstructed around the current block, motion information of a block existing at the same position as the current block in a picture other than the current picture can be used as the merge candidate. Alternatively, an insufficient merge candidate can be derived by combining motion information in the past direction and motion information in the future direction based on the current picture. Alternatively, a block at the same position in another reference picture can be set as the merge candidate.
[0106] The AMVP candidate search unit 206 determines the motion information of the current block from the motion estimation unit 207. The motion estimation unit 207 finds a prediction block most similar to the current block from the reconstructed picture.
[0107] When the inter prediction is performed, one of the merge candidate search unit 204 and the AMVP candidate search unit 206 is used to determine the motion information of the current block, and the motion compensation 208 generates a prediction block based on the determined motion information.
[0108] The present invention proposes a motion prediction / compensation technique based on an affine motion model based on a fractional pixel to improve inter prediction encoding according to motions such as scaling, rotation, and shearing.
[0109] The proposed method for motion prediction / compensation based on an affine motion model is applied to an inter prediction affine MVP mode and an affine merge mode of an encoder / decoder.
[0110] In addition, the proposed method for motion prediction / compensation based on an affine motion model is performed in units of a CU or a sub-CU (sub-block) to improve encoding efficiency.
[0111] In addition, a block to which the proposed method for motion prediction / compensation based on an affine motion model is applied has a size of W x H (W ≥ 4, H ≥ 4).
[0112] According to a CPMV (Control Point Motion Vector) used, the affine motion model can be divided into a 4-parameter affine motion model and a 6-parameter affine motion model. The 4-parameter affine motion model uses 4 parameters MV0 h , MV0 v , MV1 h , and MV1 vIn addition, the 6-parameter affine motion model uses 6 parameters MV0 h , MV0 v , MV1 h , MV1 v , MV2 h , and MV2 v .
[0113] Figure 3 A block to which the 4-parameter affine motion model is applied is shown.
[0114] In the current block 300, two CPMVs MV0 and MV1 are determined according to the 4-parameter affine motion model. MV0 is determined based on the (0, 0) position, and MV1 is determined based on the (W, 0) position. Then, (MV0 h , MV0 v ) is determined according to MV0, and (MV1 h , MV1 v ) is determined according to MV1. According to the affine model based on four parameters, pixels of the current block 300 can be inter-predicted.
[0115] The following Equation 1 to Equation 5 describe a method of calculating a motion vector of a current pixel according to the 4-parameter affine motion model. The 3x3 matrix in Equation 1 below represents an affine transformation. In addition, x and y represent the position of the current pixel, and x' and y' represent the position of a reference pixel referred to by the current pixel.
[0116] [Equation 1]
[0117] The following Equation 2 represents components (MV h , MV v ) of a motion vector MV, which represent the displacement between (x, y) and (x', y').
[0118] [Equation 2]
[0119] The following Equation 3 represents two CPMVs MV0 and MV1 applied to the 4-parameter affine motion model.
[0120] [Equation 3]
[0121] The following Equation 4 is a calculation formula of a, b, and e of Equation 2, which is determined according to Equation 2 and Equation 3.
[0122] [Equation 4]
[0123] The following formula 5 shows a calculation formula of the motion vector MV determined based on the formula 2 and the formula 4.
[0124] [Formula 5]
[0125] According to the formula 5, it can be seen that, according to the 4-parameter affine motion model, a scaling and rotation transformation is applied in the inter prediction of the block.
[0126] Figure 4 The block applying the 6-parameter affine motion model is shown.
[0127] In the current block 400, three CPMVs MV0, MV1 and MV2 are determined according to the six-parameter affine motion model. The MV0 is determined based on the (0, 0) position, the MV1 is determined based on the (W, 0) position, and the MV2 is determined based on the (0, H) position. Then, (MV0 h , MV0 v ) is determined according to the MV0, (MV1 h , MV1 v ) is determined according to the MV1, and (MV2 h , MV2 v ) is determined according to the MV2. According to the affine model based on the six parameters, the pixels of the current block 400 can be inter predicted.
[0128] The following formulas 6 to 10 describe a method of calculating the motion vector of the current pixel according to the 6-parameter affine motion model. The matrix of size 3x3 in the following formula 6 represents the affine transformation. In addition, x and y represent the position of the current pixel, and x' and y' represent the position of the reference pixel referenced by the current pixel.
[0129] [Formula 6]
[0130] The following formula 7 represents the components (MV h , MV v ) of the motion vector MV, which represent the displacement between (x, y) and (x', y').
[0131] [Formula 7]
[0132] The following formula 8 represents three CPMVs, MV0, MV1 and MV2, applied to the 6-parameter affine motion model.
[0133] [Formula 8]
[0134] The following Formula 9 is a calculation formula of a, b, c, d, e, and f of Formula 2, which is determined based on Formula 7 and Formula 8.
[0135] [Formula 9]
[0136] The following Formula 10 shows a calculation formula of a motion vector MV, which is determined based on Formula 7 and Formula 9.
[0137] [Formula 10]
[0138] According to Formula 10, it can be seen that scaling, rotation, and shearing transformations are applied in inter prediction of a block according to a 6-parameter affine motion model.
[0139] Figure 5 A block from which a fourth CPMV, MV3, is additionally derived in the 6-parameter affine motion model is shown.
[0140] A fourth CPMV MV3 is additionally determined for the current block 500. Additionally, MV3 is determined (MV3 h , MV3 v ) from MV0, MV1, and MV2 according to MV3. MV3 of the current block 500 can be derived from MV0, MV1, and MV2. Specifically, MV3 can be derived from MV0, MV1, and MV2 according to a corresponding position (W, H) of MV3.
[0141] In a video encoding process, MV3 can be determined by adjusting MV3' derived from MV0, MV1, and MV2. Here, MV3' can be calculated as "MV1 + MV2 - MV0". Then, among a plurality of motion vectors adjacent to MV3', a motion vector showing a most similar prediction result to the current block 500 can be determined as MV3.
[0142] The plurality of motion vectors are included in a predetermined integer pixel range 510 from MV3'. For x and y components, the predetermined integer pixel range 510 can be set to from -N to +N. Here, N is a positive integer. N can be set to 1, 2, 3, or a larger value. When N is large, the precision of MV3 increases, but the amount of calculation of the encoder can increase. Therefore, the value of N can be determined by considering the calculation capacity of the encoder.
[0143] Additionally, the plurality of motion vectors can be determined in units of a predetermined fractional pixel. The predetermined fractional pixel unit can be determined as 1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, etc. When the fractional pixel unit is small, the precision of MV3 increases, but the amount of calculation of the encoder can increase. Therefore, the fractional pixel unit of MV3 can be determined by considering the calculation capacity of the encoder.
[0144] Information on the MV3 can be coded in a video coding process. The affine inter prediction can be divided into an affine merge mode and an affine mvp (motion vector prediction) mode. According to the affine merge mode, information related to inter prediction, such as CPMVs of neighboring blocks of the current block and a reference picture are used for the current block. On the other hand, according to the affine mvp mode, only CPMVs of neighboring blocks of the current block are used for the current block, and MV differences for modifying the CPMVs of the neighboring blocks and information related to the reference picture are parsed from a bitstream and used. Hereinafter, image encoding and decoding methods according to the affine merge mode and the affine mvp mode will be described.
[0145] A prediction mode of a block predicted according to the affine motion model can be determined as one of the affine merge mode and the affine mvp mode through a merge flag (merge_flag). In an encoding process, when the prediction mode of the block is the affine merge mode, the merge flag can be determined to indicate 1. On the contrary, when the prediction mode of the block is the affine mvp mode, the merge flag can be determined to indicate 0. In some embodiments, the prediction mode corresponding to a symbol (0 or 1) indicated by the merge flag can be determined inversely. On the contrary, in a decoding process, the prediction mode of the current block can be determined as one of the affine merge mode and the affine mvp mode according to the merge flag.
[0146] In the affine merge mode, a merge candidate list is determined from neighboring blocks of the current block. A maximum number of the merge candidates is determined as N. For example, N can be determined as 5, 6, 7, 8, or a higher value. The merge candidate list can include a left merge candidate and an above merge candidate. The left merge candidate includes motion information for affine inter prediction of a left neighboring block. In addition, the above merge candidate includes motion information for affine inter prediction of an above neighboring block.
[0147] The merge candidate list can include a temporal merge candidate. The temporal merge candidate includes motion information for affine inter prediction of a temporally corresponding block located at a position corresponding to the current block. The temporally corresponding block is included in one of reference pictures referred to by the current picture.
[0148] Figure 6 Positions of blocks referred to in generating the merge candidate list in the current block are shown.
[0149] At present, the block 600 has A0, A1, A2, and A3 on the upper side, and B0, B1, and B2 on the left side. Accordingly, when spatial merge candidates are determined, blocks located at A0, A1, A2, A3, B0, B1, and B2 can be referred to. The current block 600 has D0 on the lower right side, and C in the center. When temporal merge candidates are determined, blocks corresponding to one of C, D0, D1, and D2 can be referred to.
[0150] Only three CPMVs in the block referred to in the spatial merge candidate or the temporal merge candidate can be used for inter prediction. If four CPMVs are used in the current block, three CPMVs can be used to derive the fourth CPMV. For example, if only three CPMVs are used for prediction of the neighboring block, CPMVs MV0, MV1 and MV2 of the current block can be derived from the three CPMVs of the neighboring block. In addition, MV3' can be derived from CPMVs MV0, MV1 and MV2 of the current block according to the affine model. However, since MV3' is derived from the affine model of MV0, MV1 and MV2, the prediction results between the affine model according to MV0, MV1 and MV2 and the affine model according to MV0, MV1, MV2 and MV3' are the same. Therefore, in the encoding process, the MV with the highest prediction accuracy among the MVs in the predetermined range adjacent to MV3' can be searched, as described above. If the MV with the higher prediction accuracy than MV3' is searched, the MV can be determined as MV3. Conversely, if the MV with the higher prediction accuracy than MV3' is not searched, MV3' can be determined as MV3. Alternatively, if MV3' is the same as MV3, there is no reason to use four CPMVs, and thus it can be set to use only MV0, MV1 and MV2. Figure 5
[0151] In the encoding process, when four CPMVs are used, the difference value representing the difference between MV3' and MV3 can be encoded. In addition, by decoding the difference value in the decoding process, MV3 can be derived from MV3'.
[0152] If three CPMVs are used in the encoding process (MV3' and MV3 are the same, and thus there is no benefit in using four CPMVs), the difference value representing the difference between MV3' and MV3 is not encoded. In addition, by decoding the difference value in the decoding process, the current block can be predicted using only MV0, MV1 and MV2.
[0153] Only two CPMVs in the block referred to in the spatial merge candidate or the temporal merge candidate can be used for inter prediction. If three or more CPMVs are used in the current block, two CPMVs can be used to derive the third CPMV. In addition, if four CPMVs are used in the current block, two CPMVs can be used to derive the third CPMV and the fourth CPMV.
[0154] For example, if only two CPMVs are used for predicting the neighboring block, CPMV MV0 and MV1 of the current block can be first derived from the two CPMVs of the neighboring block. Then, MV2' can be derived from MV0 and MV1 as the CPMV of the current block according to the affine model. However, since MV2' is derived from the affine model of MV0 and MV1, the prediction result between the affine model according to MV0 and MV1 and the affine model according to MV0, MV1 and MV2' is the same. Therefore, in the encoding process, the MV having the highest prediction accuracy among the MVs in a predetermined range neighboring MV2' can be searched. If the MV having the higher prediction accuracy than MV2' is searched, the MV can be determined as MV2. In contrast, if the MV having the higher prediction accuracy than MV2' is not searched, MV2' can be determined as MV2. Alternatively, if MV2' is equal to MV2, there is no reason to use three CPMVs, and thus it can be set to use only MV0 and MV1.
[0155] If MV2 is derived as above, MV3 can be additionally derived. MV3' can be derived from MV0 and MV1 as the CPMVs that have been determined according to the affine model. Alternatively, MV3' can be derived from MV0, MV1 and MV2 including the previously derived MV2 according to the affine model. In addition, the MV having the highest prediction accuracy among the MVs in a predetermined range neighboring MV3' can be searched. If the MV having the higher prediction accuracy than MV3' is searched, the MV can be determined as MV3. In contrast, if the MV having the higher prediction accuracy than MV3' is not searched, MV3' can be determined as MV3. Alternatively, if MV3' is equal to MV3, there is no reason to use four CPMVs, and thus it can be set to use only MV0, MV1 and MV2.
[0156] As described above, even when two CPMVs are used for the block corresponding to the spatial merge candidate or the temporal merge candidate of the current block, three CPMVs or four CPMVs for affine prediction of the current block can be derived from the corresponding block. In addition, the difference between MV2' and MV2 and the difference between MV3' and MV3 are encoded in the encoding process, and the difference can be decoded in the decoding process.
[0157] In summary, when referring to the spatial merge candidate or the temporal merge candidate in the affine merge mode, even if the number of CPMVs of the reference block is 2 or 3, the current block can be predicted based on 4 CPMVs by additionally deriving the CPMV from the CPMVs of the reference block.
[0158] Figure 7 A spatial merge candidate derived from a left neighboring block is shown.
[0159] If the left neighboring block 710 is predicted according to the affine model, the CPMVs of the current block 700 are derived from the left neighboring block 710. Equation 11 below shows a method of determining MV0, MV1, MV2, and MV3, which are CPMVs used in the current block 700, by using MVL0, MVL1, MVL2, and MVL3, which are CPMVs used in the left neighboring block 710.
[0160] [Equation 11]
[0161] According to Equation 11, MV0, MV1, MV2, and MV3 are derived based on the respective angular coordinate values of the current block 700 and the left neighboring block 710. Thus, in deriving MV0, MV1, MV2, and MV3, the sizes of the current block 700 and the left neighboring block 710 can be considered.
[0162] Here, for the left neighboring block 710, if only MVL0, MVL1, and MVL2 are used as CPMVs, MV0, MV1, and MV2 of the current block 700 are determined based on MVL0, MVL1, and MVL2. And as described above, MV3 of the current block 700 can be derived from MV0, MV1, and MV2 of the current block 700.
[0163] In addition, for the left neighboring block 710, if only MVL0 and MVL1 are used as CPMVs, MV0 and MV1 of the current block 700 are determined based on MVL0, MVL1, and MVL2. In addition, as described above, MV2 and MV3 of the current block 700 can be derived from MV0 and MV1 of the current block 700.
[0164] Figure 8 A spatial merge candidate derived from the above neighboring block is shown.
[0165] If the above neighboring block 810 is predicted according to the affine model, the CPMVs of the current block 800 are derived from the above neighboring block 810. Equation 12 below shows a method of determining CPMVs MV0, MV1, MV2, and MV3 used in the current block 800 by using CPMVs MVT0, MVT1, MVT2, and MVT3 used in the above neighboring block 810.
[0166] [Equation 12]
[0167] According to Equation 12, MV0, MV1, MV2, and MV3 are derived based on the respective angular coordinate values of the current block 800 and the above neighboring block 810. Thus, in deriving MV0, MV1, MV2, and MV3, the sizes of the current block 800 and the above neighboring block 810 can be considered.
[0168] Here, for the upper neighboring block 810, if only MVT0, MVT1, and MVT2 are used as the CPMVs, MV0, MV1, and MV2 of the current block 800 are determined based on MVT0, MVT1, and MVT2. In addition, as described above, MV3 of the current block 800 can be derived from MV0, MV1, and MV2 of the current block 800.
[0169] In addition, for the upper neighboring block 810, if only MVT0 and MVT1 are used as the CPMVs, MV0 and MV1 of the current block 800 are determined based on MVT0, MVT1, and MVT2. In addition, as described above, MV2 and MV3 of the current block 800 can be derived from MV0 and MV1 of the current block 800.
[0170] The merge candidate list can include a combined merge candidate. The combined merge candidate of the current block can be determined by determining MVs (motion vectors) of neighboring blocks of the current block as CPMVs of the current block and combining the CPMVs of the current block.
[0171] For example, MVs of a top-left neighboring block, a bottom-left neighboring block, and a top-right neighboring block of the current block can be used as the CPMVs of the current block. The top-left neighboring block can be determined as a block corresponding to one of A0, A3, and B2 of Figure 6 The bottom-left neighboring block can be determined as a block corresponding to one of B0 and B1 of Figure 6 The top-right neighboring block can be determined as a block corresponding to one of A1 and A2 of Figure 6
[0172] In addition, an MV of a temporally corresponding block corresponding to a center position or a bottom-right position of the current block can be used as the CPMV of the current block. The center position can be C. In addition, the bottom-right position can be selected from one of D0, D1, and D2. The temporally corresponding block is included in one of reference pictures referred to by the current picture. Accordingly, according to embodiments, a combined merge candidate of the current block can be determined by combining MV0 of the top-left neighboring block, MV1 of the bottom-left neighboring block, MV2 of the top-right neighboring block, and MV3 of the temporally corresponding block of the current block.
[0173] Specifically, in the 6-parameter affine motion model, three MVs among MV0, MV1, MV2, and MV3 of the current block can be used as the CPMVs of the current block. The combination of the MVs for the combined merge candidate of the current block can be selected from [MV0, MV1, MV2], [MV0, MV1, MV3], [MV0, MV2, MV3], and [MV1, MV2, MV3].
[0174] In addition, in the 4-parameter affine motion model, two MVs among the MVs 0, 1, 2, and 3 of the current block can be used as the CPMVs of the current block. The combination of the MVs of the combined merge candidate for the current block can be selected from [MV0, MV1], [MV0, MV2], [MV0, MV], [MV1, MV2], [MV1, MV3], and [MV2, MV3].
[0175] If MV3 is additionally used in the 6-parameter affine motion model, that is, if 4 CPMVs are used, MV0, 1, 2, and 3 can all be used as the CPMVs.
[0176] According to one embodiment, when a combined merge candidate including four CPMVs is generated, a process of deriving one CPMV from three CPMVs determined from neighboring blocks can be performed. For example, MV3 can be determined from MV0, 1, and 2 obtained from the top-left, bottom-left, and top-right neighboring blocks of the current block. At this time, in the encoding process, MV3' can be determined from MV0, 1, and 2, and the MV having the highest prediction accuracy among the MVs in a predetermined range adjacent to MV3' can be determined as MV3. In contrast, in the decoding process, MV3' can be determined from MV0, 1, and 2, and MV3 can be determined by adding the difference between MV3' obtained from the bitstream and MV3 to MV3'. In this case, MV3 cannot be derived from the temporally corresponding block.
[0177] According to one embodiment, if a part of a reference block referred to by a combined merge candidate does not exist or is not intra-predicted, the MV corresponding to the unavailable block can be derived from the MVs of the available blocks based on the above-mentioned methods. For example, when a combined merge candidate including four CPMVs is generated, if MV2 is unavailable among the MVs 0, 1, 2, and 3 corresponding to the top-left, bottom-left, top-right neighboring blocks, and the temporally corresponding block of the current block, MV2 can be derived from MV0, 1, and 3. At this time, in the encoding process, MV2' can be determined from MV0, 1, and 3, and the MV having the highest prediction accuracy among the MVs in a predetermined range adjacent to MV2' can be determined as MV2. In contrast, in the decoding process, MV2' can be determined from MV0, 1, and 3, and MV2 can be determined by adding the difference between MV2' obtained from the bitstream and MV2 to MV2'.
[0178] According to one embodiment, when a combined merge candidate including four CPMVs is generated, the combined merge candidate can be generated from three CPMVs (MV0, MV1, MV2) derived from spatially neighboring blocks, one CPMV (MV3) derived from the three CPMVs, and one CPMV (MV4) derived from a temporally corresponding block. In determining MV3, in an encoding process, MV3' can be determined from MV0, MV1, and MV2, and an MV having the highest prediction accuracy among MVs in a predetermined range adjacent to MV3' can be determined as MV3. Conversely, in a decoding process, MV3' can be determined from MV0, MV1, and MV2, and a difference between MV3' obtained from a bitstream and MV3 can be added to MV3', thereby determining MV3. At this time, MV3' can be derived based on one of D0, D1, and D2 which are right lower positions of Figure 6 .
[0179] The combination of MVs for the combined merge candidate of the current block can be selected from [MV0, MV1, MV2, MV3], [MV0, MV1, MV2, MV4], [MV0, MV1, MV3, MV4], [MV0, MV2, MV3, MV4], and [MV1, MV2, MV3, MV4].
[0180] In some cases, the merge candidate list can not be complete because some of the spatial merge candidates, temporal merge candidates, and combined merge candidates are not available. In this case, the merge candidate list can be completed by including a zero merge candidate consisting of a zero vector in the merge candidate list.
[0181] When the affine MVP mode is selected, an MVP list is determined from neighboring blocks of the current block. A maximum number of MVP candidates is determined as M. For example, M can be determined as 2, 3, 4, 5, or more. The MVP candidate list can include a left MVP candidate and an above MVP candidate. The left MVP candidate includes an MV derived from a CPMV for affine inter prediction of a left neighboring block. In addition, the above MVP candidate includes an MV derived from a CPMV for affine inter prediction of an above neighboring block.
[0182] In addition, the MVP candidate list can include a temporal MVP candidate extracted from a temporally corresponding block of the current block. The temporal MVP candidate includes an MV derived from a CPMV for affine inter prediction of the temporally corresponding block. The temporally corresponding block is included in one of reference pictures referred to by the current picture. In addition, a position of the temporally corresponding block can correspond to one of C, D0, D1, and D2 of Figure 6 .
[0183] In addition, the MVP candidate list can include combined MVP candidates. The combined MVP candidate of the current block can be determined by determining the MVs of neighboring blocks of the current block as CPMVs of the current block and combining the CPMVs of the current block. The method of determining the MVP of each CPMV of the combined MVP candidate can be performed in the same manner as the method of determining the CPMVs of the combined merge candidate. For example, MVP0, MVP1, MVP2, and MVP3 can be derived from the top-left neighboring block, the bottom-left neighboring block, the top-right neighboring block, and the temporally corresponding block, respectively. Alternatively, MVP3 can be derived from MVP0, MVP1, and MVP2. In addition, if one of the top-left neighboring block, the bottom-left neighboring block, the top-right neighboring block, and the temporally corresponding block is unavailable (e.g., the block does not exist or is intra-predicted), the MVP corresponding to the block for which the MV is unavailable can be derived from the three MVPs derived from the three blocks for which the MVs are available.
[0184] When the MVP is selected from the MVP list, the MV is determined by adding a motion vector difference (MVD) obtained from the bitstream to the MVP. The MVD value can be applied to all of the CPMVs of the current block. For example, if the CPMVs of the current block are 4, the MVD value for each of the MVPs of the 4 CPMVs can be encoded or decoded. Specifically, for MVP0, MVP1, MVP2, and MVP3, MVD0, MVD1, MVD2, and MVD3 can be determined or obtained, respectively.
[0185] According to one embodiment, MV0, MV1, MV2, and MV3 can be determined as MVP0+MVD0, MVP1+MVD1, MVP2+MVD2, and MVP3+MVD3, respectively. Alternatively, MV0, MV1, MV2, and MV3 can be determined as MVP0+MVD0, MVP1+MVD0+MVD1, MVP2+MVD0+MVD2, and MVP3+MVD0+MVD3, respectively.
[0186] Hereinafter, a method of deriving the CPMVs for affine model-based prediction in an encoding process from Equation 13 to Equation 23 will be described.
[0187] In the following equations, MV0 denotes a top-left CPMV, MV0 h denotes a horizontal component (x component) of the top-left CPMV, and MV0 v denotes a vertical component (y component) of the top-left CPMV. MV1 denotes a top-right CPMV, MV1 h denotes a horizontal component (x component) of the top-right CPMV, and MV1 v denotes a vertical component (y component) of the top-right CPMV. MV (x,y) denotes a motion vector determined using the top-right CPMV and the top-left CPMV at (x, y) coordinates, MV(x,y) h Let MV represent the horizontal component (x component) of the (x, y) coordinates, and MV (x,y) v This represents the vertical component (y-component) of the (x, y) coordinate. Additionally, W represents the width of the current block. Furthermore, p represents the (x, y) coordinate; therefore, MV(p) represents MV. (x,y) .
[0188] Equations 13 to 15 illustrate the method for deriving the motion vectors of (x, y) coordinates in a 4-parameter affine motion model. Equation 13 shows the MV as the horizontal component of the (x, y) coordinates. (x,y) h The derivation. Additionally, Equation 14 shows the MV as the vertical component of the (x, y) coordinates. (x,y) v The derivation of .
[0189] [Equation 13]
[0190] [Formula 14]
[0191] By combining Equations 13 and 14 above, it can be expressed as Equation 15.
[0192] [Formula 15]
[0193] In Equation 15 above, m0 represents (1-x / W), m1 represents x / W, and n0 represents y / W.
[0194] Equations 16 to 18 illustrate the method for deriving the motion vector of the (x, y) coordinates in a 6-parameter affine motion model. Equation 16 shows the MV of the horizontal component of the (x, y) coordinates. (x,y) h The derivation. Additionally, Equation 17 shows the MV of the vertical component of the (x, y) coordinates. (x,y) v The derivation of .
[0195] [Formula 16]
[0196] [Equation 17]
[0197] By combining Equations 16 and 17 above, it can be expressed as Equation 18.
[0198] [Formula 18]
[0199] In the above Formula 18, m0 represents (1 - x / W - y / H), ml represents x / W, and m2 represents y / H.
[0200] The peripheral search of MV(p) determined from Formula 13 to Formula 18 minimizes the MV that minimizes the MSE (Mean Squared Error) of the current block and the prediction block. The MSE can be calculated by the following Formula 19. In Formula 19, p represents the position of the current pixel, B represents all pixels of the current block, and MV(p) represents the MV for p. In addition, P org (p) represents the current block, and P ref (p + MV(p)) represents the reference block at the position offset by MV(p) from the position of the current block in the reference picture.
[0201] [Formula 19]
[0202] The MV of p in the i-th iteration is MV i (p) when the MV of the vertex of the block in the i-th iteration is MV cor i MV(p) is changed by dMV cor i In Formula 20, q represents (p + MV(p)), which is the corresponding point corresponding to p of the reference block in the i-th iteration.
[0203] [Formula 20]
[0204] In addition, (+ (+1) ()) of Formula 20 is derived by Taylor series, Formula 21 is derived. In Formula 21, '(q) represents the horizontal differential and the vertical differential at q.
[0205] [Formula 21]
[0206] The horizontal differential (Gx) and the vertical differential (Gy) can be calculated using the Sobel operator of Formula 22.
[0207] [Formula 22]
[0208] Alternatively, the horizontal differential (Gx) and the vertical differential (Gy) can be calculated using the Prewitt operator of Formula 23 instead of the Sobel operator by changing the weight from 2 to 1.
[0209] [Formula 23]
[0210] Based on Equation 21, ε representing MSE is determined according to Equation 24.
[0211] [Equation 24]
[0212] Here, a variable dMV is solved according to Equation 25. cor i so that ε (MSE) becomes 0.
[0213] [Equation 25]
[0214] Here, P' ref (q) means a gradient x and a gradient y.
[0215] Referring to Equation 20, the following procedure can be iterated starting from i = 0. That is, Equation 20 is iterated until dMV cor i is almost (0, 0), and MV i+1 (p) is calculated. cor i is very small, the above iteration can be stopped and MV i+1 (p) can be calculated. Once the calculation of MV cor i+1 is completed, Equations related to MV h (x,y) and MV v (x,y) can be used.
[0216] Figure 9 A flowchart of a video decoding method of the present application is shown.
[0217] In step 902, it is determined that the current block is predicted by an affine model.
[0218] In step 904, four CPMVs of the current block are determined.
[0219] In step 906, the current block is predicted based on the four CPMVs.
[0220] Various embodiments can be applied to a method of determining the four CPMVs in step 904.
[0221] According to one embodiment, when a prediction mode of the current block is a merge mode, a merge candidate list including at least one of a spatial merge candidate, a temporal merge candidate, and a combined merge candidate of the current block can be determined. In addition, the four CPMVs of the current block can be determined according to a merge candidate selected from the merge candidate list of the current block.
[0222] According to one embodiment, if a spatial neighboring block of the current block is predicted by the affine model, a spatial merge candidate of the current block can be determined according to the CPMVs of the spatial neighboring block of the current block. In addition, if a temporally corresponding block of the current block is predicted by the affine model, a temporal merge candidate of the current block can be determined according to the CPMVs of the temporally corresponding block of the current block.
[0223] According to one embodiment, in determining the spatial merge candidate of the current block, if three CPMVs are used for the prediction of the spatial neighboring block, a first CPMV, a second CPMV, and a third CPMV of the spatial merge candidate can be determined according to the three CPMVs of the spatial neighboring block. A fourth CPMV of the spatial merge candidate can be derived according to the first CPMV, the second CPMV, and the third CPMV of the spatial merge candidate. This embodiment can also be applied to determine the temporal merge candidate.
[0224] According to one embodiment, in deriving the fourth CPMV of the spatial merge candidate, a prediction value of the fourth CPMV is determined according to the first CPMV, the second CPMV, and the third CPMV of the spatial merge candidate, a difference value of the fourth CPMV is determined, and the fourth CPMV can be derived according to the prediction value and the difference value of the fourth CPMV. This embodiment can also be applied to determine the temporal merge candidate.
[0225] According to one embodiment, in the step of determining the spatial merge candidate of the current block, if two CPMVs are used for the prediction of the spatial neighboring block, a first CPMV and a second CPMV of the spatial merge candidate can be determined according to the two CPMVs of the spatial neighboring block. A third CPMV and a fourth CPMV of the spatial merge candidate can be derived according to the first CPMV and the second CPMV of the spatial merge candidate. This embodiment can also be applied to determine the temporal merge candidate.
[0226] According to one embodiment, in deriving the third CPMV and the fourth CPMV of the spatial merge candidate, prediction values of the third CPMV and the fourth CPMV can be determined according to the first CPMV and the second CPMV of the spatial merge candidate, and a difference value of the third CPMV and a difference value of the fourth CPMV can be determined. In addition, the third CPMV can be derived according to the prediction value and the difference value of the third CPMV, and the fourth CPMV can be derived according to the prediction value and the difference value of the fourth CPMV. This embodiment can also be applied to determine the temporal merge candidate.
[0227] According to one embodiment, in determining the merge candidate list of the current block, a plurality of motion vectors can be extracted from the spatial neighboring blocks and the temporally corresponding blocks of the current block, and a combined merge candidate can be determined by combining the plurality of motion vectors.
[0228] According to an embodiment, in extracting the plurality of motion vectors, the first CPMV, the second CPMV, and the third CPMV can be derived from a plurality of spatially neighboring blocks of the current block, and the fourth CPMV can be derived from a temporally corresponding block corresponding to a center position or a lower right position of the current block.
[0229] According to an embodiment, in extracting the plurality of motion vectors, the first CPMV, the second CPMV, and the third CPMV can be derived from a plurality of spatially neighboring blocks of the current block and a plurality of temporally neighboring blocks of the current block, and the fourth CPMV can be derived from the first CPMV, the second CPMV, and the third CPMV.
[0230] According to an embodiment, in deriving the fourth CPMV, a prediction value of the fourth CPMV can be determined based on the first CPMV, the second CPMV, and the third CPMV, and a difference value of the fourth CPMV can be determined. In addition, the fourth CPMV can be derived based on the prediction value and the difference value of the fourth CPMV.
[0231] According to an embodiment, the determining of the four CPMVs of the current block can include, when a prediction mode of the current block is an MVP mode, determining an MVP candidate list including at least one of a spatial MVP candidate of the current block, a temporal MVP block, or a combined MVP candidate. The four CPMVs of the current block can be determined based on an MVP candidate selected from the MVP candidate list of the current block.
[0232] According to an embodiment, if spatially neighboring blocks of the current block are predicted by an affine model, a spatial MVP candidate of the current block can be determined based on CPMVs of the spatially neighboring blocks of the current block. In addition, if temporally corresponding blocks of the current block are predicted by the affine model, a temporal MVP candidate of the current block can be determined based on CPMVs of the temporally corresponding blocks of the current block.
[0233] According to an embodiment, in determining a spatial MVP candidate of the current block, if three CPMVs are used for prediction of spatially neighboring blocks, a first CPMVP, a second CPMVP, and a third CPMVP of the spatial MVP candidate can be determined based on the three CPMVs of the spatially neighboring blocks. A fourth CPMVP of the spatial MVP candidate can be derived from the first CPMVP, the second CPMVP, and the third CPMVP of the spatial MVP candidate. This embodiment can also be applied to determine a temporal MVP candidate.
[0234] According to one embodiment, when determining the spatial MVP candidates of the current block, if two CPMVs are used for the prediction of the spatially neighboring blocks, the first CPMVP and the second CPMVP of the spatial MVP candidates can be determined according to the three CPMVs of the spatially neighboring blocks. The third CPMVP and the fourth CPMVP of the spatial MVP candidates can be derived from the first CPMVP and the second CPMVP of the spatial MVP candidates. This embodiment can also be applied to determine the temporal MVP candidates.
[0235] According to one embodiment, when determining the MVP candidate list of the current block, a plurality of motion vectors can be extracted from the spatially neighboring blocks and the temporally corresponding blocks of the current block. A combined MVP candidate can be determined by combining the plurality of motion vectors.
[0236] According to one embodiment, when extracting the plurality of motion vectors, the first CPMVP, the second CPMVP and the third CPMVP can be derived from the plurality of spatially neighboring blocks of the current block, and the fourth CPMVP can be derived from the temporally corresponding block corresponding to the center position or the bottom-right position of the current block.
[0237] According to one embodiment, when extracting the plurality of motion vectors, the first CPMVP, the second CPMVP and the third CPMVP can be derived from the plurality of spatially neighboring blocks and the temporally neighboring blocks of the current block. The fourth CPMVP can be derived from the first CPMVP, the second CPMVP and the third CPMVP.
[0238] Figure 10 A flowchart of the video encoding method of the present application is shown.
[0239] In step 1002, it is determined that the current block is predicted by an affine model.
[0240] In step 1004, four CPMVs of the current block are determined.
[0241] In step 1006, the four CPMVs are encoded and the current block is predicted based on the four CPMVs.
[0242] In step 1004, the four CPMVs can be determined based on equations 13 to 23.
[0243] In step 1006, according to various embodiments, the four CPMVs can be encoded.
[0244] According to one embodiment, it can be determined whether the prediction mode of the current block is the merge mode or the MVP mode.
[0245] According to an embodiment, when the prediction mode of the current block is the merge mode, a merge candidate list including at least one of a spatial merge candidate, a temporal merge candidate, or a combined merge candidate of the current block can be determined. According to an embodiment, the merge candidate list of the current block can be determined according to the embodiments discussed in the decoding method of Figure 9
[0246] Information indicating a merge candidate among the merge candidate list of the current block can be encoded. In addition, a difference value of the fourth CPMV for determining the fourth CPMV applied to the merge candidate of the current block can be encoded. In addition, according to an embodiment, a difference value of the third CPMV for determining the third CPMV applied to the merge candidate of the current block can be further encoded.
[0247] According to an embodiment, when the prediction mode of the current block is the MVP mode, an MVP candidate list including at least one of a spatial MVP candidate, a temporal MVP block, or a combined MVP candidate of the current block can be determined. According to an embodiment, the MVP candidate list of the current block can be determined according to the embodiments discussed in the decoding method of Figure 9
[0248] Information indicating an MVP candidate from the MVP candidate list of the current block can be encoded. In addition, four difference values indicating a difference between four CPMVs applied to the current block and four CPMVs of the MVP candidate can be encoded.
[0249] The bitstream generated by the encoding method of Figure 10 The bitstream generated by the encoding method of Figure 10 may be transmitted to another terminal, and the bitstream transmitted to another terminal can be decoded according to the decoding method of Figure 9
[0250] Hereinafter, an embodiment in which the current block is divided into two partitions and affine prediction is performed on each partition using different CPMVs will be described.
[0251] According to an embodiment, in the MVP mode, the CPMVs of the partitions of the current block are derived from the MVs of the neighboring blocks of the current block. Specifically, the predicted values of the CPMVs of the partitions of the current block are determined according to the reference. In addition, the CPMVs are derived by adding the difference values of the CPMVs to the predicted values of each CPMV.
[0252] Figure 11 A method of deriving six CPMVs of two partitions of the current block from one neighboring block is illustrated.
[0253] According to the encoding method of Figure 11 The predicted values of the CPMVs of the two partitions of the current block 1100 are derived based on the six CPMVs of the neighboring block 1110 at the lower-left of the current block 1100. For example, the MV0, MV1, MV2, MV3, MV4, and MV5 of the current block 1100 can be derived based on the MVL0, MVL1, MVL2, MVL3, MVL4, and MVL5 of the neighboring block 1110. Figure 11 The neighboring block 1110 is adjacent to the lower-left of the current block 1100, but according to embodiments, the neighboring block 1110 can be adjacent to the upper-right or upper-left of the current block 1100.
[0254] Figure 12 The method of deriving the six CPMVs of the two partitions of the current block from two neighboring blocks is shown.
[0255] According to Figure 12 , the predicted values of the CPMVs of the upper-left partition 1202 of the current block 1200 are derived based on the three CPMVs of the lower-left neighboring block 1210 of the current block 1200. For example, the MV0, MV1, and MV2 of the current block 1200 can be derived based on the MVL0, MVL1, and MVL2 of the neighboring block 1210. In addition, the predicted values of the CPMVs of the lower-right partition 1204 of the current block 1200 are derived based on the three CPMVs of the upper-right neighboring block 1220 of the current block 1200. For example, the MV3, MV4, and MV5 of the current block 1200 can be derived based on the MVT3, MVT4, and MVT5 of the neighboring block 1220.
[0256] In Figure 12 , the predicted values of the CPMVs of the upper-left partition 1202 are depicted as being derived from the MVs of the lower-left neighboring block 1210, but according to embodiments, it can be derived from the MVs of the upper-right neighboring block 1220. Conversely, in Figure 12 , the predicted values of the CPMVs of the lower-right partition 1204 are depicted as being derived from the MVs of the upper-right neighboring block 1220, but according to embodiments, it can be derived from the MVs of the lower-left neighboring block 1210.
[0257] The following Equation 24 shows an embodiment of determining the CPMVs (MV0, MV1, MV2, MV3, MV4, MV5) by adding the predicted values of the CPMVs derived from the MVs of the neighboring blocks to the difference values of the CPMVs.
[0258] [Equation 26]
[0259] According to Equation 26, PMVL0, PMVL1, PMVL2, PMVT3, PMVT4, and PMVT5 represent predicted values MV0, MV1, MV2, MV3, MV4, and MV5 derived based on MVL0, MVL1, MVL2, MVT3, MVT4, and MVT5, respectively. In addition, MVD0, MVD1, MVD2, MVD3, MVD4, and MVD5 represent differences of MV0, MV1, MV2, MV3, MV4, and MV5.
[0260] Equation 27 shows another embodiment of determining CPMVs (MV0, MV1, MV2, MV3, MV4, MV5).
[0261] [Equation 27]
[0262] According to Equation 27, MVD0 is used to derive MV0, MV1, MV2, MV3, MV4, and MV5. In addition, MVD1, MVD2, MVD3, MVD4, and MVD5 can be used to derive MV1, MV2, MV3, MV4, and MV5. Accordingly, when the difference between the values of MVD0, MVD1, MVD2, MVD3, MVD4, and MVD5 is small, the coding rate of the difference can be improved by resolving the difference according to Equation 27.
[0263] In Equation 26 and Equation 27, MV3, MV4, and MV5 are described as being derived from PMVT3, PMVT4, and PMVT5, but according to an embodiment, MV3, MV4, and MV5 can be derived from PMVL3, PMVL4, and PMVL5 derived from MVL3, MVL4, and MVL5. In addition, although MV0, MV1, and MV2 are described as being derived from PMVL0, PMVL1, and PMVL2, according to an embodiment, MV0, MV1, and MV2 can be derived from PMVT0, PMVT1, and PMVT2 derived from MVT0, MVT1, and MVT2.
[0264] According to another embodiment, CPMVs of partitions of a current block are derived from MVs of neighboring blocks of the current block according to a merge mode. Specifically, CPMVs of partitions of the current block are determined according to the referenced MVs. In this case, differences of the CPMVs are not resolved.
[0265] Equation 28 below describes an embodiment of deriving CPMVs of partitions of a current block from MVs of neighboring blocks of the current block in a merge mode.
[0266] [Equation 28]
[0267] Formula 28 shows a CPMV derivation method when the current block refers to the left-bottom neighboring block and the right-top neighboring block. The CPMV derivation method according to Formula 28 can also be applied when the current block refers to other neighboring blocks.
[0268] Hereinafter, a method of improving prediction accuracy of a partition boundary when the current block is divided into two partitions and each partition is predicted by a different CPMV will be described.
[0269] When different CPMVs are predicted for each partition, prediction accuracy can be improved by performing a weighted average of the sample values of the partition boundary determined for each partition when determining the sample values of the partition boundary. The prediction method of the partition boundary sample is equally applied to the encoder and the decoder.
[0270] Figure 13 A first prediction block, a second prediction block, and a final prediction block obtained by summing them are shown.
[0271] The first prediction block 1300 is a prediction block including only prediction samples for the top-left partition. The second prediction block 1310 is a prediction block including only prediction samples for the bottom-right partition. The gray areas of the first prediction block 1300 and the second prediction block 1310 indicate samples in which prediction values are calculated in each block.
[0272] The gray area of the first prediction block 1300 includes the partition boundary neighboring samples as well as the top-left partition. In addition, the gray area of the second prediction block 1310 includes the partition boundary neighboring samples as well as the bottom-right partition. For example, in Figure 13 The partition boundary neighboring samples include samples two sample units away from the partition boundary. The shape and size of the gray areas of the first prediction block 1300 and the second prediction block 1310 of Figure 13 may be changed. In addition, according to embodiments, the gray areas can include the entire area of the blocks.
[0273] The final prediction block 1320 is derived by the weighted sum of the first prediction block 1300 and the second prediction block 1310. At this time, the weight applied to the first prediction block 1300 and the weight applied to the second prediction block 1310 can be different according to the position of each sample.
[0274] Formula 29 below is an example of a formula for calculating a sample value of the final prediction block 1320 using sample values at the same position obtained from the first prediction block 1300 and the second prediction block 1310.
[0275] [Formula 29]
[0276] In Equation 29, w denotes a weight. The weight w can vary, and different values can be used according to the block size. Equation 29 can vary according to the weight w.
[0277] Figure 14 An embodiment of a weight of each sample used in the calculation of the final prediction block 1320 is shown.
[0278] Figure 14 The diagonal dotted line in indicates a partition boundary. In addition, Figure 14 The gray samples in are a sample region for which a weighted sum is calculated according to Equation 29. Figure 14 The numbers of the gray samples in indicate weights, which can be used as w values in Equation 29.
[0279] Equation 30 is an example of calculating a p(4,3) sample value of Figure 14
[0280] [Equation 30]
[0281] In another embodiment, the prediction accuracy of the partition boundary can be improved by applying a low-pass filter to the sample at the partition boundary of the current block.
[0282] Figure 15 An embodiment of applying a low-pass filter to the sample at the partition boundary of the current block is shown.
[0283] According to Figure 15 , the sample at the partition boundary can be filtered with reference to surrounding samples. As an example of applying a low-pass filter, Equation 31 provides an example of a method of using a [1, 2, 1] low-pass filter in p(4,3) samples.
[0284] [Equation 31]
[0285] The low-pass filter of Equation 31 is merely an example, and according to the embodiment, the positions and number of the surrounding samples referred to and the filter coefficients of the low-pass filter can vary.
[0286] Figure 16 An embodiment of applying a low-pass filter to the sample at the partition boundary of the current block and the samples adjacent to the current partition boundary is shown.
[0287] According to the embodiment, the range of the sample to which the low-pass filter is applied can be expanded.
[0288] The various embodiments of the present disclosure are not intended to list all possible combinations, but are for illustrating representative aspects of the present disclosure, and matters described in the various embodiments can be applied independently or in a combination of two or more.
[0289] In addition, the various embodiments of the present disclosure can be implemented by hardware, firmware, software, or a combination thereof. In the case of implementation by hardware, the present disclosure can be implemented using application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, etc.
[0290] The scope of the present disclosure includes software or machine executable instructions (e.g., operating systems, applications, firmware, programs, etc.) and non-transitory computer-readable media having such software or instructions stored thereon and being capable of being executed on a device or computer to cause the operations of the methods according to the various embodiments to be performed.
Claims
1. A method of video decoding, comprising: determining that a current block is predicted by an affine model; determining four control point motion vectors (CPMVs) of the current block; and predicting the current block according to the four CPMVs. Determining the four CPMVs of the current block comprises:
2. The video decoding method of claim 1, wherein, when a prediction mode of the current block is a merge mode, determining a merge candidate list comprising at least one of a spatial merge candidate, a temporal merge candidate, or a combined merge candidate of the current block; and determining the four CPMVs of the current block according to a merge candidate selected from the merge candidate list of the current block. Determining the merge candidate list of the current block comprises:
3. The video decoding method of claim 2, wherein, when a spatial neighboring block of the current block is predicted by an affine model, determining a spatial merge candidate of the current block according to CPMVs of the spatial neighboring block of the current block; and when a temporal corresponding block of the current block is predicted by an affine model, determining a temporal merge candidate of the current block according to CPMVs of the temporal corresponding block of the current block. Determining the spatial merge candidate of the current block comprises:
4. The video decoding method of claim 3, wherein, when three CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first CPMV, a second CPMV, and a third CPMV of the spatial merge candidate from the three CPMVs; and deriving a fourth CPMV of the spatial merge candidate from the first CPMV, the second CPMV, and the third CPMV of the spatial merge candidate. Deriving the fourth CPMV of the spatial merge candidate comprises:
5. The video decoding method of claim 4, wherein, determining a predictor of the fourth CPMV according to the first CPMV, the second CPMV, and the third CPMV of the spatial merge candidate; determining a difference value of the fourth CPMV; and deriving the fourth CPMV from the predictor block and the difference value of the fourth CPMV. Determining the spatial merge candidate of the current block comprises:
6. The video decoding method of claim 3, wherein, when two CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first CPMV and a second CPMV of the spatial merge candidate from the two CPMVs; and deriving a third CPMV and a fourth CPMV of the spatial merge candidate from the first CPMV and the second CPMV of the spatial merge candidate. Deriving the third CPMV and the fourth CPMV of the spatial merge candidate comprises:
7. The video decoding method of claim 6, wherein, determining predictors of the third CPMV and the fourth CPMV according to the first CPMV and the second CPMV of the spatial merge candidate; determining a difference value of the third CPMV and a difference value of the fourth CPMV; and deriving the third CPMV according to the predictor and the difference value of the third CPMV, and deriving the fourth CPMV according to the predictor and the difference value of the fourth CPMV. Determining the merge candidate list of the current block comprises:
8. The video decoding method of claim 2, wherein, extracting a plurality of motion vectors from the spatial neighboring block and the temporal corresponding block of the current block; and determining a combined merge candidate by combining the plurality of motion vectors. 9. The video decoding method of claim 8, wherein, Deriving the plurality of motion vectors includes deriving a first CPMV, a second CPMV, and a third CPMV from a plurality of spatial neighboring blocks of the current block, and deriving a fourth CPMV from a temporal corresponding block corresponding to a center position or a bottom-right position of the current block.
10. The video decoding method of claim 8, wherein, Deriving the plurality of motion vectors includes: deriving a first CPMV, a second CPMV, and a third CPMV from a plurality of spatial neighboring blocks of the current block and a temporal corresponding block of the current block; and deriving a fourth CPMV from the first CPMV, the second CPMV, and the third CPMV.
11. The video decoding method of claim 10, wherein, Deriving the fourth CPMV includes: determining a predictor block of the fourth CPMV according to the first CPMV, the second CPMV, and the third CPMV; determining a difference value of the fourth CPMV; and deriving the fourth CPMV based on the predictor value and the difference value of the fourth CPMV.
12. The video decoding method of claim 1, wherein, Determining the fourth CPMV of the current block includes: when a prediction mode of the current block is a motion vector prediction (MVP) mode, determining an MVP candidate list including at least one of a spatial MVP candidate of the current block, a temporal MVP block, or a combined MVP candidate; and determining the four CPMVs of the current block according to an MVP candidate selected from the MVP candidate list of the current block.
13. The video decoding method of claim 12, wherein, Determining the MVP candidate list of the current block includes: when a spatial neighboring block of the current block is predicted by an affine model, determining a spatial MVP candidate of the current block according to CPMVs of the spatial neighboring block of the current block; and when a temporal corresponding block of the current block is predicted by an affine model, determining a temporal MVP candidate of the current block according to CPMVs of the temporal corresponding block of the current block.
14. The video decoding method of claim 13, wherein, Determining the spatial MVP candidate of the current block includes: when three CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first control point motion vector predictor (CPMVP), a second CPMVP, and a third CPMVP of the spatial MVP candidate from the three CPMVs; and deriving a fourth CPMVP of the spatial MVP candidate from the first CPMVP, the second CPMVP, and the third CPMVP of the spatial MVP candidate.
15. The video decoding method of claim 13, wherein, Determining the spatial MVP candidate of the current block includes: when two CPMVs of the spatial neighboring block are used for prediction of the spatial neighboring block, determining a first CPMVP and a second CPMVP of the spatial MVP candidate from the three CPMVs; and deriving a third CPMVP and a fourth CPMVP of the spatial MVP candidate from the first CPMVP and the second CPMVP of the spatial MVP candidate.
16. The video decoding method of claim 12, wherein, Determining the MVP candidate list of the current block includes: extracting a plurality of motion vectors from a plurality of spatial neighboring blocks and a temporal corresponding block of the current block; and determining a combined MVP candidate by combining the plurality of motion vectors.
17. The video decoding method of claim 16, wherein, Extracting the plurality of motion vectors includes: derive a first CPMVP, a second CPMVP and a third CPMVP from a plurality of spatially neighboring blocks of the current block; and derive a fourth CPMVP from a temporally corresponding block corresponding to a center position or a bottom-right position of the current block.
18. The video decoding method of claim 16, wherein, extracting the plurality of motion vectors comprises: derive a first CPMVP, a second CPMVP and a third CPMVP from a plurality of spatially neighboring blocks of the current block; and derive a fourth CPMVP from the first CPMVP, the second CPMVP and the third CPMVP.
19. A video encoding method comprising: determining that a current block is predicted by an affine model; determining four CPMVs of the current block; and encoding the four CPMVs and predicting the current block from the four CPMVs.
20. A data transmission method of transmitting image data, the data transmission method comprising: generating a bitstream by encoding image data according to an image encoding method; and transmitting the generated bitstream, wherein the image encoding method comprises: determining that a current block is predicted by an affine model; determining four CPMVs of the current block; and encoding the four CPMVs and predicting the current block from the four CPMVs.