Method and apparatus for encoding and decoding video using inter prediction
By introducing affine motion prediction and sample-by-sample adjustment technology into video decoding methods and devices, the problem of insufficient inter-frame prediction compression performance in the existing technology is solved, the efficiency and quality of video coding are improved, and the video coding is adapted to different motion modes.
Patent Information
- Application Number
- CN202410870072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-07-08
- Filing Date
- 2020-06-15
- Publication Date
- 2024-09-20
AI Technical Summary
Existing video coding technology has insufficient compression performance in inter-frame prediction, especially when processing images containing motion, making it difficult to achieve higher coding efficiency and image quality.
By introducing affine motion prediction into video decoding methods and devices, block-by-block decoding and encoding are allowed, and sample-by-sample adjustment and illumination compensation technology of affine motion prediction samples are utilized to improve the accuracy and efficiency of inter-frame prediction.
It improves the compression performance of inter-frame prediction, enhances the coding efficiency and image quality of images containing motion, adapts to different motion modes, and reduces coding complexity.
Smart Images

Figure CN118678097A_ABST
Abstract
Description
[0001] This application is a divisional application of the PCT patent application entered into China with Chinese patent application number 202080043507.9, invention name “Method and device for encoding and decoding video using inter-frame prediction”, and application date June 15, 2020.
[0002] CROSS-REFERENCE TO RELATED APPLICATIONS
[0003] This application claims priority to Korean Patent Application No. 10-2019-0070633, filed on June 14, 2019, and Korean Patent Application No. 10-2019-0082010, filed on July 8, 2019, which are hereby incorporated by reference in their entirety. Technical Field
[0004] The present invention relates to encoding and decoding of video, and more particularly, to encoding tools for improving compression performance of inter-frame prediction. Background Art
[0005] Since the amount of video data is larger than the amount of voice data or still image data, a large amount of hardware resources (including memory) are required to store or transmit video data without compression processing. Accordingly, when storing or transmitting video data, an encoder is usually used to compress the video data for storage or transmission. The decoder then receives the compressed video data, decompresses and reproduces the video data. Compression technologies for such videos include H.264 / AVC and High Efficiency Video Coding (HEVC), which has an approximately 40% improvement in coding efficiency over H.264 / AVC.
[0006] However, image size, resolution and frame rate are gradually increasing, and accordingly, the amount of data to be encoded is also increasing. Therefore, a new compression technology with better encoding efficiency and higher image quality than existing compression technologies is needed.
[0007] In video coding, predictive coding is mainly used to improve compression performance. There is intra-frame prediction for predicting a target block to be encoded based on pre-reconstructed samples in a current image and inter-frame prediction for predicting a current block using a pre-reconstructed reference image. In particular, inter-frame prediction is widely used in video coding because it exhibits better compression performance than intra-frame prediction.
[0008] The present invention proposes a coding tool for improving the compression performance of existing inter-frame prediction.
[0009] In particular, the present invention relates to coding tools for improving compression performance of inter-frame prediction, and in one aspect to coding tools capable of compensating for various motions of objects including translational motion. Summary of the invention
[0010] According to one aspect of the present invention, a video decoding method for decoding a coded image sequence block by block is provided. The method comprises: setting whether affine motion prediction is allowed at the sequence level by decoding a first high-level syntax element from a bitstream; setting whether each of at least one coding tool is allowed at the image level by decoding one or more second high-level syntax elements for each of at least one coding tool from a bitstream according to the first high-level syntax element, wherein the at least one coding tool includes sample-by-sample adjustment of affine motion prediction samples; when the setting at the sequence level indicates that affine motion prediction is allowed, determining a plurality of control point motion vectors of a target block encoded using affine motion prediction, and generating affine prediction samples for each sub-block in the target block by performing affine motion prediction in units of sub-blocks using the control point motion vectors; when it is identified based on the setting at the image level that sample-by-sample adjustment of affine motion prediction samples is allowed for a current image containing the target block, modifying the sample values of the affine prediction samples by compensating motion according to sample positions in each sub-block based on the control point motion vectors of the target block.
[0011] According to another aspect of the present invention, a video decoding apparatus for decoding a coded image sequence block by block is provided. The apparatus comprises a decoder configured to set whether affine motion prediction is allowed at a sequence level by decoding a first high-level syntax element from a bitstream, and to set whether each of at least one coding tool is allowed at a picture level by decoding one or more second high-level syntax elements for each of at least one coding tool from a bitstream according to the first high-level syntax element. In particular, at least one coding tool comprises sample-by-sample adjustment of affine motion prediction samples.
[0012] The apparatus further includes a predictor configured to: when a setting at a sequence level indicates that affine motion prediction is allowed, determine a plurality of control point motion vectors of a target block encoded using affine motion prediction, and generate affine prediction samples for each sub-block in the target block by performing sub-block-by-sub-block affine motion prediction using the control point motion vectors. In response to identifying that sample-by-sample adjustment of the affine motion prediction samples is allowed for a current image including the target block based on the setting at a picture level, the predictor is configured to modify sample values of the affine prediction samples by compensating for motion according to sample positions in each sub-block based on the control point motion vectors of the target block.
[0013] According to another aspect of the present invention, a method for encoding a coded image sequence block by block is provided. The method comprises: encoding a first high-level syntax element at a sequence level in a sequence header to indicate whether both affine motion prediction and at least one coding tool are prohibited, the at least one coding tool including sample-by-sample adjustment of affine motion prediction samples; encoding one or more second high-level syntax elements according to the first high-level syntax element, the second high-level syntax element indicating a sequence-level or image-level setting of each of the at least one coding tool being allowed; when the first high-level syntax element indicates that both affine motion prediction and at least one coding tool are prohibited, determining a control point motion vector for a target block to be encoded, and generating affine prediction samples for each sub-block by performing sub-block affine motion prediction using the control point motion vector; when sample-by-sample adjustment of affine motion prediction samples is allowed for a current image containing a target block, modifying sample values of the affine prediction samples by compensating motion according to sample positions in each sub-block based on the control point motion vector of the target block. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is an exemplary block diagram of a video encoding device capable of implementing the techniques of the present invention.
[0015] Figure 2 A block partition structure using a QTBTTT structure is exemplarily shown.
[0016] Figure 3 A plurality of intra prediction modes are exemplarily shown.
[0017] Figure 4 Neighboring blocks around the current block are exemplarily shown.
[0018] Figure 5 is an exemplary block diagram of a video decoding device capable of implementing the techniques of the present invention.
[0019] Figure 6 is an exemplary diagram illustrating the concept of bidirectional prediction optical flow provided by the present invention.
[0020] Figure 7 is an exemplary diagram illustrating a method for deriving gradients for block boundary samples in bidirectional optical flow.
[0021] Fig. 8A , Figure 8B and Fig. 9 is an exemplary diagram illustrating affine motion prediction provided by the present invention.
[0022] Fig.10 is an exemplary diagram illustrating a method for deriving merge candidates for affine motion prediction from translational motion vectors of neighboring blocks.
[0023] Fig.11A , Fig. 11B and Fig. 11C is an exemplary diagram illustrating a method of deriving illumination compensation parameters according to an embodiment of illumination compensation provided by the present invention.
[0024] Fig. 12A and Fig. 12B is an exemplary diagram illustrating a method of dividing a target block into a plurality of regions according to another embodiment of illumination compensation provided by the present invention.
[0025] Fig.13 is an exemplary diagram illustrating a method of determining reference samples to be used for deriving compensation parameters when a target block is divided into four areas according to another embodiment of illumination compensation provided by the present invention.
[0026] Fig.14 and Fig.15 is an exemplary diagram illustrating a method of performing illumination compensation using illumination compensation parameters for four regions when a target block is divided into four regions according to another embodiment of illumination compensation provided by the present invention.
[0027] Fig.16 and Fig.17 is an exemplary diagram illustrating a method of performing illumination compensation on each region when a target block is divided into two regions according to another embodiment of illumination compensation provided by the present invention.
[0028] Fig.18 is an exemplary diagram illustrating a method of performing illumination compensation on each region when a target block is divided into a plurality of regions greater than four regions according to another embodiment of illumination compensation provided by the present invention. DETAILED DESCRIPTION
[0029] Hereinafter, some embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that when reference numerals are added to the constituent elements in the various drawings, the same reference numerals also represent the same elements, although the elements are shown in different drawings. In addition, in the following description of the present invention, the detailed description of the known functions and configurations incorporated herein will be omitted to avoid blurring the subject matter of the present invention.
[0030] Figure 1 is an exemplary block diagram of a video encoding device capable of implementing the technology of the present invention. Figure 1 A video encoding apparatus and elements of the apparatus are described below.
[0031] The video encoding apparatus includes a block partitioner 110 , a predictor 120 , a subtractor 130 , a transformer 140 , a quantizer 145 , a rearrangement unit 150 , an entropy encoder 155 , an inverse quantizer 160 , an inverse transformer 165 , an adder 170 , a loop filter unit 180 , and a memory 190 .
[0032] Each element of the video encoding device may be implemented in hardware or software, or a combination of hardware and software. The functions of each element may be implemented as software, and a microprocessor may be implemented to execute the software functions corresponding to each element.
[0033] A video consists of one or more sequences including multiple images. Each image is divided into multiple regions, and encoding is performed on each region. For example, an image is divided into one or more tiles (tile) or / and slices (slice). In particular, one or more tiles can be defined as tile groups. Each tile or slice is divided into one or more coding tree units (coding tree unit, CTU). Each CTU is divided into one or more coding units (coding unit, CU) through a tree structure. The information applied to each CU is encoded as the syntax of the CU, and the information commonly applied to the CU included in a CTU is encoded as the syntax of the CTU. In addition, the information commonly applied to all blocks in a slice is encoded as the syntax of the slice header, and the information applied to all blocks constituting one or more images is encoded in the picture parameter set (Picture Parameter Set, PPS) or the picture header.
[0034] In addition, information commonly referenced by a sequence consisting of multiple images is encoded in a sequence parameter set (Sequence Parameter Set, SPS). In addition, information commonly applied to a tile or tile group can be encoded as the syntax of a tile header or tile group header. The syntax included in the SPS, PPS, slice header, and tile header or tile group header can be called a high-level syntax.
[0035] The block partitioner 110 is configured to determine the size of a coding tree unit (CTU). Information about the size of the CTU (CTU size) is encoded as the syntax of the SPS or PPS and transmitted to the video decoding device. In addition, the block partitioner 110 is configured to partition each image constituting the video into a plurality of CTUs of a predetermined size, and then recursively partition the CTU using a tree structure. In the tree structure, a leaf node is used as a coding unit (CU), which is a basic unit of coding.
[0036] The tree structure can be a quadtree (QuadTree, QT), a binary tree (BinaryTree, BT), a ternary tree (TernaryTree, TT), or a structure formed by a combination of two or more QT structures, BT structures and TT structures, wherein the quadtree (QT) is a node (or parent node) that is divided into four slave nodes (or child nodes) of the same size, the binary tree (BT) is a node that is divided into two slave nodes, and the ternary tree (TT) is a node that is divided into three slave nodes at a ratio of 1:2:1. For example, a quadtree plus binary tree (QuadTree plus BinaryTree, QTBT) structure can be used, or a quadtree plus binary tree ternary tree (QuadTree plus BinaryTree TernaryTree, QTBTTT) structure can be used. Here, BTTT can be collectively referred to as a multiple-type tree (MTT).
[0037] Figure 2 The QTBTTT segmentation tree structure is shown as an example. Figure 2 As shown, the CTU can first be divided into a QT structure. The QT segmentation can be repeated until the size of the segmented block reaches the minimum block size MinQTSize of the leaf node allowed in QT. The entropy encoder 155 encodes the first flag (QT_split_flag) indicating whether each node of the QT structure is divided into four nodes of the lower layer, and notifies the video decoding device with a signal. When the leaf node of QT is equal to or less than the maximum block size (MaxBTSize) of the root node allowed in BT, it can be further divided into one or more BT structures or TT structures. The BT structure and / or TT structure can have multiple segmentation directions. For example, there can be two directions, namely, the direction of horizontally segmenting the blocks of the nodes and the direction of vertically segmenting the blocks.
[0038] like Figure 2As shown, when the MTT splitting starts, the second flag (mtt_split_flag) indicating whether the node is split, the flag indicating the splitting direction (vertical or horizontal) in the case of splitting, and / or the flag indicating the splitting type (binary or trifurcated) are encoded by the entropy encoder 155, and the video decoding device is notified of the same by a signal. Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into 4 nodes of the lower layer, the CU split flag (split_cu_flag) indicating whether the node is split can be encoded. When the value of the CU split flag (split_cu_flag) indicates that the splitting is not performed, the block of the node becomes a leaf node in the split tree structure and is used as a coding unit (CU), which is a basic unit of coding. When the value of the CU split flag (split_cu_flag) indicates that the splitting is performed, the video encoding device starts to encode the flags from the first flag in the above-mentioned manner.
[0039] When QTBT is used as another example of a tree structure, there may be two types of segmentation, namely, a type of horizontally segmenting a block into two blocks of the same size (i.e., symmetrical horizontal segmentation) and a type of vertically segmenting a block into two blocks of the same size (i.e., symmetrical vertical segmentation). A segmentation flag (split_flag) indicating whether each node of the BT structure is segmented into blocks of the lower layer and segmentation type information indicating the segmentation type are encoded by the entropy encoder 155 and transmitted to the video decoding device. There may be an additional type of segmenting a block of a node into two asymmetric blocks. An asymmetric segmentation type may include a type of segmenting a block into two rectangular blocks at a size ratio of 1:3, or a type of segmenting a block of a node diagonally.
[0040] In addition, the CU may have various sizes according to the QTBT or QTBTTT partitioning of the CTU. In the following, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is referred to as the "current block". When the QTBTTT partitioning is adopted, the shape of the current block may be a square or a rectangle. The predictor 120 predicts the current block to generate a prediction block. The predictor 120 includes an intra predictor 122 and an inter predictor 124.
[0041] The intra-frame predictor 122 is configured to predict samples in the current block using samples (reference samples) located around the current block in the current image including the current block. There are multiple intra-frame prediction modes according to the prediction direction. For example, Figure 3 As shown, the plurality of intra prediction modes may include 2 non-directional modes and 65 directional modes, wherein the 2 non-directional modes include a planar mode and a DC mode. Neighboring samples and equations to be used are defined differently for each prediction mode.
[0042] The intra-frame predictor 122 can be configured to determine the intra-frame prediction mode to be used when encoding the current block. In some examples, the intra-frame predictor 122 can be configured to encode the current block using several intra-frame prediction modes and select the appropriate intra-frame prediction mode to be used from the tested modes. For example, the intra-frame predictor 122 can be configured to calculate the rate-distortion value using rate distortion analysis of several tested intra-frame prediction modes, and select the intra-frame prediction mode with the best rate-distortion characteristic from the tested modes.
[0043] The intra-frame predictor 122 is configured as one of the intra-frame prediction modes among the multiple intra-frame prediction modes, and predicts the current block using the adjacent pixels (reference pixels) and equations determined according to the selected intra-frame prediction mode. The information about the selected intra-frame prediction mode is encoded by the entropy encoder 155 and transmitted to the video decoding device. The inter-frame predictor 124 is configured to generate a prediction block of the current block by motion compensation. In addition, the inter-frame predictor 124 is configured to search for a block that is most similar to the current block in a reference image that has been encoded and decoded earlier than the current image, and use the searched block to generate a prediction block of the current block.
[0044] The inter-frame predictor is then configured to generate a motion vector corresponding to the displacement between the current block in the current image and the predicted block in the reference image. Typically, motion estimation is performed on the luma component, and the motion vector calculated based on the luma component is used for both the luma component and the chroma component. Motion information including information about the reference image and information about the motion vector used to predict the current block is encoded by the entropy encoder 155 and transmitted to the video decoding device.
[0045] The inter-frame predictor 124 may be configured to perform interpolation on a reference image or a reference block to increase prediction accuracy. In other words, a subsample is interpolated between two consecutive integer samples by applying a filter coefficient to a plurality of consecutive integer samples including two integer samples. When searching for a block most similar to the current block is performed on the interpolated reference image, the motion vector may be expressed at an accuracy level of fractional sample units, rather than at an accuracy level of integer sample units.
[0046] For each target area to be encoded, for example, each unit such as a slice, a tile, a CTU, or a CU, the precision or resolution of the motion vector may be set differently. When such an adaptive motion vector resolution is applied, information about the motion vector resolution to be applied to each target area should be signaled for each target area. For example, when the target area is a CU, information about the motion vector resolution applied to each CU is signaled. The information about the motion vector resolution may be information indicating the precision of the motion vector difference, which will be described later.
[0047] The inter-frame predictor 124 can be configured to perform inter-frame prediction using bidirectional prediction. In bidirectional prediction, the inter-frame predictor 124 uses two reference images and two motion vectors representing the block positions in each reference image that are most similar to the current block. The inter-frame predictor 124 is configured to select a first reference image and a second reference image from reference image list 0 (RefPicList0) and reference image list 1 (RefPicList1), respectively, search for blocks similar to the current block in each reference image, and generate a first reference block and a second reference block. The inter-frame predictor 124 is then configured to generate a prediction block for the current block by averaging or weighting the first reference block and the second reference block. The inter-frame predictor 124 is then configured to transmit motion information including information about the two reference images and two motion vectors used to predict the current block to the encoder.
[0048] Specifically, RefPicList0 may consist of images that are before the current image in the display order in the reconstructed image, and RefPicList1 may consist of images that are after the current image in the display order in the reconstructed image. However, the embodiment is not limited thereto. The pre-reconstructed image that is after the current image in the display order may be further included in RefPicList0, and conversely, the pre-reconstructed image that is before the current image may be further included in RefPicList1.
[0049] Various methods can be used to minimize the number of bits required to encode motion information. For example, when the reference image and motion vector of the current block are the same as the reference image and motion vector of the adjacent block, the motion information about the current block can be sent to the decoding device through the encoding information for identifying the adjacent block. This method is called "merge mode".
[0050] In the merge mode, the inter-frame predictor 124 selects a predetermined number of merge candidate blocks (hereinafter referred to as "merge candidates") from the neighboring blocks of the current block. Figure 4As shown, all or part of the left block L, the upper block A, the upper right block AR, the lower left block BL, and the upper left block AL adjacent to the current block in the current image can be used as adjacent blocks for deriving merge candidates. In addition, in addition to the current image where the current block is located, blocks located in a reference image (which may be the same as or different from the reference image used to predict the current block) can be used as merge candidates. For example, a co-located block at the same position as the current block in the reference image or a block adjacent to the co-located block can be additionally used as a merge candidate.
[0051] The inter-frame predictor 124 uses such neighboring blocks to configure a merge list including a predetermined number of merge candidates. The inter-frame predictor 124 is configured to select a merge candidate to be used as motion information about the current block from among the merge candidates included in the merge list, and generate merge index information for identifying the selected candidate. The generated merge index information is encoded by the encoder 155 and sent to the decoding device.
[0052] Another method for encoding motion information is the AMVP mode. In the AMVP mode, the inter-frame predictor 124 is configured to utilize neighboring blocks of the current block to derive motion vector candidates for prediction of the motion vector of the current block. Figure 2 In the current image in the reference image, all or part of the left block L, the upper block A, the upper right block AR, the lower left block BL, and the upper left block AL adjacent to the current block can be used as the adjacent blocks for deriving the predicted motion vector candidate. In addition, in addition to the current image including the current block, blocks located in a reference image (which may be the same as or different from the reference image used to predict the current block) can be used as the adjacent blocks for deriving the predicted motion vector candidate. For example, a co-located block at the same position as the current block in the reference image or a block adjacent to the co-located block can be used.
[0053] The inter-frame predictor 124 is configured to derive predicted motion vector candidates using the motion vectors of the neighboring blocks, and determine the predicted motion vector for the motion vector of the current block using the predicted motion vector candidates. Then, the motion vector difference is calculated by subtracting the predicted motion vector from the motion vector of the current block.
[0054] The predicted motion vector can be obtained by applying a predefined function (e.g., a function for calculating a median, an average, etc.) to the predicted motion vector candidate. In particular, the video decoding device also knows the predefined function. Since the neighboring blocks used to derive the predicted motion vector candidate have been encoded and decoded, the video decoding device also already knows the motion vectors of the neighboring blocks. Accordingly, the video encoding device does not need to encode information for identifying the predicted motion vector candidate. Therefore, in this case, information about the motion vector difference and information about the reference image used to predict the current block are encoded.
[0055] The predicted motion vector may be determined by selecting any one of the predicted motion vector candidates. Specifically, information for identifying the selected predicted motion vector candidate is further encoded together with information about a motion vector difference to be used for predicting the current block and information about a reference image.
[0056] The subtractor 130 is configured to subtract the prediction block generated by the intra predictor 122 or the inter predictor 124 from the current block to generate a residual block. The transformer 140 can be configured to divide the residual block into one or more sub-blocks and apply a transform to the one or more sub-blocks, thereby transforming the residual value of the transform block from the sample domain to the frequency domain. In the frequency domain, the transform block is referred to as a coefficient block or a transform block containing one or more transform coefficient values. A two-dimensional transform kernel can be used for the transform, while a one-dimensional transform kernel can be used for horizontal transform and vertical transform, respectively. The transform kernel can be based on a discrete cosine transform (DCT), a discrete sine transform (DST), etc.
[0057] The transformer 140 may be configured to transform the residual signal in the residual block using the entire size of the residual block as a transform unit. Alternatively, the residual block may be partitioned into a plurality of sub-blocks, and the residual signal in the sub-block may be transformed using the sub-block as a transform unit.
[0058] The transformer 140 may be configured to transform the residual block separately in the horizontal direction and the vertical direction. For the transformation, various types of transformation functions or transformation matrices may be used. For example, the paired transformation functions for horizontal transformation and vertical transformation may be defined as a multiple transform set (MTS). The transformer 140 may be configured to select a pair of transformation functions with the best transformation efficiency in the MTS, and transform the residual block in the horizontal direction and the vertical direction, respectively. The information (mts_idx) about the transformation function pair selected in the MTS is encoded by the entropy encoder 155 and notified to the video decoding device with a signal.
[0059] The quantizer 145 is configured to quantize the transform coefficients output from the transformer 140 using a quantization parameter and output the quantized transform coefficients to the entropy encoder 155. For some blocks or frames, the quantizer 145 may be configured to directly quantize the relevant residual block without transformation. The quantizer 145 may be configured to apply different quantization coefficients (scaling values) according to the position of the transform coefficients in the transform block. The matrix of quantized coefficients applied to the quantized transform coefficients arranged in two dimensions may be encoded and signaled to the video decoding device.
[0060] The rearrangement unit 150 may be configured to reclassify the coefficient values of the residual values used for quantization. The rearrangement unit 150 may be configured to change the 2-dimensional coefficient array into a 1-dimensional coefficient sequence by coefficient scanning. For example, the rearrangement unit 150 may be configured to scan the coefficients from the DC coefficient to the coefficients in the high frequency region using a zig-zag scan or a diagonal scan to output a 1-dimensional coefficient sequence. Depending on the size of the transform unit and the intra-frame prediction mode, a vertical scan or a horizontal scan may be used instead of a zig-zag scan, wherein the vertical scan scans the two-dimensional array of coefficients in the column direction, and the horizontal scan scans the coefficients in the two-dimensional block shape in the row direction. In other words, the scanning mode to be used may be determined among the zig-zag scan, the diagonal scan, the vertical scan, and the horizontal scan according to the size of the transform unit and the intra-frame prediction mode.
[0061] The entropy encoder 155 is configured to encode the one-dimensional quantized transform coefficient output from the rearrangement unit 150 using various encoding techniques such as context-based adaptive binary arithmetic coding (CABAC) and exponential Golomb to generate a bitstream. The entropy encoder 155 is configured to encode information related to block partitioning (e.g., CTU size, CU partition flag, QT partition flag, MTT partition type, and MTT partition direction) so that the video decoding device can partition the block in the same manner as the video encoding device.
[0062] In addition, the entropy encoder 155 is configured to encode information about a prediction type indicating whether the current block is encoded by intra-frame prediction or inter-frame prediction, and encodes intra-frame prediction information (i.e., information about the intra-frame prediction mode) or inter-frame prediction information (merge index for merge mode, information about reference image index and motion vector difference for AMVP mode) according to the prediction type. In addition, the entropy encoder 155 also encodes information related to quantization (i.e., information about quantization parameters and information about quantization matrices).
[0063] The inverse quantizer 160 is configured to inversely quantize the quantized transform coefficient output from the quantizer 145 to generate a transform coefficient. The inverse transformer 165 is configured to transform the transform coefficient output from the inverse quantizer 160 from the frequency domain to the spatial domain and reconstruct a residual block.
[0064] In addition, the adder 170 is configured to add the reconstructed residual block and the prediction block generated by the predictor 120 to reconstruct the current block. The samples in the reconstructed current block are used as reference samples when performing intra-frame prediction of subsequent blocks. The loop filter unit 180 is configured to filter the reconstructed samples to reduce blocking artifacts, ringing artifacts, and blurring artifacts caused by block-based prediction and transformation / quantization. The loop filter unit 180 may include at least one of a deblocking filter 182, a sample adaptive offset (SAO) filter 184, or an adaptive loop filter (ALF) 186.
[0065] The deblocking filter 182 is configured to filter the boundaries between the reconstructed blocks to remove the block artifacts caused by block-by-block encoding / decoding, and the SAO filter 184 performs additional filtering on the deblocking filtered video. The SAO filter 184 is a filter for compensating the difference between the reconstructed sample and the original sample caused by lossy coding, and performs filtering in a manner of adding the corresponding offset to each reconstructed sample. The ALF 186 is configured to perform filtering on the target sample to be filtered by applying the filter coefficient to the target sample and the adjacent samples of the target sample. The ALF 186 can be configured to divide the samples included in the image into predetermined groups, and then determine a filter to be applied to the corresponding group to perform filtering on each group differentially. Information about the filter coefficient to be used for the ALF can be encoded and notified to the video decoding device with a signal.
[0066] The reconstructed blocks filtered by the loop filtering unit 180 are stored in the memory 190. Once all blocks in one image are reconstructed, the reconstructed image may be used as a reference image for inter-frame prediction of blocks in a subsequent image to be encoded.
[0067] Figure 5 is an exemplary functional block diagram of a video decoding device capable of implementing the technology of the present invention. Figure 5 The video decoding apparatus and elements of the apparatus are described below. The video decoding apparatus may include an entropy decoder 510, a rearrangement unit 515, an inverse quantizer 520, an inverse transformer 530, a predictor 540, an adder 550, a loop filter unit 560, and a memory 570.
[0068] Similar to Figure 1 In the video encoding device of the present invention, each element of the video decoding device can be implemented by hardware, software or a combination of hardware and software. In addition, the function of each element can be implemented by software, and the microprocessor can be implemented to execute the software function corresponding to each element.
[0069] The entropy decoder 510 is configured to determine the current block to be decoded by decoding the bit stream generated by the video encoding device and extracting information related to block partitioning, and extract prediction information required to reconstruct the current block and information about the residual signal, etc. In addition, the entropy decoder 510 is configured to extract information about the CTU size from a sequence parameter set (SPS) or a picture parameter set (PPS), determine the size of the CTU, and partition the image into CTUs of a determined size. Then, the decoder is configured to determine the CTU as the highest level (i.e., the root node) of the tree structure, and extract partition information about the CTU to partition the CTU using the tree structure.
[0070] For example, when the CTU is segmented using the QTBTTT structure, the first flag (QT_split_flag) related to the segmentation of the QT is extracted to segment each node into four nodes of the sublayer. For the node corresponding to the leaf node of the QT, the second flag (MTT_split_flag) related to the segmentation of the MTT and the information about the segmentation direction (vertical / horizontal) and / or the segmentation type (binary / trifurcated) are extracted, so as to segment the corresponding leaf node with the MTT structure. Accordingly, each node below the leaf node of the QT is recursively segmented with the BT or TT structure.
[0071] As another example, when a CTU is split using a QTBTTT structure, a CU split flag (split_cu_flag) indicating whether the CU is split can be extracted. When the corresponding block is split, the first flag (QT_split_flag) can be extracted. In the split operation, after zero or more recursive QT splits, zero or more recursive MTT splits may occur for each node. For example, a CTU can be configured to directly undergo MTT splitting without undergoing QT splitting, or to only undergo QT splitting multiple times.
[0072] As another example, when the CTU is segmented using the QTBT structure, the first flag (QT_split_flag) related to the QT segmentation is extracted, and each node is segmented into four nodes of the lower layer. Then, the segmentation flag (split_flag) indicating whether the node corresponding to the leaf node of the QT is further segmented with the BT and the segmentation direction information are extracted.
[0073] Once the current block to be decoded is determined by tree structure partitioning, the entropy decoder 510 is configured to extract information about the prediction type indicating whether the current block is intra-predicted or inter-predicted. When the prediction type information indicates intra-prediction, the entropy decoder 510 is configured to extract syntax elements for intra-prediction information (intra-prediction mode) of the current block. When the prediction type information indicates inter-prediction, the entropy decoder 510 is configured to extract syntax elements for inter-prediction information, that is, information indicating a motion vector and a reference image referenced by the motion vector.
[0074] The entropy decoder 510 is further configured to extract information about the transform coefficients of the quantized current block as information related to quantization and information about the residual signal. The rearrangement unit 515 may be configured to change the sequence of the one-dimensional quantized transform coefficients entropy decoded by the entropy decoder 510 into a 2-dimensional coefficient array (i.e., block) in the reverse order of the coefficient scanning performed by the video encoding device.
[0075] The inverse quantizer 520 is configured to inverse quantize the quantized transform coefficients using the quantization parameters. The inverse quantizer 520 can be configured to apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in two dimensions. The inverse quantizer 520 can be configured to perform inverse quantization by applying a quantization coefficient (scaling value) matrix from a video encoding device to a 2-dimensional coefficient array of the quantized transform coefficients.
[0076] The inverse transformer 530 is configured to inversely transform the inversely quantized transform coefficient from the frequency domain to the spatial domain to reconstruct the residual signal, thereby generating a reconstructed residual block of the current block. In addition, when MTS is applied, the inverse transformer 530 is configured to determine the transform function or transform matrix to be applied in the horizontal direction and the vertical direction, respectively, using the MTS information (mts_idx) signaled from the video encoding device, and inversely transform the transform coefficient in the transform block in the horizontal direction and the vertical direction using the determined transform function.
[0077] The predictor 540 may include an intra predictor 542 and an inter predictor 544. When the prediction type of the current block is intra prediction, the intra predictor 542 is activated, and when the prediction type of the current block is inter prediction, the inter predictor 544 is activated. The intra predictor 542 is configured to determine an intra prediction mode of the current block among a plurality of intra prediction modes based on a syntax element of the intra prediction mode extracted from the entropy decoder 510, and predict the current block using reference samples around the current block according to the intra prediction mode.
[0078] The inter-frame predictor 544 is configured to determine the motion vector of the current block and the reference image referenced by the motion vector using the syntax elements of the intra-frame prediction mode extracted by the entropy decoder 510, and predict the current block based on the motion vector and the reference image. The adder 550 is configured to reconstruct the current block by adding the residual block output from the inverse transformer to the prediction block output from the inter-frame predictor or the intra-frame predictor. When intra-frame prediction is performed on the subsequent block to be decoded, the sample in the reconstructed current block is used as a reference sample.
[0079] The loop filtering unit 560 may include at least one of a deblocking filter 562, an SAO filter 564, or an ALF 566. The deblocking filter 562 performs deblocking filtering on the boundaries between the reconstructed blocks to remove block artifacts caused by block-by-block decoding. The SAO filter 564 is configured to perform filtering in a manner that adds the reconstructed blocks after deblocking filtering the corresponding offsets to compensate for the difference between the reconstructed samples and the original samples caused by lossy coding. The ALF 566 is configured to perform filtering on the target sample to be filtered by applying the filter coefficients to the target sample and the adjacent samples of the target sample. The ALF 566 may be configured to divide the samples in the image into predetermined groups, and then determine a filter to be applied to the corresponding group to perform filtering on each group differentially. The filter coefficients of the ALF are determined based on information about the filter coefficients decoded from the bitstream.
[0080] The reconstructed blocks filtered by the loop filtering unit 560 are stored in the memory 570. When all blocks in one image are reconstructed, the reconstructed image is used as a reference image for inter-frame prediction of blocks in a subsequent image to be encoded.
[0081] The following disclosure relates to a coding tool for improving compression performance of inter-frame prediction, which can be operated by the inter-frame predictor 124 of a video encoding device and the inter-frame predictor 544 of a video decoding device. As used herein, the term "target block" may have the same meaning as the term "current block" or "coding unit (CU)" used above, or may represent a local area of a CU.
[0082] I. Bidirectional Optical Flow
[0083] Bidirectional optical flow is a technique for additionally compensating for the motion of samples predicted using bidirectional motion prediction, assuming that samples or objects constituting a video move at a constant speed and that sample values hardly change.
[0084] Figure 6 is an exemplary diagram showing the basic concept of BIO. Assume that by (normal) bidirectional motion prediction for the target block, in the reference image Ref 0 and Ref 1 The bidirectional motion vector MV pointing to the corresponding area (ie, the reference block) that is most similar to the target block to be encoded in the current image has been determined. 0 and MV 1 The two motion vectors have values that represent the motion of the entire target block. Figure 6 In the example, P 0 The motion vector MV 0 The reference image Ref corresponding to the sample P in the target block is indicated 0 The samples in P 1 The motion vector MV 1 The reference image Ref corresponding to the sample P in the target block is indicated 1 The samples in .
[0085] In addition, assuming Figure 6 The motion of the sample P in is slightly different from the overall motion of the target block. Figure 6 Ref 0 The object at sample A in the target block of the current image moves to Ref via sample P in the target block of the current image. 1 When sample B in , sample A and sample B can have values very similar to each other. In addition, in this case, Ref 0 The point in the target block that is most similar to the sample P is not represented by the bidirectional motion vector MV 0 Indicated P 0 , but from P 0 Shifted by a predetermined displacement vector (v x t 0 , v y t 1) of sample A. Ref 1 The point in the target block that is most similar to the sample P is not represented by the bidirectional motion vector MV 1 Indicated P 1 , but from P 1 Shifted by a predetermined displacement vector (-v x t 0 , -v y t 1 ) of sample B. Specifically, t 0 and t 1 Respectively represent Ref 0 and Ref 1 The temporal distance relative to the current image and is calculated based on the picture order count (POC). x , v y ) is called "optical flow".
[0086] When predicting the value of sample P of the current block in the current image, two reference samples A and B can achieve a better prediction than the value of the sample P of the current block in the current image. 0 and MV 1 Indicated reference sample P 0 and P 1 More accurate predictions. Specifically, I (0) (i, j) represents the motion vector MV 0 The reference image Ref corresponding to the sample (i, j) in the target block 0 The value of the sample in, and I (1) (i, j) represents the motion vector MV 1 The reference image Ref corresponding to the sample (i, j) in the target block 1 The value of the sample in .
[0087] By BIO motion vector (v x , v y ) indicates the reference image Ref corresponding to the sample in the target block 0 The value of sample A in can be defined as I (0) (i+v x t 0 , j+v y t 0 ), and the reference image Ref 1 The value of sample B in can be defined as I (1) (iv x t 1 , jv y t 1). Here, when linear approximation is performed using only the first-order term of the Taylor series, A and B can be expressed as Equation 1.
[0088] Equation 1
[0089]
[0090] Among them, I x (k) and I y (k) (k=0, 1) is in Ref 0 and Ref 1 The gradient value in the horizontal and vertical directions at the position (i, j). In addition, t 0 and t 1 Respectively represent Ref 0 and Ref 1 The time axis distance relative to the current image and based on POC:t 0 =POC(Current)-POC(Ref 0 ), and t 1 =POC(Ref 1 )-POC(current) is used to calculate.
[0091] The bidirectional optical flow of each sample in the block (v x , v y ) is determined as the solution that minimizes Δ, which is defined as the difference between sample A and sample B. Δ can be defined by Equation 2 using the linear approximation of A and B derived from Equation 1.
[0092] Equation 2
[0093]
[0094] For simplicity, the sample position (i, j) is omitted from each term in Equation 2.
[0095] In order to achieve a more robust optical flow estimation, it is assumed that the motion is locally consistent with neighboring samples. For the BIO motion vector of the current sample (i, j) to be predicted, the difference Δ in equation 2 of all samples (i', j') present in a mask Ω of a certain size centered on the sample (i, j) is considered. That is, the optical flow of the current sample (i, j) can be determined to make the objective function Φ(v x , v y ) minimized vector, the objective function Φ(v x , v y ) is the sum of the squares of the differences Δ[i′, j′] obtained for each sample in the mask Ω, as shown in Equation 3.
[0096] Equation 3
[0097]
[0098] The bidirectional optical flow of the present invention can be applied to a case where one of the two reference images used for bidirectional prediction is before the current image in display order, and the other is after the current image, and the distances between the two reference images and the current image are equal to each other, that is, the differences in picture order counts (POCs) between each reference image and the current image are equal to each other. Therefore, t 0 and t 1 Can be ignored.
[0099] In addition, the bidirectional optical flow of the present invention can be applied only to the luminance component. For a target block to which bidirectional prediction is applied, the bidirectional optical flow of the present invention is performed based on a sub-block rather than a pixel. In the following description, for simplicity, it is assumed that a sub-block of various sizes, which may be 2×2, 4×4, and 8×8, has a size of 4×4.
[0100] Before performing the optical flow, the inter-frame predictor 124 of the video encoding apparatus generates two reference blocks for the target block using the above-mentioned bidirectional prediction. The first reference block of the two reference blocks represents the first motion vector MV 0 From the reference image Ref 0 The second reference block represents a block composed of samples of the prediction generated using the motion vector MV 1 From the reference image Ref 1 The generated predictions consist of blocks of samples.
[0101] The inter-frame predictor 124 is configured to calculate a so-called optical flow (v) for each of the 4×4 sub-blocks constituting the target block using the horizontal gradient values and the vertical gradient values of the predicted samples in the first reference block and the second reference block. x , v y ). Optical flow (v x , v y ) is determined such that 0 The predicted samples are compared with the reference image Ref 1 The inter-frame predictor 124 is configured to use (v x , v y ) and the gradient of the predicted samples in the 4×4 sub-block to derive the sample offsets used to modify the bidirectionally predicted samples of the 4×4 sub-block.
[0102] Specifically, the inter-frame predictor 124 calculates the horizontal gradient and the vertical gradient of the sample value at the position (i, j) using Equation 4.
[0103] Equation 4
[0104]
[0105] Where k is 0 or 1, I (0) (i, j) and I (1) (i, j) represent the sample values at the position (i, j) in the first reference block and the second reference block, respectively. In addition, Shift1 is a value derived from the bit depth of the luminance component, for example, Shift1 = max(6, bit depth - 6).
[0106] In order to derive the gradient of samples located at the boundary of each reference block, samples outside the boundary of the first reference block and the second reference block are needed. Figure 7 As shown, each reference block is extended by one column to the left and right, and by one row to the top and bottom. In order to reduce the amount of calculation, each sample in the extended portion can be filled with a sample at the nearest position or an integer sample in the reference block. In addition, the gradient at the sample position outside the boundary of each reference block can be filled with the gradient corresponding to the sample at the nearest position.
[0107] The inter-frame predictor 124 is configured to calculate S1, S2, S3, S5 and S6 corresponding to the autocorrelation and cross-correlation of the gradients using the horizontal gradient and the vertical gradient in the 6×6 window covering the 4×4 sub-block, as shown in FIG. Figure 7 shown.
[0108] Equation 5
[0109] S 1 =∑ (i,j)∈Ω ψ x (i, j)·ψ x (i, j), S 3 =∑ (i,j)∈Ω θ(i, j)·ψ x (i, j)
[0110]
[0111] S 5 =∑ (i,j)∈Ω ψ y (i, j)·ψ y (i, j) R 6 =∑ (i,j)∈Ω θ(i, j)·ψ y (i, j)
[0112] Where Ω represents the window covering the sub-block. In addition, as shown in Equation 6 below, Ψ x (i, j) represents the sum of the horizontal gradient values at position (i, j) in the first reference block and the second reference block, Ψ y(i, j) represents the sum of the vertical gradient values at the position (i, j) in the first reference block and the second reference block, and θ(i, j) represents the difference between the sample value at the position (i, j) in the second reference block and the sample value at the position (i, j) in the first reference block.
[0113] Equation 6
[0114]
[0115] θ(i, j)=(I (1) (i, j)>>n b )-(I (0) (i, j)>>n b )
[0116] Among them, n a and n b is a value derived from the bit depth, and has values of min(1, bit depth - 11) and min(4, bit depth - 8).
[0117] The inter-frame predictor 124 is configured to calculate the optical flow (v x , v y ).
[0118] Equation 7
[0119]
[0120] in, th′ BIO =2 max(5,BD-7 ). is the floor function, and
[0121] The sample offset of the sample used to modify the prediction at each sample position (x, y) in the 4×4 sub-block in the target block can be calculated using the optical flow calculated for the 4×4 sub-block and the gradient value at the sample position (x, y), as shown in Equation 8. In Equation 8, rnd() represents a rounding operation.
[0122] Equation 8
[0123]
[0124] The inter-frame predictor 124 is configured to use the sample offset b(x, y) at the position (x, y) and the prediction sample I in the first reference block. (0) (x, y) and the predicted sample I in the second reference block (1)(x, y) to generate the final predicted sample pred(x, y), as shown in Equation 9.
[0125] Equation 9
[0126] pred(x,y)=(I (0) (x,y)+I (1) (x, y) + b(x, y) + o offset )>>shift
[0127] Where shift is Max(3,15-bit depth), and O offset is the value used for rounding operations and is half of shift.
[0128] As described above, the bidirectional optical flow technique uses the values of samples predicted using motion information (two motion vectors and two reference images) for bidirectional prediction. Therefore, the inter-frame predictor 544 of the video decoding device can also be configured to perform bidirectional optical flow in the same manner as the video encoding device using motion information (motion vectors, reference images) for bidirectional prediction received from the video encoding device. There is no need for the video encoding device to signal the video decoding device with additional information for bidirectional optical flow processing.
[0129] II. Affine Motion Prediction
[0130] The above-mentioned inter-frame prediction is a motion prediction that reflects a translational motion model. In other words, this is a technique for predicting motion in the horizontal direction (x-axis direction) and the vertical direction (y-axis direction). However, in reality, there may be various types of motion, for example, rotation, enlargement or reduction in addition to translational motion. One aspect of the present invention provides affine motion prediction that can cover such various types of motion.
[0131] Fig. 8A and Figure 8B is an exemplary diagram showing affine motion prediction. There may be two types of models for affine motion prediction. One model is a model using motion vectors of two control points at the upper left and upper right corners of the target block currently to be encoded, that is, four parameters such as Fig. 8A Another model is a model that uses the motion vectors of three control points at the upper left corner, upper right corner, and lower left corner of the target block, that is, six parameters, such as Figure 8B shown.
[0132] The four parameter affine model is expressed by Equation 10. The motion at the sample position (x, y) in the target block can be calculated by Equation 10. Here, it is assumed that the position of the upper left sample of the target block is (0, 0).
[0133] Equation 10
[0134]
[0135] The six parameter affine model is expressed by Equation 11. The motion at the sample position (x, y) in the target block can be calculated by Equation 11.
[0136] Equation 11
[0137]
[0138] Among them, (mv 0x , mv 0y ) is the motion vector of the upper left control point, (mv 1x , mv 1y ) is the motion vector of the upper right control point, and (mv 2x , mv 2y ) is the motion vector of the lower left control point. w is a constant determined by the horizontal length of the target block, and H is a constant determined by the vertical length of the target block.
[0139] Affine motion prediction can be performed on each sample in the target block using the motion vector calculated by Equation 10 or Equation 11. Alternatively, in order to reduce computational complexity, prediction can be performed on each sub-block partitioned from the target block, such as Fig. 9 As shown. For example, the size of the sub-block may be 4×4, 2×2, or 8×8. In the following exemplary embodiment, affine motion prediction for the target block is performed based on a 4×4 sub-block. This example is only for ease of explanation, and the present invention is not limited thereto.
[0140] In the sub-block based affine motion prediction, the motion vector (affine motion vector) of each sub-block is calculated by substituting the center position of each sub-block into (x, y) of Equation 10 or Equation 11. Specifically, the center position may be the actual center point of the sub-block or the lower right sample position of the center point. For example, in the case of a 4×4 sub-block whose coordinates of the lower left sample are (0, 0), the center position of the sub-block may be (1.5, 1.5) or (2, 2). Using the affine motion vector (mv x , mv y ) to generate a predicted block for each sub-block.
[0141] Motion vector (mv x , mv y ) can be set to have 1 / 16 sample accuracy. Specifically, the motion vector (mv) calculated by equation 10 or equation 11 is x , mv y) can be rounded in 1 / 16 sample units. Adaptive motion vector resolution can be applied to affine motion prediction, just like in normal inter prediction. Specifically, information about the motion vector resolution of the target block (that is, the accuracy of the motion vector) is signaled for each target block.
[0142] Affine motion prediction can be performed not only on the luma component but also on the chroma component. In the case of a 4:2:0 video format, when affine motion prediction for the luma component is performed based on a 4×4 sub-block, affine motion prediction for the chroma component can be performed based on a 2×2 sub-block. The motion vector (mv) of each sub-block of the chroma component can be derived from the motion vector of the corresponding luma component. x , mv y ). Alternatively, the size of the sub-block used for affine motion prediction of the chrominance component may be the same as the size of the sub-block used for the luma component.
[0143] When affine motion prediction for luma components is performed based on 4×4 sub-blocks, affine motion prediction for chroma components can also be performed based on 4×4 sub-blocks. In this case, since the 4×4 sub-block for chroma components corresponds to four 4×4 sub-blocks for luma components, the motion vector (mv) of the sub-block for the chroma components can be calculated by calculating the average of the motion vectors of the four corresponding sub-blocks of the luma component. x , mv y ).
[0144] The video encoding device performs intra prediction, inter prediction (translational motion prediction), affine motion prediction, etc., and calculates the rate-distortion (RD) cost to select the best prediction method. In order to perform affine motion prediction, the inter predictor 124 of the video encoding device determines which type of model of the two types of models to use, and determines two or three control points according to the determined type. The inter predictor 124 calculates the motion vector (mv) of each sub-block in the 4×4 sub-block in the target block using the motion vector of the control point. x , mv y Then, the inter-frame predictor 124 uses the motion vector (mv x , mv y ) performs motion compensation in a reference image on a sub-block by sub-block basis to generate a predicted block for each sub-block in a target block.
[0145] The entropy encoder 155 of the video encoding device is configured to encode an affine-related syntax element including a flag indicating whether affine motion prediction is applied to the target block, type information indicating the type of the affine model, and motion information indicating the motion vector of each control point, and transmit it to the video decoding device. When affine motion prediction is performed, type information and motion information about the control point can be signaled, and motion vectors of as many control points as the number determined according to the type information can be signaled. In addition, when adaptive motion vector resolution is applied, motion vector resolution information about the affine motion vector of the target block is signaled.
[0146] The video decoding apparatus is configured to determine the type of the affine model and the control point motion vector using the syntax elements notified by the signal, and calculate the motion vector (mv) of each 4×4 sub-block in the target block using Equation 10 or Equation 11. x , mv y ). When the motion vector resolution information about the affine motion vector of the target block is signaled, the motion vector (mv x , mv y ) is corrected to the accuracy identified by the motion vector resolution information.
[0147] The video decoding apparatus is configured to use a motion vector (mv x , mv y ) Motion compensation is performed within the reference image to generate a predicted block for each subblock. In order to reduce the amount of bits required to encode the motion vector of the control point, a method such as that used in the above-mentioned normal inter-frame prediction (translational motion prediction) can be applied.
[0148] As an example, in the merge mode, the inter-frame predictor 124 of the video encoding device is configured to derive the motion vector of each control point from the neighboring blocks of the target block. Figure 4 The neighboring samples L, BL, A, AR and AL of the target block shown in the figure derive a predefined number of merge candidates to generate a merge candidate list. Each merge candidate included in the list corresponds to a pair of motion vectors of two or three control points.
[0149] First, the inter-frame predictor 124 is configured to derive merge candidates from the control point motion vectors of the neighboring blocks predicted in affine mode in the neighboring blocks. In some embodiments, the number of merge candidates derived from the neighboring blocks predicted in affine mode can be limited. For example, the inter-frame predictor 124 can be configured to derive two merge candidates from the neighboring blocks predicted in affine mode: one of L and BL and one of A, AR and AL. Priorities can be assigned in the order of L and BL and in the order of A, AR and AL. When the total number of merge candidates is greater than or equal to 3, the inter-frame predictor 124 can be configured to derive the necessary number of merge candidates from the translation motion vectors of the neighboring blocks.
[0150] Fig.10 is an exemplary diagram showing a method for deriving merge candidates for affine motion prediction from translation motion vectors of adjacent blocks. The inter-frame predictor 124 is configured to derive control point motion vectors CPMV1, CPMV2, CPMV3 from adjacent block groups {B2, B3, A2}, adjacent block groups {B1, B0}, and adjacent block groups {A1, A0}, respectively. As an example, the priority in each adjacent block group can be assigned in the order of B2, B3, A2, the order of B1 and B0, and the order of A1 and A0. In addition, another control point motion vector CPMV4 is derived from the co-located block T in the reference image. The inter-frame predictor 124 is configured to generate as many merge candidates as necessary by combining two or three of the four control point motion vectors. The combined priority assignment is shown below. The elements in each group are listed in the order of the upper left corner, upper right corner, and lower left corner of the control point motion vector.
[0151] {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}
[0152] The inter-frame predictor 124 is configured to select a merge candidate in the merge candidate list and perform affine motion prediction on the target block. When the selected candidate consists of two control point motion vectors, affine motion prediction is performed using a four-parameter model. On the other hand, when the selected candidate consists of three control point motion vectors, affine motion prediction is performed using a six-parameter model. The entropy encoder 155 of the video encoding device is configured to encode index information indicating the merge candidate selected from the merge candidates in the merge candidate list and signal it to the video decoding device.
[0153] The entropy decoder 510 of the video decoding device is configured to decode the index information signaled from the video encoding device. The inter-frame predictor 544 of the video decoding device constructs a merge candidate list in the same manner as the video encoding device, and performs affine motion prediction using a control point motion vector corresponding to the merge candidate indicated by the index information.
[0154] As another example, in the AMVP mode, the inter-frame predictor 124 of the video encoding device is configured to determine the type of the affine model and the control point motion vector for the target block. Then, the inter-frame predictor 124 is configured to calculate a motion vector difference, which is the difference between the actual control point motion vector of the target block and the predicted motion vector of each control point, and transmit the motion vector differences corresponding to the control points respectively.
[0155] Accordingly, the inter-frame predictor 124 of the video encoding device configures a list of a predefined number of affine AMVPs. When the target block is of a 4-parameter type, the candidates included in the list each consist of a pair of two control point motion vectors. On the other hand, when the target block is of a 6-parameter type, the candidates included in the list each consist of a pair of three control point motion vectors. The affine AMVP list can be derived using the control point motion vectors or translation motion vectors of the adjacent blocks in a manner similar to the above-mentioned method for constructing the merge candidate list.
[0156] However, in order to derive candidates to be included in the affine AMVP list, there may be a restriction that only neighboring blocks are considered, the neighboring blocks referenced with Figure 4 The target blocks in the adjacent blocks are the same as the reference image.
[0157] In addition, in the AMVP mode, the affine model type of the target block should be considered. When the affine model type of the target block is a 4-parameter type, the video encoding device is configured to use the affine model of the adjacent block to derive two control point motion vectors (the upper left and upper right control point motion vectors of the target block). When the affine model type of the target block is a 6-parameter type, the device uses the affine model of the adjacent block to derive three control point motion vectors (the upper left, upper right and lower left control point motion vectors of the target block).
[0158] When the neighboring block is of 4-parameter type, two or three control point motion vectors are predicted according to the affine model type of the target block using the two control point motion vectors of the neighboring block. For example, the affine model of the neighboring block expressed by equation 10 may be used. In equation 10, (mv 0x , mv 0y ) and (mv 1x , mv 1y) are replaced by the upper left and upper right control point motion vectors of the adjacent blocks, respectively. In particular, W is replaced by the horizontal length of the adjacent blocks. The predicted motion vector for each control point of the target block is derived by placing the difference between the position of the corresponding control point of the target block and the position of the upper left corner of the adjacent block into (x, y).
[0159] When the neighboring block is of 6-parameter type, two or three control point motion vectors are predicted according to the affine model type of the target block using the three control point motion vectors of the neighboring block. For example, the affine model of the neighboring block expressed by equation 11 may be used. In equation 11, (mv 0x , mv 0y )、(mv 1x , mv 1y ) and (mv 2x , mv 2y ) are replaced by the control point motion vectors of the upper left corner, upper right corner and lower left corner of the adjacent block, respectively. In particular, W and H are replaced by the horizontal length and vertical length of the adjacent block, respectively. The predicted motion vector for each control point of the target block is derived by placing the difference between the position of the corresponding control point of the target block and the position of the upper left corner of the adjacent block into (x, y).
[0160] The inter-frame predictor 124 of the video encoding device is configured to select a candidate in the affine AMVP list and generate a motion vector difference between the motion vector of each actual control point and the predicted motion vector of the corresponding control point of the selected candidate. The entropy encoder 155 of the video encoding device is configured to encode type information indicating the affine model type of the target block, index information indicating the selected candidate among the candidates in the affine AMVP list, and the motion vector difference corresponding to each control point, and send it to the video decoding device.
[0161] The inter-frame predictor 544 of the video decoding device is configured to determine the affine model type using the information notified by the video encoding device with a signal, and generate a motion vector difference for each control point. Then, the inter-frame predictor is configured to generate an affine AMVP list in the same manner as the video encoding device, and select a candidate indicated by the index information notified by the signal in the affine AMVP list. The inter-frame predictor 544 of the video decoding device is configured to calculate the motion vector of each control point by adding the predicted motion vector of each control point of the selected candidate to the corresponding motion vector difference.
[0162] III. Sample-by-sample adjustment of affine motion prediction samples
[0163] Subblock-by-subblock affine motion prediction for a target block has been described above. Another aspect of the invention relates to adjusting the sample values of predicted samples generated by subblock-by-subblock affine motion prediction on a sample-by-sample basis. Motion according to the position of each sample is additionally compensated in each subblock forming the basis for the affine motion prediction.
[0164] When the sample value in any one sub-block generated as a result of sub-block-by-sub-block affine motion prediction for the target block is I(x, y), the video encoding apparatus calculates the horizontal gradient g at each sample position. x (i, j) and vertical gradient g y (i, j). Equation 12 can be used to calculate the gradient.
[0165] Equation 12
[0166] g x (i,j)=I(i+1,j)-I(i-1,j)
[0167] g y (i,j)=I(i,j+1)-I(i,j-1)
[0168] The sample offset Δi(i, j) used to adjust the prediction sample is calculated by the following equation.
[0169] Equation 13
[0170] ΔI(i, j) = g x (i, j)*Δmv x (i, j)+g y (i, j)*Δmv y (i, j)
[0171] Among them, Δmv(i, j) represents the motion offset, that is, the difference between the affine motion vector in the sample (i, j) and the affine motion vector at the center position of the sub-block, and can be calculated by applying Equation 10 or Equation 11 according to the affine model type of the target block. In other words, Δmv(i, j) can be calculated according to Equation 10 or Equation 11 by subtracting the motion vector given when the sub-block center position is placed in (x, y) from the motion vector given when (i, j) is placed in (x, y). In addition, Δmv(i, j) can be calculated by substituting the horizontal offset and the vertical offset from the sub-block center position to the sample position (i, j) into (x, y) in Equation 11 and Equation 12 and eliminating the last term "+mv 0x ” and “+mv 0y ” is used to calculate Δmv(i, j) using the equation obtained by . The center position may be the actual center point of the sub-block, or may be the lower right sample position of the center point.
[0172] The motion vector of each control point of the target block used to calculate Δmv(i, j) and the difference between the sample position (i, j) and the center position of the sub-block are the same for all sub-blocks. Accordingly, the value of Δmv(i, j) can be calculated for only one sub-block (e.g., the first sub-block) and can be repeated for other sub-blocks.
[0173] The technique of the present invention is based on the assumption that the object moves at a constant speed and the sample values change smoothly. x ) and the y component (Δmv y ) are multiplied by the horizontal sample gradient value and the vertical sample gradient value to obtain the sample change in the horizontal direction and the sample change in the vertical direction. The sample offset ΔI(i, j) is calculated by adding the two sample changes. The final value of the predicted sample is calculated as follows.
[0174] Equation 14
[0175] I′(i,j)=I(i,j)+ΔI(i,j)
[0176] When the sample-by-sample adjustment for the affine motion prediction sample is applied, the inter-frame predictor 124 of the video encoding device and the inter-frame predictor 544 of the video decoding device perform the above-mentioned process to modify the sample value of the predicted sample generated by the affine motion prediction. The gradient value is derived from the predicted sample generated by the affine motion prediction, and Δmv(i, j) is derived from the control point motion vector of the target block. Therefore, the video encoding device is not required to signal the video decoding device with additional information for the process of the present technology.
[0177] IV. Local Illumination Compensation for Affine Motion Prediction Samples
[0178] The local illumination compensation technology is a coding technology that uses a linear model to compensate for the illumination change between the target block and the predicted block. The inter-frame predictor 124 of the video encoding device is configured to determine the reference block in the reference image using the motion vector (translation motion vector) of the target block, and to obtain the parameters of the linear model for illumination compensation using the pre-reconstructed samples around (the upper and left sides of) the reference block and the pre-reconstructed samples around (the upper and left sides of) the target block.
[0179] When the pre-reconstructed samples around the reference block are called x and the corresponding pre-reconstructed samples around the target block are called y, the parameters "A" and "b" are derived as in Equation 15 so that the sum of the squares of the differences between y and (Ax+b) is minimized.
[0180] Equation 15
[0181] argmin{∑(y-Ax-b) 2}
[0182] The final predicted sample is generated by applying the weight A and the offset b to the sample in the predicted block (reference block) generated by the motion vector of the target block, as shown in Equation 16. In Equation 16, pred[x][y] is the predicted sample at the position (x, y) generated by the motion vector of the target block, and pred LIC [x][y] are the final predicted samples after illumination compensation.
[0183] Equation 16
[0184] pred LIC [x][y]=A*pred[x][y]+b
[0185] Another aspect of the invention relates to techniques for combining illumination compensation techniques with affine motion prediction.
[0186] As described above, when sub-block-by-sub-block affine motion prediction is applied to a target block, a motion vector is generated for each sub-block. The corresponding motion vector for each sub-block can be used to derive illumination compensation parameters, and then the corresponding motion vector can be used to perform illumination compensation in units of sub-blocks. However, this not only increases the complexity of the calculation, but also causes delay problems. Since the reconstructed samples in each sub-block require illumination compensation for subsequent sub-blocks, the illumination compensation process for the sub-block should be suspended until the adjacent sub-blocks are reconstructed (that is, until both the prediction block and the residual block for the sub-block are reconstructed). The present invention is intended to solve these problems.
[0187] Fig.11A , Fig. 11B and Fig. 11C Various examples of determining the position of a reference block to derive illumination compensation parameters according to an embodiment of the present invention are shown. In this embodiment, one illumination compensation parameter set (A, b) for a target block is derived, and the same parameters are applied to all sub-blocks in the target block. That is, the entire target block is modified with one illumination compensation parameter set.
[0188] like Fig.11A As shown, the inter-frame predictor 124 of the video encoding device can be configured to determine the position of the reference block in the reference image using the affine motion vector of the sub-block located at the upper left of the target block or the motion vector of the upper left corner control point of the target block. The pre-reconstructed samples around the determined reference block are used for parameter derivation. Alternatively, as Fig. 11B As shown, the position of the reference block can be determined using the affine motion vector of the central sub-block in the target block. Once the position of the reference block is determined, the illumination compensation parameters are derived using the pre-reconstructed samples adjacent to the top and left sides of the reference block and the corresponding pre-reconstructed samples adjacent to the top and left sides of the target block.
[0189] As another example, multiple sub-blocks in the target block may be used. Fig. 11C As shown, the inter-frame predictor 124 uses the affine motion vector of the sub-block (boundary sub-block) located at the boundary in the target block to determine the reference sub-block corresponding to each boundary sub-block. Samples for deriving illumination compensation parameters are extracted from pre-reconstructed samples adjacent to the boundary sub-block and the corresponding reference sub-block in the target block, respectively. For the sub-block located at the top side boundary in the target block and the corresponding reference sub-block, samples are extracted from the pre-reconstructed samples adjacent to the top side. For the sub-block located at the left side boundary in the target block and the corresponding reference sub-block, samples are extracted from the pre-reconstructed samples adjacent to the left side.
[0190] In this embodiment, the above-mentioned delay problem can be solved by deriving illumination compensation parameters using pre-constructed samples around the target block and pre-constructed samples around the reference block. However, applying only one illumination compensation parameter to the target block to which sub-block-by-sub-block affine motion prediction is applied may potentially lead to lower coding efficiency. Another embodiment described below increases coding efficiency as a trade-off for a slight increase in complexity.
[0191] According to another embodiment of the present invention, the inter-frame predictor 124 of the video encoding device divides the target block into a plurality of regions. Each region includes at least one sub-block, which is a unit for performing affine motion prediction. The inter-frame predictor 124 is configured to calculate illumination compensation parameters for the plurality of regions, and perform illumination compensation in units of regions or sub-blocks in the target block based on the calculated illumination compensation parameters.
[0192] 1. Segmentation of target blocks
[0193] The inter predictor 124 of the video encoding apparatus is configured to partition a target block into a plurality of regions, each region including one or more sub-blocks which are units in which affine motion prediction is performed.
[0194] The target block may be divided by using the control point motion vectors of the target block. Fig. 12A and Fig. 12B This is an example of using control point motion vectors to segment a target block. Fig. 12A , when the upper left corner control point motion vector MV of the target block 0 and the motion vector MV of the upper right control point 1 When the angle between is an obtuse angle (greater than 90 degrees), the target block is split vertically. For example, the target block can be split into two regions. Otherwise, the target block is not split vertically. Fig. 12B , when the motion vector MV of the upper left control point 0 and the motion vector MV of the lower left control point 2When the angle between is an obtuse angle, the target block is split horizontally into, for example, two halves. Otherwise, the target block is not split horizontally. When the affine model type of the target block is 4 parameters, the motion vector MV of the lower left corner control point can be derived by substituting the coordinates of the lower left corner sample of the target block into (x, y) in equation 1. 2 .
[0195] Based on the angle formed by the control point motion vectors, the inter-frame predictor 124 either skips segmenting the target block, or segments the target block into two regions (a left region and a right region in the case of vertical segmentation, an upper region and a lower region in the case of horizontal segmentation) or into four regions. When the dot product of the two vectors is less than 0, the angle is an obtuse angle. Accordingly, the inter-frame predictor 124 can determine whether the angle between the control point motion vectors is an obtuse angle based on the dot product of the two vectors.
[0196] Although the above example shows that the target block is segmented when the angle between the two control point motion vectors is an obtuse angle, the block can also be segmented when the angle is an acute angle (an angle less than 90 degrees). In addition, the size of the target block can be considered when segmenting the target block. For example, when the horizontal length exceeds a preset threshold, the target block is segmented vertically. When the vertical length exceeds a preset threshold, the target block is segmented horizontally. In order to segment the target block, the size of the target block and the angle between the control point motion vectors can be used.
[0197] For example, the video encoding device may be configured to determine whether to segment the block based on the angle between the control point motion vectors only when the horizontal and / or vertical length of the target block is greater than a preset threshold. As another example, when the horizontal length exceeds the preset threshold, the video encoding device may be configured to determine whether to segment the block vertically based on the angle between the control point motion vectors of the upper left corner and the upper right corner of the target block. In addition, when the vertical length exceeds a predetermined threshold, the device may be configured to determine whether to segment the block vertically based on the angle between the control point motion vectors of the upper left corner and the lower left corner of the target block.
[0198] Although it has been described that the target block is divided into a plurality of regions based on the control point motion vector of the target block, the embodiment is not limited thereto. For example, the affine motion vectors of the upper left sub-block, the upper right sub-block, and the lower left sub-block in the target block may be used instead of the upper left control point motion vector MV 0 , the motion vector MV of the upper right corner control point 1 and the motion vector MV of the lower left control point 2 .
[0199] Although Fig. 12A and Fig. 12BIt is shown that the target block is divided into two in the horizontal direction or in the vertical direction, but the embodiment is not limited thereto. For example, the target block can be divided into multiple blocks in the horizontal direction and / or divided into multiple blocks in the vertical direction. Alternatively, the target block can be divided into sub-blocks that have performed affine motion prediction. In this case, one sub-block constitutes one region.
[0200] Each segmented region from the target block must be larger than or equal to the size of the sub-block for which affine motion prediction has been performed. In other words, each region must consist of one or more sub-blocks. For example, when the size of the sub-block is 4×4, the size of the region is 2 m ×2 n (wherein m and n are integers greater than or equal to 2).
[0201] When the target block is not segmented, the illumination compensation parameters may be derived according to the above-described first embodiment. Hereinafter, in the case where the target block is segmented, a method for deriving the illumination compensation parameters will be described.
[0202] 2. Derivation of illumination compensation parameters and illumination compensation
[0203] The video encoding device is configured to calculate illumination compensation parameters corresponding to a plurality of regions respectively. Illumination compensation is performed in units of regions or sub-blocks in a target block using a plurality of illumination compensation parameters. The video encoding device is configured to determine, for each of a plurality of regions, pre-constructed samples (reference samples) in a current image and a reference image to be used for deriving compensation parameters. The reference sample in the current image is selected from the pre-constructed samples adjacent to the target block. For an area spaced apart from the left boundary of the target block, a pre-constructed sample adjacent to the left side of the target block is selected as a reference sample. For an area spaced apart from the upper boundary of the target block, a pre-constructed sample adjacent to the top side of the target block is selected as a reference sample.
[0204] The reference sample in the reference image may be selected using the control point motion vector of the target block or one or more motion vectors derived from the control point motion vector. Hereinafter, a method for deriving illumination compensation parameters and performing illumination compensation according to various segmentation types of the target block will be described in detail.
[0205] 2-1. When the target block is divided into 4 regions
[0206] First, as an example, a case where a target block having a horizontal length of W and a vertical length of H is divided in the horizontal and vertical directions and thus consists of four regions will be described. The video encoding apparatus is configured to determine pre-constructed samples (reference samples) in a current image and a reference image to be used for deriving compensation parameters for each region.
[0207] Fig.13is an exemplary diagram showing a method for determining a reference sample to be used for deriving compensation parameters. For the upper left region in the target block, the video encoding apparatus selects a T adjacent to the top side of the upper left region in the current image. 0 To T W / 2-1 and L adjacent to the left side of the upper left region 0 To L H / 2-1 As the reference sample to be used for deriving compensation parameters. Then, the representative motion vector of the upper left region is used to determine the reference region corresponding to the upper left region in the reference image, and then the pre-constructed samples adjacent to the top and left sides of the reference region are selected as reference samples. Specifically, the representative motion vector of the upper left region can be the motion vector MV of the upper left corner control point of the target block 0 .
[0208] For the upper right region, the video encoding device is configured to select T adjacent to the top side of the upper right region. W / 2 To T W-1 As at least some reference samples to be used for deriving compensation parameters. Specifically, L adjacent to the left side of the target block may be additionally selected. 0 To L H / 2-1 As a reference sample. Since there is no pre-constructed sample near the left side of the upper right area, L on the left side of the target block 0 To L H / 2-1 It can be filled as a reference sample on the left side of the upper right area.
[0209] Then, the video encoding apparatus is configured to determine a reference area corresponding to the upper right area in the reference image using the representative motion vector of the upper right area, and select a pre-constructed sample adjacent to the top side of the reference area as a reference sample to be used for deriving the compensation parameter. 0 To L H / 2-1 When the video encoding device selects the pre-constructed sample adjacent to the left side of the reference area as the reference sample, the representative motion vector of the upper right area may be the upper right corner control point motion vector MV of the target block. 1 .
[0210] For the lower left region, the video encoding device selects the L adjacent to the left side of the lower left region. H / 2 To L H-1 As at least some reference samples. T adjacent to the top side of the target block may be additionally selected 0 To T W / 2-1Then, the video encoding apparatus is configured to determine a reference area corresponding to the lower left area in the reference image using the representative motion vector of the lower left area, and select a pre-constructed sample adjacent to the left side of the reference area as a reference sample. When T adjacent to the top side of the target block is additionally selected 0 To T W / 2-1 When , the video encoding device may be configured to additionally select a pre-constructed sample adjacent to the top side of the reference area. Here, the representative motion vector of the upper left area may be the motion vector MV of the lower left corner control point of the target block. 1 .
[0211] Once the reference samples of each of the upper left, upper right, and lower left regions in the target block are determined, the video encoding apparatus is configured to derive the illumination compensation parameter for each region by inserting the reference sample selected from the reference image and the reference sample selected from the current image into x and y of Equation 15, respectively. The illumination compensation parameter for the lower right region may be derived from the illumination compensation parameters of the upper left, upper right, and lower left regions. For example, the illumination compensation parameter for the lower right region may be set to the average of the illumination compensation parameters of the upper right region and the lower left region.
[0212] Alternatively, the video encoding device may be configured to determine a representative motion vector for the lower right region, and utilize the representative motion vector to derive the illumination compensation parameter for the lower right region. The representative motion vector for the lower right region may be the control point motion vector of the lower right corner of the target block. The video encoding device may be configured to derive the control point motion vector of the lower right corner of the target block by substituting the coordinates (W-1, H-1) of the lower right corner sample in the target block (the lower right corner sample of the lower right region) into (x, y) in Equation 10 or Equation 11.
[0213] There are no pre-constructed samples near the lower right area of the target block. Therefore, the T adjacent to the top and left sides of the target block W / 2 To T W-1 and L H / 2 To L H-1 is used as a reference sample for deriving compensation parameters. Then, a reference area in the reference image is determined based on the motion vector of the lower right corner control point of the target block, and pre-constructed samples adjacent to the top and left sides of the reference area are selected as reference samples. The video encoding device uses equation 15 and the selected reference samples to derive illumination compensation parameters for the lower right area.
[0214] In the above example, in order to determine the reference sample in the reference image for deriving the compensation parameter, the representative motion vector of each region is used. As an example, the control point motion vector (i.e., the parameter for affine motion prediction) is used. However, the embodiment is not limited to this. The representative motion vector of each region can be a motion vector derived from the control point motion vector of the target block.
[0215] In an exemplary embodiment, the representative motion vector of each region may be a motion vector of a predefined position derived from the control point motion vector of the target block. As an example, the affine motion vectors of the 4×4 upper left, upper right, lower left, and lower right sub-blocks in the target block pre-generated in affine motion prediction may be used as representative motion vectors of the upper left, upper right, lower left, and lower right regions, respectively. As another example, the affine motion vector at the center point of each of the upper left, upper right, lower left, and lower right regions may be used as the representative motion vector of each region. The affine motion vector at the center point of each region may be generated by substituting the center position of each region into (x, y) in Equation 10 or Equation 11.
[0216] In another exemplary embodiment, the average value of the affine motion vectors of the sub-blocks in each region may be used as the representative motion vector of the corresponding region. As another method of determining the reference samples to be used in the reference image to derive the compensation parameters, the affine motion vectors of the sub-blocks in each region may be used instead of the representative motion vector of each region. In other words, a 4×4 reference block at a position indicated by the affine motion vector of the 4×4 sub-block in each region may be determined in the reference image, and pre-constructed pixels adjacent to the top and left sides of the 4×4 reference block may be selected as reference pixels.
[0217] Fig.14 is an exemplary diagram for describing a method of performing illumination compensation using illumination compensation parameters for four regions of a target block. Each region includes one or more sub-blocks, which are units for performing affine transformation. Fig.14 In the example of , the upper left region TL, the upper right region TR, the lower left region BL, and the lower right region BR of the target block include four sub-blocks (4×4 sub-blocks) respectively. The video encoding device is configured to perform illumination compensation on the prediction samples in the corresponding region (the prediction samples generated by affine motion prediction) using the illumination compensation parameters of each region. Each sub-block can be compensated using the illumination compensation parameters of the region to which the sub-block belongs. For example, using the illumination compensation parameters of the upper left region (A 0 , b 0 ) to compensate for the four sub-blocks included in the upper left area.
[0218] In some other embodiments, the video encoding device may be configured to interpolate illumination compensation parameters corresponding to sub-blocks in each region by using illumination compensation parameters of the four regions TL, TR, BL, and BR, and then perform illumination compensation on each sub-block using the interpolated illumination compensation parameters. As described above, the illumination compensation parameters of each region may be derived from the representative motion vector of the region. However, the representative motion vector may not reflect the motion of all sub-blocks in the corresponding region.
[0219] For example, the illumination compensation parameters of each region can be derived from the control point motion vectors of the upper left control point, the upper right control point, the lower left control point, and the lower right control point of the target block, or the affine motion vectors of the 4×4 upper left, upper right, lower left, and lower right sub-blocks of the target block. In particular, the motion of the 4×4 upper left, upper right, lower left, and lower right sub-blocks may have a greater impact on the derivation of the illumination compensation parameters. Accordingly, the video encoding device can be configured to derive the illumination compensation parameters of each sub-block by interpolating the illumination compensation parameters of each region.
[0220] Fig.15 1 is an exemplary diagram showing a method for interpolating illumination compensation parameters of sub-blocks using illumination compensation parameters of respective regions. 0 , b 0 ) to (A 3 , b 3 ) are illumination compensation parameters of each region derived from the control point motion vectors of the upper left corner, upper right corner, lower left corner, and lower right corner of the target block, or from the affine motion vectors of the 4×4 upper left, upper right, lower left, and lower right sub-blocks of the target block. In addition, assume that (A 0 , b 0 ) is the illumination compensation parameter of the upper left 4×4 sub-block in the upper left area of the target block. Similarly, assuming (A 1 , b 1 ) to (A 3 , b 3 ) is the illumination compensation parameter of the upper right 4×4 sub-block in the upper right region, the illumination compensation parameter of the lower left 4×4 sub-block in the lower left region, and the illumination compensation parameter of the lower right 4×4 sub-block in the lower right region. In other words, assuming (A 0 , b 0 ) to (A 3 , b 3 ) are the compensation parameters of the four corner blocks of the target block.
[0221] The video encoding apparatus uses the compensation parameters of the four corner sub-blocks to interpolate the compensation parameters of other sub-blocks. Linear interpolation can be performed or bilinear interpolation of the four corner sub-blocks can be used. For example, (A 0 , b0 ) and (A 2 , b 2 ) interpolates the sub-blocks in the first row of the target block. 0 , b 0 ) and (A 2 , b 2 ) interpolates the sub-blocks in the first column of the target block. In this way, compensation parameters of all sub-blocks are derived.
[0222] Specifically, the filter coefficients or weights used for interpolation can be set according to the difference between the position of the corner sub-block and the position of the target sub-block (or the distance between the corner sub-block and the target sub-block). The difference at a smaller position is given a larger weight.
[0223] Alternatively, the filter coefficient or weight for interpolation may be set according to the difference between the motion vector used to derive the compensation parameters of the corner sub-block (the control point motion vectors of the upper left, upper right, lower left and lower right corners of the target block, or the affine motion vectors of the upper left, upper right, lower left and lower right 4×4 sub-blocks of the target block) and the affine motion vector of the target sub-block. A smaller motion vector difference is given a larger weight.
[0224] 2.2 When the target block is divided into two regions
[0225] Even when the target block is divided into two regions, the illumination compensation parameter of each region can be derived in the same manner as when the target block is divided into four regions. Fig.16 , the video encoding device selects a pre-constructed sample T adjacent to the top side of the top area 0 To T w-1 and the pre-constructed sample L adjacent to the left side of the top region 0 To L H / 2-1 As reference samples in the current image for deriving compensation parameters for the top region. Then, the video encoding device is configured to determine a reference region in the reference image using a representative motion vector of the top region, and select pre-constructed samples adjacent to the top and left sides of the reference region as reference samples.
[0226] The representative motion vector of the top region may be the control point motion vector of the upper left corner of the target block. Alternatively, the representative motion vector of the top region may be a motion vector derived from the control point motion vector of the target block. For example, the affine motion vector of the upper left 4×4 sub-block in the top region may be used, or the affine motion vector corresponding to the center point of the top region may be used. As another example, the average value of the affine motion vectors of the sub-blocks in each region may be used as the representative motion vector of the corresponding region.
[0227] The video encoding apparatus is configured to select a pre-constructed sample T adjacent to the top side of the target block. 0 To T w-1 and the pre-constructed sample L adjacent to the left side of the bottom region H / 2 To L H-1 As reference samples in the current image for deriving compensation parameters for the bottom area. Then, the video encoding device is configured to determine a reference area in the reference image using a representative motion vector of the bottom area, and select pre-constructed samples adjacent to the top and left sides of the reference area as reference samples.
[0228] The representative motion vector of the bottom area may be the control point motion vector of the lower left corner of the target block. Alternatively, the representative motion vector of the bottom area may be a motion vector derived from the control point motion vector of the target block. For example, the affine motion vector of the lower left 4×4 sub-block in the bottom area may be used, or the affine motion vector corresponding to the center point of the bottom area may be used. As another example, the average value of the affine motion vectors of the sub-blocks in the bottom area may be used as the representative motion vector of the bottom area.
[0229] In the above example, as a method for determining a reference sample in a reference image for deriving compensation parameters, a representative motion vector of each region is used. However, an affine motion vector of a sub-block in each region may be used instead of a representative motion vector of each region. That is, for each region, a 4×4 reference block at a position indicated by an affine motion vector of a 4×4 sub-block may be determined in the reference image, and pre-constructed pixels adjacent to the top and left sides of the 4×4 reference block may be selected as reference pixels.
[0230] For each region, the video encoding device is configured to place the reference sample selected in the reference image and the reference sample selected in the current image into x and y in Equation 15, respectively, to derive compensation parameters for each region. In addition, the video encoding device performs illumination compensation on the prediction samples (prediction samples generated by affine motion prediction) in the corresponding region using the illumination compensation parameters of each region. Each sub-block can be compensated using the illumination compensation parameters of the region to which the sub-block belongs.
[0231] Alternatively, the video encoding device may be configured to interpolate illumination compensation parameters respectively corresponding to subblocks by using illumination compensation parameters of respective regions, and perform illumination compensation on each subblock using the interpolated parameters, as in the case of dividing the target block into four regions.
[0232] Interpolation can be applied when the representative motion vector of each region used to derive the compensation parameters is related to a specific position in each region. For example, the control point motion vectors of the upper left and lower left corners of the target block, or the affine motion vectors of the upper left and lower left 4×4 sub-blocks of the target block can be used as representative motion vectors. Specifically, the compensation parameters of these two regions are regarded as the illumination compensation parameters of the upper left sub-block TL and the lower left sub-block BL in the target block, as Fig.17 shown.
[0233] The video encoding device may be configured to adjust the compensation parameter (A) of the top area by 0 , b 0 ) and the compensation parameter of the bottom area (A 2 , b 2 ) applies weights to interpolate compensation parameters of the target sub-block. Specifically, weights can be assigned according to the distances between the upper left sub-block and the lower left sub-block in the target block and the target sub-block. Alternatively, weights can be set according to the difference between the motion vectors used to derive compensation parameters for the two regions (the control point motion vectors of the upper left and lower left corners of the target block, or the affine motion vectors of the upper left and lower left 4×4 sub-blocks of the target block) and the affine motion vector of the target sub-block. As the difference between the motion vectors decreases, the weight increases.
[0234] Even when the target block is split vertically into two regions, the same method as when the target block is split horizontally into two regions can be used. Specifically, the representative motion vectors of the two regions (left region and right region) can be, for example, the control point motion vectors of the upper left and upper right corners of the target block, or the affine motion vectors of the upper left and upper right 4×4 sub-blocks of the target block. Alternatively, the affine motion vector of the center point of each region or the average value of the affine motion vectors of the sub-blocks of each region can be used as the representative motion vector of each region. Other operations are the same as the case of horizontal segmentation described above, or can be clearly derived therefrom, so further detailed description thereof is omitted.
[0235] 2.3 When the target block is divided into more than 4 sub-blocks
[0236] As mentioned above, the target block can be split into two in the horizontal direction m The block is divided into two in the vertical direction n Block (where m and n are integers greater than or equal to 2). For example, the target block may be divided into sub-blocks, which are units for performing affine motion prediction. Fig.18 This situation is shown in . Fig.18 The video encoding apparatus derives illumination compensation parameters of the upper left region TL, the upper right region TR, the lower left region BL, and the lower right region BR of the target block using the method described in Section 2.1.
[0237] For other regions other than these four regions, the illumination compensation parameters of other regions can be derived by applying the interpolation described in Section 2.1. Alternatively, for other regions, the illumination compensation parameters can be derived in the same manner as in the case of the upper left region TL, the upper right region TR, the lower left region BL, and the lower right region BR. For example, for region A, the video encoding device selects a pre-constructed sample located at the top side of region A and adjacent to the target block and a pre-constructed sample located at the left side of region A and adjacent to the target block as reference pixels in the current image. In addition, the reference sample in the reference image is selected using the motion vector of the upper left corner control point of region A, the affine motion vector of the 4×4 sub-block located at the upper left corner of region A, or the affine motion vector of the center point of region A. The illumination compensation parameters of region A are derived using the selected reference samples.
[0238] The illumination compensation technique described above is a technique that utilizes motion vectors that can be obtained by pre-constructed samples and affine motion prediction. Accordingly, the video decoding device can be configured to perform illumination compensation in the same manner as the video encoding device. The video encoding device is not required to signal the video decoding device with additional information for illumination compensation processing.
[0239] In addition to affine motion prediction, the illumination compensation technique described above can be used together with other coding tools for compensating the motion of the target block in units of sub-blocks. For example, the illumination compensation technique can be applied to bidirectional optical flow. The video encoding device and the video decoding device can be configured to generate prediction samples for each sub-block by performing bidirectional optical flow on a sub-block-by-sub-block basis for the target block, and can be additionally configured to perform the above illumination compensation on the prediction samples in the target block. The illumination compensation technique applied to the bidirectional optical flow is the same as the above illumination compensation technique except for the following points.
[0240] In the illumination compensation technique described above, the control point motion vector of the target block or the affine motion vector of the sub-block is used to segment the target block and calculate the representative motion vector of each region segmented from the target block. However, in the case of bidirectional optical flow, there is neither a control point motion vector nor an affine motion vector. Accordingly, when the illumination compensation technique is applied to the bidirectional optical flow, the optical flow (v x , v y ) is used to replace the control point motion vector or affine motion vector of the sub-block.
[0241] V. Signaling Syntax
[0242] Another aspect of the present invention relates to a technique for signaling a high-level syntax for controlling the on / off of the various tools described above. The above-mentioned affine motion prediction, sample-by-sample adjustment for affine motion prediction samples, adaptive motion vector resolution, and illumination compensation are coding tools for improving video coding efficiency. However, for specific content such as the following, such as screen content, the aforementioned various coding tools may not help to improve compression performance. Accordingly, coding units based on signaling whether to apply each coding tool or coding units based on determining whether to apply each coding tool may reduce coding efficiency or increase computational complexity. The present invention provides a signaling technique for effectively controlling the above-mentioned coding tools.
[0243] In order to encode an image sequence, the video encoding device is configured to encode a first high-level syntax element at a sequence level indicating whether to prohibit multiple encoding tools. The first high-level syntax element can be encoded in a sequence header, that is, in an SPS. Specifically, the multiple encoding tools include affine motion prediction, and also include at least one of sample-by-sample adjustment for affine motion prediction samples, adaptive motion vector resolution, and illumination compensation.
[0244] When the first high-level syntax element indicates that all of the multiple coding tools are prohibited, the coding tools are not applied to the encoding of the sequence. In other words, the above-mentioned coding tools are not applied to any image in the sequence. When the first high-level syntax element indicates that the multiple coding tools are not prohibited, the multiple coding tools can be used to encode the corresponding sequence. For example, affine motion prediction can be applied to all images in the sequence. Accordingly, the video encoding device can encode a coding unit flag indicating whether encoding using affine motion prediction has been applied to each coding unit, and notify the video decoding device of it with a signal.
[0245] When the coding unit flag indicates that affine motion prediction has been applied to the corresponding coding unit, the video decoding device may be configured to perform the above-mentioned affine motion prediction on the coding unit. When the first high-level syntax element indicates that the plurality of coding tools are not prohibited, the video encoding device may be configured to encode one or more second high-level syntax elements, wherein the second high-level syntax element indicates whether each of at least a portion of the plurality of coding tools is allowed at the sequence level or the picture level.
[0246] In some embodiments for encoding one or more second high-level syntax elements, the video encoding device encodes a sequence level flag for each coding tool, the sequence level flag indicating whether the corresponding coding tool is allowed in the SPS. When the sequence level flag indicates that the corresponding coding tool is not allowed, the corresponding coding tool is not used to encode the picture belonging to the sequence. In addition, the video encoding device is configured to encode a picture level flag according to the value of the sequence level flag, the picture level flag indicating whether the corresponding coding tool is allowed in the picture header (i.e., PPS) of each picture belonging to the sequence.
[0247] For example, when the sequence level flag indicates that the corresponding coding tool is allowed at the sequence level, a picture level flag indicating whether the corresponding coding tool is allowed at the picture level is encoded. When the first high-level syntax element indicates that all of the plurality of coding tools are prohibited or the sequence level flag indicates that the corresponding coding tool is not allowed at the sequence level, the picture level flag is not separately encoded. Specifically, the video decoding apparatus is configured to automatically set the picture level flag to a value indicating that the corresponding coding tool is not allowed.
[0248] The picture level flags for coding tools other than affine motion prediction may be signaled according to the picture level flag for affine motion prediction. When the picture level flag for affine motion prediction indicates that affine motion prediction is not allowed at the picture level, the picture level flags for other coding tools are not encoded, and the other coding tools are not allowed at the picture level. When the picture level flags for the other coding tools are not included in the bitstream, the video decoding apparatus is configured to set each picture level flag to a value indicating that the corresponding coding tool is not allowed at the picture level.
[0249] The video decoding device may be configured to set whether the corresponding encoding tool is allowed at a picture level according to a picture level flag signaled from the video encoding device or a picture level flag of an automatically set value. The second high-level syntax element for affine motion prediction may be omitted. Specifically, whether affine motion prediction is allowed at a sequence level is controlled by a first high-level syntax. The video decoding device is configured to decode the first high-level syntax from the video encoding device and then determine whether affine motion prediction is allowed at a sequence level.
[0250] According to the above-mentioned syntax structure, the video encoding device can be configured to adaptively determine whether the coding tool is allowed at the sequence level and the picture level. In addition, the video decoding device can be configured to adaptively determine whether the coding tool is allowed at the sequence level and the picture level by decoding the syntax signaled from the video encoding device.
[0251] In some other embodiments for encoding one or more second high-level syntax elements, the image level flag of the above-mentioned embodiments may be replaced by a slice level flag. In other words, when the sequence level flag indicates that the corresponding coding tool is allowed at the sequence level, the video encoding device encodes the slice level flag indicating whether the corresponding coding tool is allowed at the slice level in the slice header. When the sequence level flag indicates that the corresponding coding tool is not allowed, the slice level flag is not encoded. The video encoding device may be configured to adaptively determine whether the coding tool is allowed at the sequence level and the slice level. The video decoding device may be configured to determine whether each tool is allowed at the slice level through the slice level flag.
[0252] In some other embodiments for encoding one or more second high-level syntax elements, the sequence level flag may be omitted. A picture level flag or a slice level flag is signaled according to the first high-level syntax element. When the first high-level syntax element indicates that multiple coding tools are allowed, the picture level flag or the slice level flag is encoded in the picture header or the slice header.
[0253] It should be understood that the exemplary embodiments described above can be implemented in many different ways. The functions described in one or more examples can be implemented in hardware, software, firmware or any combination thereof. It should be understood that the functional components described herein have been labeled as "units" to further emphasize their implementation independence.
[0254] The various functions or methods described in the present invention can be implemented with instructions stored in a non-volatile recording medium, which can be read and executed by one or more processors. Non-volatile recording media include, for example, all types of recording devices in which data is stored in a form readable by a computer system. For example, non-volatile recording media include storage media such as erasable programmable read-only memory (EPROM), flash drives, optical drives, magnetic hard drives, and solid-state drives (SSD).
[0255] Although exemplary embodiments have been described for illustrative purposes, those skilled in the art will appreciate that various modifications and variations are possible without departing from the spirit and scope of the embodiments. For the sake of brevity and clarity, exemplary embodiments have been described. Accordingly, those of ordinary skill will appreciate that the scope of the embodiments is not limited to the embodiments explicitly described above, but is included in the claims and their equivalents.
Claims
1. A video decoding device, which is used to decode a coded image sequence block by block, the video decoding device include: The decoder is configured as follows: Setting whether affine motion prediction is allowed at a sequence level by decoding a first high-level syntax element from a bitstream; setting whether each of the at least one coding tool is allowed at a picture level according to the first high-level syntax element by decoding one or more second high-level syntax elements for each of the at least one coding tool from the bitstream, wherein the at least one coding tool comprises sample-by-sample adjustment of affine motion prediction samples; as well as a predictor configured to, when a setting at a sequence level indicates that affine motion prediction is allowed, determine a plurality of control point motion vectors of a target block encoded using affine motion prediction, and generate affine prediction samples for each subblock in the target block by performing affine motion prediction in units of subblocks using the control point motion vectors, wherein the subblock has a size of 4×4, Wherein, when it is identified based on the setting at the image level that sample-by-sample adjustment of affine motion prediction samples is allowed for the current image including the target block, the predictor is configured to modify the sample values of the affine prediction samples by compensating the motion according to the sample position in each sub-block based on the control point motion vector of the target block.
2. The video decoding device according to claim 1, in, The first high-level syntax element is decoded from a sequence header.
3. The video decoding device according to claim 2, in, The decoder decodes one or more second high-level syntax elements for sample-by-sample adjustment of affine motion prediction samples by: When the first high-level syntax element indicates that affine motion prediction is allowed, decoding from the sequence header a sequence level flag indicating whether sample-by-sample adjustment of affine motion prediction samples is allowed; as well as According to the sequence level flag, a picture level flag indicating whether sample-by-sample adjustment of affine motion prediction samples is allowed is decoded from a picture header of each picture belonging to the sequence.
4. The video decoding device according to claim 3, in, When the first high-level syntax element indicates that affine motion prediction is not allowed or the sequence level flag indicates that sample-by-sample adjustment is not allowed, the decoder is configured to set the picture level flag to a value indicating that sample-by-sample adjustment is not allowed without decoding from the picture header.
5. The video decoding device according to claim 1, in, When the first high-level syntax element indicates that affine motion prediction is not allowed, any affine motion prediction and at least one coding tool are not allowed for all pictures in the sequence.
6. The video decoding device according to claim 1, in, The predictor is configured to modify the sample value of the affine prediction sample by: Using the control point motion vector of the target block, generating a motion offset resulting from a difference between a sample position in the target sub-block to be modified and a center of the target sub-block; generating horizontal gradients and vertical gradients relative to sample positions in a target sub-block; Generate a sample offset for an affine predicted sample corresponding to a sample position in a target sub-block using the horizontal gradient and the vertical gradient and the motion offset; as well as Add the sample offset and the sample value of the affine predicted sample corresponding to the sample position.
7. The video decoding device according to claim 6, in, The motion offset generated for a sample position in a target sub-block is reused as a motion offset for the same sample position in another sub-block of the target block.
8. A video encoding device for encoding a coded image sequence block by block, the video encoding device include: The encoder is configured as: encoding a first high-level syntax element at a sequence level in a sequence header to indicate whether both affine motion prediction and at least one coding tool are disabled, wherein the at least one coding tool comprises sample-by-sample adjustment of affine motion prediction samples, and encoding one or more second high-level syntax elements according to the first high-level syntax element, the second high-level syntax element indicating a sequence level or picture level setting regarding whether each of the at least one coding tool is allowed; a predictor configured to: when the first high-level syntax element indicates that both affine motion prediction and at least one encoding tool are prohibited, determine a plurality of control point motion vectors for a target block to be encoded, and generate affine prediction samples for each sub-block by performing sub-block-by-sub-block affine motion prediction using the control point motion vectors, wherein the sub-block has a size of 4×4; as well as Wherein, when sample-by-sample adjustment of affine motion prediction samples is allowed for a current image containing a target block, the predictor is configured to modify sample values of the affine prediction samples according to sample position compensation motion in each sub-block based on a control point motion vector of the target block.
9. The video encoding device according to claim 8, in, The encoder is configured to encode at least one second high-level syntax element for sample-by-sample adjustment of affine motion prediction samples by: When the first high-level syntax element indicates that affine motion prediction is allowed, encoding a sequence level flag indicating whether sample-by-sample adjustment of affine motion prediction samples is allowed in a sequence header; as well as According to the sequence level flag, a picture level flag indicating whether sample-by-sample adjustment is allowed in a picture header of each picture belonging to the sequence is encoded.
10. The video encoding device according to claim 8, in, The predictor is configured to modify the sample values of the affine predicted samples by: Using the control point motion vector of the target block, generating a motion offset resulting from a difference between a sample position in the target sub-block to be modified and a center of the target sub-block; generating horizontal gradients and vertical gradients relative to sample positions in a target sub-block; Generate a sample offset for an affine predicted sample corresponding to a sample position in a target sub-block using the horizontal gradient and the vertical gradient and the motion offset; Add the sample offset and the sample value of the affine predicted sample corresponding to the sample position.
11. The video encoding device according to claim 10, in, The motion offset generated for a sample position in a target sub-block is reused as a motion offset for the same sample position in another sub-block of the target block.
12. An apparatus for providing video data, the apparatus comprising at least one processor, the at least one processor being configured to: generating a bitstream by encoding the video data into the bitstream; and Send the bitstream to the video decoding device, in, The at least one processor is configured to generate a bitstream by: encoding a first high-level syntax element at a sequence level in a sequence header to indicate whether both affine motion prediction and at least one coding tool are disabled, wherein the at least one coding tool comprises sample-by-sample adjustment of affine motion prediction samples; encoding one or more second high-level syntax elements according to the first high-level syntax element, the second high-level syntax element indicating a sequence level or picture level setting regarding whether each of the at least one coding tool is allowed; When the first high-level syntax element indicates that both affine motion prediction and at least one encoding tool are prohibited, determining a plurality of control point motion vectors for a target block to be encoded by affine motion prediction, and generating affine prediction samples for each sub-block by performing sub-block-by-sub-block affine motion prediction using the control point motion vectors, wherein the sub-block has a size of 4×4; as well as When sample-by-sample adjustment of affine motion prediction samples is enabled for a current image containing a target block, sample values of the affine prediction samples are modified by compensating motion according to sample positions in each sub-block based on control point motion vectors of the target block.
Citation Information
Patent Citations
Micro LED display device
KR1020190070633A
Method for Providing Asynchronous Reverse Direction Payment by using Sound Signal Device and Blockchain
KR1020190082010A
