CN118921468A - Method of decoding and encoding video and apparatus for transmitting compressed video data - Google Patents
Method of decoding and encoding video and apparatus for transmitting compressed video data Download PDFInfo
- Publication number
- CN118921468A CN118921468A CN202411263905.8A CN202411263905A CN118921468A CN 118921468 A CN118921468 A CN 118921468A CN 202411263905 A CN202411263905 A CN 202411263905A CN 118921468 A CN118921468 A CN 118921468A
- Authority
- CN
- China
- Prior art keywords
- block
- merge candidate
- merge
- current block
- motion vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 112
- 230000033001 locomotion Effects 0.000 claims abstract description 460
- 239000013598 vector Substances 0.000 claims abstract description 426
- 238000013519 translation Methods 0.000 claims description 10
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 229
- 238000005192 partition Methods 0.000 description 131
- 238000000638 solvent extraction Methods 0.000 description 96
- 230000002123 temporal effect Effects 0.000 description 66
- 239000000523 sample Substances 0.000 description 51
- 238000010586 diagram Methods 0.000 description 48
- 230000008569 process Effects 0.000 description 18
- 238000013139 quantization Methods 0.000 description 17
- 230000008707 rearrangement Effects 0.000 description 17
- 230000002457 bidirectional effect Effects 0.000 description 12
- 238000001914 filtration Methods 0.000 description 12
- 238000012545 processing Methods 0.000 description 11
- 230000015654 memory Effects 0.000 description 10
- 230000003044 adaptive effect Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 8
- 238000012937 correction Methods 0.000 description 7
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 6
- 230000009466 transformation Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 239000013074 reference sample Substances 0.000 description 4
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 238000006073 displacement reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000014509 gene expression Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000009795 derivation Methods 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 108091026890 Coding region Proteins 0.000 description 1
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000011449 brick Substances 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/136—Incoming video signal characteristics or properties
- H04N19/137—Motion inside a coding unit, e.g. average field, frame or block difference
- H04N19/139—Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
- H04N19/517—Processing of motion vectors by encoding
- H04N19/52—Processing of motion vectors by encoding by predictive encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/96—Tree coding, e.g. quad-tree coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本申请是申请日为2019年5月23日、国际申请号为PCT/KR2019/006221、并于2020年11月24日进入中国国家阶段的发明名称为“用于处理视频信号的方法和设备”的第201980035029.4号发明专利申请的分案申请。This application is a divisional application of invention patent application No. 201980035029.4, whose application date is May 23, 2019, international application number is PCT/KR2019/006221, and which entered the Chinese national phase on November 24, 2020, and whose invention name is “Method and device for processing video signals”.
技术领域Technical Field
本发明涉及用于处理视频信号的方法和设备。The invention relates to a method and an apparatus for processing a video signal.
背景技术Background Art
近来,在各种应用领域中对高分辨率和高品质图像例如高清晰度(HD)图像和超高清晰度(UHD)图像的需求已经增加。然而,与常规图像数据相比,较高的分辨率和品质的图像数据具有增加的数据量。因此,当通过使用介质例如常规的有线和无线宽带网络传送图像数据时,或者当通过使用常规的存储介质存储图像数据时,传送和存储的成本增加。为了解决随着图像数据的分辨率和品质的提高而出现的这些问题,可以利用高效的图像编码/解码技术。Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, has increased in various application fields. However, compared with conventional image data, higher resolution and quality image data has an increased data volume. Therefore, when the image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when the image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding/decoding technology can be used.
图像压缩技术包括各种技术,包括:根据当前图片的先前图片或后续图片来预测包括在当前图片中的像素值的帧间预测技术;通过使用当前图片中的像素信息预测包括在当前图片中的像素值的帧内预测技术;将短码分配给具有高出现频率的值并且将长码分配给具有低出现频率的值的熵编码技术等。图像数据可以通过使用这样的图像压缩技术有效地压缩,并且可以传送或存储。The image compression technology includes various technologies, including: an inter-frame prediction technology that predicts a pixel value included in a current picture based on a previous picture or a subsequent picture of the current picture; an intra-frame prediction technology that predicts a pixel value included in the current picture by using pixel information in the current picture; an entropy coding technology that assigns a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence, etc. Image data can be effectively compressed by using such an image compression technology and can be transmitted or stored.
同时,随着对高分辨率图像的需求,也增加了对作为新的图像服务的立体图像内容的需求。用于有效地提供具有高分辨率和超高分辨率的立体图像内容的视频压缩技术正被研讨。Meanwhile, along with the demand for high-resolution images, the demand for stereoscopic image content as a new image service is also increasing. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being studied.
发明内容Summary of the invention
技术问题Technical issues
本发明提供了一种用于在对视频信号进行编码/解码时对编码/解码目标块有效地执行帧间预测的方法和设备。The present invention provides a method and apparatus for efficiently performing inter-frame prediction on an encoding/decoding target block when encoding/decoding a video signal.
本发明提供了一种用于在对视频信号进行编码/解码时通过使用多个合并候选列表来执行运动补偿的方法和设备。The present invention provides a method and apparatus for performing motion compensation by using a plurality of merge candidate lists when encoding/decoding a video signal.
本发明提供了一种用于在对视频信号进行解码/解码时基于仿射模型来执行运动补偿的方法和设备。The present invention provides a method and apparatus for performing motion compensation based on an affine model when decoding/decoding a video signal.
本发明提供了一种用于在对视频信号进行解码/解码时从当前块的相邻块或非相邻块来导出角运动向量的方法和设备。The present invention provides a method and apparatus for deriving an angular motion vector from neighboring blocks or non-neighboring blocks of a current block when decoding/decoding a video signal.
能够从本发明获得的技术问题不限于以上提及的技术任务,并且本发明所属的技术领域的普通技术人员根据以下描述可以清楚地理解其他未提及的技术任务。Technical problems that can be obtained from the present invention are not limited to the above-mentioned technical tasks, and a person of ordinary skill in the technical field to which the present invention belongs can clearly understand other unmentioned technical tasks according to the following description.
技术方案Technical Solution
根据本发明的视频信号解码方法和设备可以根据候选块导出合并候选,生成包括合并候选的第一合并候选列表,指定包括在第一合并候选列表中的多个合并候选之一,基于指定的合并候选的运动信息来导出当前块的仿射向量,基于仿射向量来导出当前块中的子块的运动向量,以及基于运动向量来执行对子块的运动补偿。According to the video signal decoding method and device of the present invention, a merge candidate can be derived based on a candidate block, a first merge candidate list including the merge candidate can be generated, one of multiple merge candidates included in the first merge candidate list can be specified, an affine vector of a current block can be derived based on motion information of the specified merge candidate, a motion vector of a sub-block in the current block can be derived based on the affine vector, and motion compensation of the sub-block can be performed based on the motion vector.
根据本发明的视频信号编码方法和设备可以根据候选块导出合并候选,生成包括合并候选的第一合并候选列表,指定包括在第一合并候选列表中的多个合并候选之一,基于指定的合并候选的运动信息来导出当前块的仿射向量,基于仿射向量来导出当前块中的子块的运动向量,以及基于运动向量来执行对子块的运动补偿。According to the video signal encoding method and device of the present invention, a merge candidate can be derived based on a candidate block, a first merge candidate list including the merge candidate can be generated, one of multiple merge candidates included in the first merge candidate list can be specified, an affine vector of a current block can be derived based on motion information of the specified merge candidate, a motion vector of a sub-block in the current block can be derived based on the affine vector, and motion compensation of the sub-block can be performed based on the motion vector.
对于根据本发明的视频信号编码/解码方法和设备,当通过仿射帧间预测对候选块进行编码时,可以基于候选块的仿射向量来导出合并候选的仿射向量。With the video signal encoding/decoding method and apparatus according to the present invention, when the candidate block is encoded by affine inter prediction, the affine vector of the merge candidate may be derived based on the affine vector of the candidate block.
对于根据本发明的视频信号编码/解码方法和设备,基于当前块和候选块是否包括在相同的CTU(编码树单元)中,候选块的仿射向量的位置可以不同。For the video signal encoding/decoding method and apparatus according to the present invention, the position of the affine vector of the candidate block may be different based on whether the current block and the candidate block are included in the same CTU (Coding Tree Unit).
对于根据本发明的视频信号编码/解码方法和设备,可以通过组合多个候选块的平移运动向量来导出合并候选的仿射向量。For the video signal encoding/decoding method and apparatus according to the present invention, an affine vector of a merge candidate can be derived by combining translation motion vectors of a plurality of candidate blocks.
对于根据本发明的视频信号编码/解码方法和设备,当包括在第一合并候选列表中的合并候选的数目小于最大数目时,可以将包括在第二合并候选列表中的合并候选添加至第一合并候选列表。With the video signal encoding/decoding method and apparatus according to the present invention, when the number of merge candidates included in the first merge candidate list is less than the maximum number, the merge candidates included in the second merge candidate list may be added to the first merge candidate list.
对于根据本发明的视频信号编码/解码方法和设备,可以基于当前块的大小或形状中的至少一个来确定当前块的仿射参数的数目。With the video signal encoding/decoding method and apparatus according to the present invention, the number of affine parameters of the current block may be determined based on at least one of the size or shape of the current block.
对于根据本发明的视频信号编码/解码方法和设备,候选块可以包括当前块的相邻块和与相邻块在同一条线上的非相邻块中的至少一个。For the video signal encoding/decoding method and apparatus according to the present invention, the candidate blocks may include at least one of a neighboring block of the current block and a non-neighboring block on the same line as the neighboring block.
本发明还提供了一种对视频进行解码的方法,所述方法包括:从与当前块相邻的相邻块导出合并候选;生成包括所述合并候选的合并候选列表;指定包括在所述合并候选列表中的多个合并候选中的一个合并候选;基于所指定的合并候选导出所述当前块的角运动向量;基于所述当前块的所述角运动向量导出所述当前块中的子块的运动向量,所述当前块被划分成多个具有4×4的预定义大小的子块;以及基于所述运动向量执行所述子块的运动补偿,其中,当所述相邻块不与所述当前块包括在相同的编码树单元CTU中时,基于在所述相邻块的左下角和右下角处的运动向量导出所述合并候选的角运动向量。The present invention also provides a method for decoding a video, the method comprising: deriving a merge candidate from a neighboring block adjacent to a current block; generating a merge candidate list including the merge candidate; specifying one merge candidate from multiple merge candidates included in the merge candidate list; deriving an angular motion vector of the current block based on the specified merge candidate; deriving a motion vector of a sub-block in the current block based on the angular motion vector of the current block, the current block being divided into multiple sub-blocks with a predefined size of 4×4; and performing motion compensation of the sub-block based on the motion vector, wherein, when the neighboring block is not included in the same coding tree unit CTU as the current block, the angular motion vector of the merge candidate is derived based on the motion vectors at the lower left and lower right corners of the neighboring block.
本发明还提供了对视频进行编码的方法,所述方法包括:从与当前块相邻的相邻块导出合并候选;生成包括所述合并候选的合并候选列表;指定包括在所述合并候选列表中的多个合并候选中的一个合并候选;基于所指定的合并候选导出所述当前块的角运动向量;基于所述当前块的所述角运动向量导出所述当前块中的子块的运动向量,所述当前块被划分成多个具有4×4的预定义大小的子块;以及基于所述运动向量执行所述子块的运动补偿,其中,当所述相邻块不与所述当前块包括在相同的编码树单元CTU中时,基于在所述相邻块的左下角和右下角处的运动向量导出所述合并候选的角运动向量。The present invention also provides a method for encoding a video, the method comprising: deriving a merge candidate from a neighboring block adjacent to a current block; generating a merge candidate list including the merge candidate; specifying one merge candidate from multiple merge candidates included in the merge candidate list; deriving an angular motion vector of the current block based on the specified merge candidate; deriving a motion vector of a sub-block in the current block based on the angular motion vector of the current block, the current block being divided into multiple sub-blocks with a predefined size of 4×4; and performing motion compensation of the sub-block based on the motion vector, wherein, when the neighboring block is not included in the same coding tree unit CTU as the current block, the angular motion vector of the merge candidate is derived based on the motion vectors at the lower left and lower right corners of the neighboring block.
本发明还提供了一种用于发送压缩视频数据的装置,所述装置包括:处理器,被配置成获得所述压缩视频数据;以及发送单元,被配置成发送所述压缩视频数据,其中,获得所述压缩视频数据包括:从与当前块相邻的相邻块导出合并候选;生成包括所述合并候选的合并候选列表;指定包括在所述合并候选列表中的多个合并候选中的一个合并候选;基于所指定的合并候选导出所述当前块的角运动向量;基于所述当前块的所述角运动向量导出所述当前块中的子块的运动向量,所述当前块被划分成多个具有4×4的预定义大小的子块;以及基于所述运动向量执行所述子块的运动补偿,其中,当所述相邻块不与所述当前块包括在相同的编码树单元CTU中时,基于在所述相邻块的左下角和右下角处的运动向量导出所述合并候选的角运动向量。The present invention also provides a device for sending compressed video data, the device comprising: a processor configured to obtain the compressed video data; and a sending unit configured to send the compressed video data, wherein obtaining the compressed video data comprises: deriving a merge candidate from a neighboring block adjacent to a current block; generating a merge candidate list including the merge candidate; specifying one of multiple merge candidates included in the merge candidate list; deriving an angular motion vector of the current block based on the specified merge candidate; deriving a motion vector of a sub-block in the current block based on the angular motion vector of the current block, the current block being divided into multiple sub-blocks of a predefined size of 4×4; and performing motion compensation of the sub-block based on the motion vector, wherein, when the neighboring block is not included in the same coding tree unit CTU as the current block, the angular motion vector of the merge candidate is derived based on the motion vectors at the lower left and lower right corners of the neighboring block.
应当理解的是,上述总结的特征是本发明的以下详细描述的示例性方面,而不限制本发明的范围。It should be understood that the above-summarized features are exemplary aspects of the following detailed description of the invention and do not limit the scope of the invention.
有益效果Beneficial Effects
根据本发明,可以通过借助使用多个合并候选列表执行运动补偿来提高帧间预测的效率。According to the present invention, the efficiency of inter prediction can be improved by performing motion compensation by using a plurality of merge candidate lists.
根据本发明,可以通过基于多个合并候选获得运动信息来提高帧间预测的效率。According to the present invention, the efficiency of inter-frame prediction can be improved by obtaining motion information based on a plurality of merge candidates.
根据本发明,可以通过基于仿射模型执行运动补偿来提高帧间预测的效率。According to the present invention, the efficiency of inter-frame prediction can be improved by performing motion compensation based on an affine model.
根据本发明,可以通过从当前块的相邻块或非相邻块导出角运动向量来提高帧间预测的效率。According to the present invention, the efficiency of inter-frame prediction can be improved by deriving an angular motion vector from a neighboring block or a non-neighboring block of a current block.
能够从本发明获得的效果可以不受以上提及的效果的限制,并且本发明所属的技术领域的普通技术人员根据以下描述可以清楚地理解其他未提及的效果。Effects that can be obtained from the present invention may not be limited to the above-mentioned effects, and other unmentioned effects may be clearly understood by a person of ordinary skill in the technical field to which the present invention pertains from the following description.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是示出了根据本发明的实施方式的用于对视频进行编码的装置的框图。FIG. 1 is a block diagram showing an apparatus for encoding a video according to an embodiment of the present invention.
图2是示出了根据本发明的实施方式的用于对视频进行解码的装置的框图。FIG. 2 is a block diagram showing an apparatus for decoding a video according to an embodiment of the present invention.
图3是示出了当通过帧间预测对编码块进行编码时可以应用于编码块的划分模式候选的图。FIG. 3 is a diagram showing partition mode candidates that can be applied to a coding block when the coding block is encoded through inter prediction.
图4示出了作为应用了本发明的实施方式的基于树结构对编码块进行层次划分的示例。FIG. 4 shows an example of hierarchical division of coding blocks based on a tree structure as an embodiment to which the present invention is applied.
图5是示出了作为应用了本发明的实施方式的允许基于二叉树的划分的划分形状的图。FIG. 5 is a diagram showing a partition shape that allows binary tree-based partitioning as an embodiment to which the present invention is applied.
图6示出了三叉树划分形状。FIG6 shows a ternary tree partition shape.
图7是示出了仅允许特定形状的基于二叉树的划分的示例的图。FIG. 7 is a diagram showing an example of binary tree-based partitioning that allows only specific shapes.
图8是用于描述根据应用了本发明的实施方式的其中与允许二叉树划分的次数相关的信息被编码/解码的示例的图。FIG. 8 is a diagram for describing an example in which information related to the number of times binary tree division is allowed is encoded/decoded according to an embodiment to which the present invention is applied.
图9是示出了作为应用了本发明的实施方式的帧间预测方法的流程图。FIG. 9 is a flowchart showing an inter-frame prediction method as an embodiment to which the present invention is applied.
图10是示出了当合并模式被应用于当前块时导出当前块的运动信息的过程的图。FIG. 10 is a diagram illustrating a process of deriving motion information of a current block when a merge mode is applied to the current block.
图11是示出了空间相邻块的示例的图。FIG. 11 is a diagram showing an example of spatially adjacent blocks.
图12是示出了导出时间合并候选的运动向量的示例的图。FIG. 12 is a diagram showing an example of deriving a motion vector of a temporal merging candidate.
图13是示出了可以用作同位块的候选块的位置的图。FIG. 13 is a diagram showing positions of candidate blocks that can be used as co-located blocks.
图14是示出了当AMVP模式被应用于当前块时导出当前块的运动信息的处理的图。FIG. 14 is a diagram illustrating a process of deriving motion information of a current block when the AMVP mode is applied to the current block.
图15是示出了当第一合并候选块不可用时从第二合并候选块导出合并候选的示例的图。FIG. 15 is a diagram showing an example of deriving a merge candidate from a second merge candidate block when a first merge candidate block is unavailable.
图16是示出了根据与第一合并候选块位于同一条线上的第二合并候选块导出合并候选的示例的图。FIG. 16 is a diagram showing an example of deriving a merge candidate from a second merge candidate block located on the same line as a first merge candidate block.
图17至图20是示出了搜索合并候选块的顺序的图。17 to 20 are diagrams showing an order of searching for merge candidate blocks.
图21是示出了基于正方形块导出非正方形块的合并候选的示例的图。FIG. 21 is a diagram showing an example of deriving merging candidates of non-square blocks based on square blocks.
图22是示出了基于高级节点块导出合并候选的示例的图。FIG. 22 is a diagram showing an example of deriving merge candidates based on high-level node blocks.
图23是示出了基于合并估计区域来确定空间相邻块的可用性的示例的图。FIG. 23 is a diagram showing an example of determining the availability of spatially neighboring blocks based on a merged estimated region.
图24是示出了基于合并估计区域导出合并候选的示例的图。FIG. 24 is a diagram showing an example of deriving a merge candidate based on a merge estimation region.
图25是示出了运动模型的图。FIG. 25 is a diagram showing a motion model.
图26是示出了使用角运动向量的仿射运动模型的图。FIG. 26 is a diagram showing an affine motion model using angular motion vectors.
图27是示出了以子块为单位确定运动向量的示例的图。FIG. 27 is a diagram showing an example of determining a motion vector in units of sub-blocks.
图28是示出了根据当前块的形状确定角的位置的示例的图。FIG. 28 is a diagram showing an example of determining the position of a corner according to the shape of a current block.
图29是示出了在仿射帧间模式下的运动补偿处理的流程图。FIG. 29 is a flowchart showing the motion compensation process in the affine inter mode.
图30和图31是示出基于相邻块的运动向量来导出当前块的仿射向量的示例的图。30 and 31 are diagrams showing examples of deriving an affine vector of a current block based on motion vectors of neighboring blocks.
图32是示出了用于导出空间合并候选的候选块的图。FIG. 32 is a diagram showing candidate blocks for deriving spatial merging candidates.
图33示出了根据候选块的仿射向量导出当前块的仿射向量的示例。FIG. 33 shows an example of deriving an affine vector of a current block from affine vectors of candidate blocks.
具体实施方式DETAILED DESCRIPTION
可以对本发明进行各种修改,并且存在本发明的各种实施方式,现在将参照附图提供这些实施方式的示例,并且详细地描述这些实施方式的示例。然而,本发明不限于此,并且示例性实施方式可以被解释为包括本发明的技术构思和技术范围内的全部修改、等同物或替代方案。在描述的附图中,相似的附图标记指代相似的要素。Various modifications can be made to the present invention, and there are various embodiments of the present invention, examples of which will now be provided with reference to the accompanying drawings, and examples of which will be described in detail. However, the present invention is not limited thereto, and the exemplary embodiments may be interpreted as including all modifications, equivalents or alternatives within the technical concept and technical scope of the present invention. In the accompanying drawings described, similar reference numerals refer to similar elements.
说明书中使用的术语‘第一’、‘第二’等可以用于描述各种部件,但是这些部件不应当被解释为限于这些术语。这些术语仅用于将一个部件与其他部件区分。例如,在不偏离本发明的范围的情况下,‘第一’部件可以被称为‘第二’部件,并且‘第二’部件也可以被类似地称为‘第一’部件。术语‘和/或’包括多个项的组合或者多个项中的任何一个。The terms 'first', 'second', etc. used in the specification may be used to describe various components, but these components should not be interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a 'first' component may be referred to as a 'second' component, and a 'second' component may also be similarly referred to as a 'first' component. The term 'and/or' includes a combination of a plurality of items or any one of a plurality of items.
在本公开内容中,当元件被称为“连接”或“耦接”至另一元件时,应理解成不仅包括该元件直接连接或耦接至该另一元件,而且包括可以在它们之间存在另一元件。当元件被称为“直接连接”或“直接耦接”至另一元件时,应理解在它们之间不存在其他元件。In the present disclosure, when an element is referred to as being "connected" or "coupled" to another element, it should be understood that it includes not only that the element is directly connected or coupled to the other element, but also that another element may exist between them. When an element is referred to as being "directly connected" or "directly coupled" to another element, it should be understood that there are no other elements between them.
本说明书中使用的术语仅用于描述特定实施方式,而并不旨在限制本发明。以单数形式使用的表述包含复数形式的表述,除非该表述在上下文中具有明显不同的含义。在本说明书中,应当理解,诸如“包括”、“具有”等的术语旨在指示本说明书中公开的特征、数字、步骤、动作、元件、部分或其组合的存在,并且不旨在排除可以存在或可以添加一个或更多个其他特征、数字、步骤、动作、元件、部分或其组合的可能性。The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Expressions used in the singular include expressions in the plural form unless the expression has a significantly different meaning in the context. In this specification, it should be understood that terms such as "including", "having" etc. are intended to indicate the existence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added.
在下文中,将参照附图详细地描述本发明的优选实施方式。在下文中,附图中的相同组成元件由相同的附图标记表示,并且将省略对相同元件的重复描述。Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are denoted by the same reference numerals, and repeated description of the same elements will be omitted.
图1是示出了根据本发明的实施方式的用于对视频进行编码的装置的框图。FIG. 1 is a block diagram showing an apparatus for encoding a video according to an embodiment of the present invention.
参照图1,用于对视频进行编码的装置100可以包括:图片划分模块110、预测模块120和125、变换模块130、量化模块135、重排模块160、熵编码模块165、逆量化模块140、逆变换模块145、滤波器模块150和存储器155。1 , a device 100 for encoding a video may include a picture division module 110 , prediction modules 120 and 125 , a transform module 130 , a quantization module 135 , a rearrangement module 160 , an entropy encoding module 165 , an inverse quantization module 140 , an inverse transform module 145 , a filter module 150 , and a memory 155 .
图1中所示的组成部分被独立地示出,以表示用于对视频进行编码的装置中的彼此不同的特征功能。因此,这并不意味着每个组成部分都以单独的硬件或软件的组成单元组成。换言之,为了方便起见,每个组成部分包括列举的组成部分中的每个。因此,每个组成部分中的至少两个组成部分可以被组合以形成一个组成部分,或者一个组成部分可以被分成多个组成部分以执行每个功能。在不偏离本发明的实质内容的情况下,组合每个组成部分的实施方式和分割一个组成部分的实施方式也被包括在本发明的范围内。The components shown in FIG. 1 are shown independently to represent the characteristic functions that are different from each other in the device for encoding a video. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment of combining each component and the embodiment of segmenting a component are also included in the scope of the present invention.
此外,组成部分中的一些组成部分可以不是执行本发明的基本功能的不可缺少的组成部分,而是仅改善本发明的性能的选择性组成部分。可以通过排除用于改善性能的组成部分而仅包括用于实现本发明的实质内容的不可缺少的组成部分来实现本发明。排除仅用于改善性能的选择性组成部分而仅包括不可缺少的组成部分的结构也被包括在本发明的范围内。In addition, some of the components may not be indispensable components for performing the basic functions of the present invention, but selective components that only improve the performance of the present invention. The present invention can be implemented by excluding components for improving performance and only including indispensable components for implementing the essence of the present invention. Structures that exclude selective components that only improve performance and only include indispensable components are also included in the scope of the present invention.
图片划分模块110可以将输入图片划分为一个或更多个处理单元。在此,处理单元可以是预测单元(PU)、变换单元(TU)或编码单元(CU)。图片划分模块110可以将一个图片划分为多个编码单元、预测单元和变换单元的组合,并且可以通过使用预定标准(例如,成本函数)选择编码单元、预测单元和变换单元的一个组合来对图片进行编码。The picture partitioning module 110 may partition an input picture into one or more processing units. Here, a processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture partitioning module 110 may partition a picture into a combination of a plurality of coding units, prediction units, and transform units, and may encode a picture by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).
例如,可以将一个图片划分为多个编码单元。可以使用递归树结构例如四叉树结构来将图片划分为编码单元。以一个图片或最大编码单元为根而被划分为其他编码单元的编码单元可以被划分为具有与所划分的编码单元的数目相对应的子节点。按照预定限制不能再被划分的编码单元用作叶子节点。也就是说,当假设对于一个编码单元仅正方形划分可行时,可以将一个编码单元最多划分为四个其他编码单元。For example, a picture may be divided into a plurality of coding units. A recursive tree structure such as a quadtree structure may be used to divide a picture into coding units. A coding unit divided into other coding units with a picture or a maximum coding unit as a root may be divided into child nodes corresponding to the number of divided coding units. Coding units that cannot be further divided according to predetermined restrictions are used as leaf nodes. That is, when it is assumed that only square division is feasible for a coding unit, a coding unit may be divided into up to four other coding units.
在下文中,在本发明的实施方式中,编码单元可以意指执行编码的单元或者执行解码的单元。Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.
预测单元可以是在单个编码单元中被划分为具有相同大小的正方形形状或矩形形状的划分之一,或者预测单元可以是在单个编码单元中被划分成使得具有不同的形状/大小的划分之一。The prediction unit may be one of partitions split into a square shape or a rectangular shape having the same size in a single coding unit, or the prediction unit may be one of partitions split so as to have different shapes/sizes in a single coding unit.
当基于编码单元生成经受帧内预测的预测单元并且编码单元不是最小编码单元时,可以在不将编码单元划分为多个预测单元NxN的情况下执行帧内预测。When a prediction unit subject to intra prediction is generated based on a coding unit and the coding unit is not a minimum coding unit, intra prediction may be performed without splitting the coding unit into a plurality of prediction units NxN.
预测模块120和125可以包括执行帧间预测的帧间预测模块120和执行帧内预测的帧内预测模块125。可以确定对于预测单元执行帧间预测还是帧内预测,并且可以确定根据每个预测方法的详细信息(例如,帧内预测模式、运动向量、参考图片等)。在此,经受预测的处理单元可以与针对其确定了预测方法和详细内容的处理单元不同。例如,可以由预测单元确定预测方法、预测模式等,并且可以由变换单元执行预测。所生成的预测块与原始块之间的残差值(残差块)可以被输入至变换模块130。此外,用于预测的预测模式信息、运动向量信息等可以与残差值一起由熵编码模块165进行编码,并且可以被传送至用于对视频进行解码的装置。当使用特定编码模式时,可以通过按原样对原始块进行编码而不通过预测模块120和125生成预测块而传送至用于对视频进行解码的装置。The prediction modules 120 and 125 may include an inter prediction module 120 that performs inter prediction and an intra prediction module 125 that performs intra prediction. It may be determined whether inter prediction or intra prediction is performed for a prediction unit, and detailed information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. Here, the processing unit subjected to prediction may be different from the processing unit for which the prediction method and detailed content are determined. For example, the prediction method, prediction mode, etc. may be determined by the prediction unit, and the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform module 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding module 165, and may be transmitted to a device for decoding a video. When a specific encoding mode is used, it may be transmitted to a device for decoding a video by encoding the original block as it is without generating a prediction block through the prediction modules 120 and 125.
帧间预测模块120可以基于当前图片的先前图片或后续图片中的至少一个的信息来预测预测单元,或者在一些情况下,可以基于当前图片中的一些编码区域的信息来预测预测单元。帧间预测模块120可以包括参考图片插值模块、运动预测模块和运动补偿模块。The inter-frame prediction module 120 may predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture, or in some cases, may predict a prediction unit based on information of some coding regions in the current picture. The inter-frame prediction module 120 may include a reference picture interpolation module, a motion prediction module, and a motion compensation module.
参考图片插值模块可以从存储器155接收参考图片信息,并且可以根据参考图片生成整像素或小于整像素的像素信息。在亮度像素的情况下,可以使用具有不同滤波器系数的基于DCT的8抽头插值滤波器以1/4像素为单位生成整像素或小于整像素的像素信息。在色度信号的情况下,可以使用具有不同滤波器系数的基于DCT的4抽头插值滤波器以1/8像素为单位生成整像素或小于整像素的像素信息。The reference picture interpolation module may receive reference picture information from the memory 155, and may generate pixel information of integer pixels or less than integer pixels according to the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1/4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1/8 pixels.
运动预测模块可以基于被参考图片插值模块插值的参考图片来执行运动预测。可以使用诸如基于全搜索的块匹配算法(FBMA)、三步搜索(TSS)、新三步搜索算法(NTS)等的各种方法作为用于计算运动向量的方法。基于插值像素,运动向量可以具有以1/2像素或1/4像素为单位的运动向量值。运动预测模块可以通过改变运动预测方法来预测当前预测单元。可以使用诸如跳过方法、合并方法、AMVP(高级运动向量预测)方法、帧内块复制方法等的各种方法作为运动预测方法。The motion prediction module can perform motion prediction based on the reference picture interpolated by the reference picture interpolation module. Various methods such as full search based block matching algorithm (FBMA), three-step search (TSS), new three-step search algorithm (NTS), etc. can be used as methods for calculating motion vectors. Based on the interpolated pixels, the motion vector can have a motion vector value in units of 1/2 pixel or 1/4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. Various methods such as skip method, merge method, AMVP (Advanced Motion Vector Prediction) method, intra-frame block copy method, etc. can be used as motion prediction methods.
帧内预测模块125可以基于与当前块相邻的参考像素信息来生成预测单元,该参考像素信息是当前图片中的像素信息。在当前预测单元的相邻块是经受帧间预测的块并且因此参考像素是经受帧间预测的像素时,可以使用经受帧内预测的相邻块的参考像素信息来替换在经受帧间预测的块中包括的参考像素。也就是说,当参考像素不可用时,可以使用可用的参考像素中的至少一个参考像素代替不可用的参考像素信息。The intra prediction module 125 may generate a prediction unit based on reference pixel information adjacent to the current block, which is pixel information in the current picture. When the adjacent block of the current prediction unit is a block subject to inter-frame prediction and thus the reference pixel is a pixel subject to inter-frame prediction, the reference pixel information of the adjacent block subject to intra-frame prediction may be used to replace the reference pixel included in the block subject to inter-frame prediction. That is, when the reference pixel is unavailable, at least one reference pixel among the available reference pixels may be used to replace the unavailable reference pixel information.
帧内预测的预测模式可以包括根据预测方向的使用参考像素信息的方向预测模式和在执行预测时不使用方向信息的无方向预测模式。用于预测亮度信息的模式可以与用于预测色度信息的模式不同,并且为了预测色度信息,可以利用用于预测亮度信息的帧内预测模式信息或者预测的亮度信号信息。The prediction mode of the intra prediction may include a directional prediction mode using reference pixel information according to a prediction direction and a non-directional prediction mode that does not use directional information when performing prediction. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and in order to predict chrominance information, the intra prediction mode information for predicting luminance information or the predicted luminance signal information may be used.
在执行帧内预测时,当预测单元的大小与变换单元的大小相同时,可以基于位于该预测单元的左侧、左上侧和上侧的像素对预测单元执行帧内预测。然而,在执行帧内预测时,当预测单元的大小与变换单元的大小不同时,可以使用基于变换单元的参考像素来执行帧内预测。此外,使用NxN划分的帧内预测可以仅用于最小编码单元。When performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and upper sides of the prediction unit. However, when performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using NxN partitioning can be used only for the minimum coding unit.
在帧内预测方法中,根据预测模式,可以在将AIS(自适应帧内平滑)滤波器应用于参考像素之后生成预测块。应用于参考像素的AIS滤波器的类型可以不同。为了执行帧内预测方法,可以根据与当前预测单元相邻的预测单元的帧内预测模式来预测当前预测单元的帧内预测模式。在通过使用根据相邻预测单元预测的模式信息来预测当前预测单元的预测模式时,在当前预测单元的帧内预测模式与相邻预测单元的帧内预测模式相同时,可以使用预定的标志信息来传送指示当前预测单元的预测模式与相邻预测单元的预测模式彼此相同的信息。在当前预测单元的预测模式与相邻预测单元的预测模式不同时,可以执行熵编码以对当前块的预测模式信息进行编码。In the intra prediction method, according to the prediction mode, a prediction block can be generated after applying an AIS (Adaptive Intra Smoothing) filter to a reference pixel. The type of the AIS filter applied to the reference pixel may be different. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted according to the intra prediction mode of a prediction unit adjacent to the current prediction unit. When the prediction mode of the current prediction unit is predicted by using the mode information predicted according to the adjacent prediction unit, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the adjacent prediction unit, predetermined flag information may be used to transmit information indicating that the prediction mode of the current prediction unit and the prediction mode of the adjacent prediction unit are the same as each other. When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy coding may be performed to encode the prediction mode information of the current block.
此外,可以基于由预测模块120和125生成的预测单元来生成包括关于残差值的信息的残差块,该残差值是经受预测的预测单元与预测单元的原始块之间的差。可以将所生成的残差块输入至变换模块130。In addition, a residual block including information on a residual value, which is a difference between the prediction unit subjected to prediction and the original block of the prediction unit, may be generated based on the prediction unit generated by the prediction modules 120 and 125. The generated residual block may be input to the transform module 130.
变换模块130可以通过使用诸如离散余弦变换(DCT)、离散正弦变换(DST)和KLT的变换方法来对包括关于原始块与由预测模块120和125生成的预测单元之间的残差值的信息的残差块进行变换。可以基于用于生成残差块的预测单元的帧内预测模式信息来确定是应用DCT、DST还是KLT以便对残差块进行变换。The transform module 130 may transform the residual block including information on the residual value between the original block and the prediction unit generated by the prediction modules 120 and 125 by using a transform method such as discrete cosine transform (DCT), discrete sine transform (DST), and KLT. Whether to apply DCT, DST, or KLT in order to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
量化模块135可以对通过变换模块130变换至频域的值进行量化。量化系数可以根据图片的块或重要性而不同。可以将由量化模块135计算的值提供至逆量化模块140和重排模块160。The quantization module 135 may quantize the value transformed to the frequency domain by the transform module 130. The quantization coefficient may be different according to the block or importance of the picture. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.
重排模块160可以对经量化的残差值的系数进行重排。The rearrangement module 160 may rearrange coefficients of the quantized residual value.
重排模块160可以通过系数扫描方法将二维块形式的系数变为一维向量形式的系数。例如,重排模块160可以使用之字形(zigzag)扫描方法从DC系数扫描至高频域的系数,以便将系数变为一维向量形式。根据变换单元的大小和帧内预测模式,可以使用在列方向上扫描二维块形式的系数的垂直方向扫描或在行方向上扫描二维块形式的系数的水平方向扫描代替之字形扫描。也就是说,可以根据变换单元的大小和帧内预测模式来确定使用之字形扫描、垂直方向扫描和水平方向扫描中的哪种扫描方法。The rearrangement module 160 can change the coefficient of the two-dimensional block form into the coefficient of the one-dimensional vector form by the coefficient scanning method. For example, the rearrangement module 160 can use a zigzag scanning method to scan from the DC coefficient to the coefficient of the high frequency domain so that the coefficient is changed into a one-dimensional vector form. According to the size of the transform unit and the intra-frame prediction mode, the zigzag scanning can be replaced by the vertical scanning of the coefficient of the two-dimensional block form in the column direction or the horizontal scanning of the coefficient of the two-dimensional block form in the row direction. That is to say, it can be determined according to the size of the transform unit and the intra-frame prediction mode which scanning method to use among the zigzag scanning, the vertical scanning and the horizontal scanning.
熵编码模块165可以基于由重排模块160计算的值来执行熵编码。熵编码可以使用诸如指数哥伦布(Golomb)编码、上下文自适应可变长编码(CAVLC)和上下文自适应二进制算术编码(CABAC)的各种编码方法。The entropy encoding module 165 may perform entropy encoding based on the value calculated by the rearrangement module 160. The entropy encoding may use various encoding methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC).
熵编码模块165可以对来自重排模块160以及预测模块120和125的各种信息例如编码单元的残差值系数信息和块类型信息、预测模式信息、划分单元信息、预测单元信息、变换单元信息、运动向量信息、参考帧信息、块插值信息、滤波信息等进行编码。The entropy coding module 165 can encode various information from the rearrangement module 160 and the prediction modules 120 and 125, such as residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transformation unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.
熵编码模块165可以对从重排模块160输入的编码单元的系数进行熵编码。The entropy encoding module 165 may entropy encode coefficients of the coding unit input from the rearrangement module 160 .
逆量化模块140可以对由量化模块135量化的值进行逆量化,并且逆变换模块145可以对由变换模块130变换的值进行逆变换。可以将由逆量化模块140和逆变换模块145生成的残差值与由预测模块120和125的运动估计模块、运动补偿模块和帧内预测模块预测的预测单元进行组合,使得可以生成重构块。The inverse quantization module 140 may inversely quantize the value quantized by the quantization module 135, and the inverse transform module 145 may inversely transform the value transformed by the transform module 130. The residual values generated by the inverse quantization module 140 and the inverse transform module 145 may be combined with the prediction units predicted by the motion estimation module, the motion compensation module, and the intra prediction module of the prediction modules 120 and 125, so that a reconstructed block may be generated.
滤波器模块150可以包括去块滤波器、偏移校正单元和自适应环路滤波器(ALF)中的至少一个。The filter module 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
去块滤波器可以去除由于重构图片中的块之间的边界而出现的块失真。为了确定是否执行去块,包括在块中的若干行或列中的像素可以是确定是否将去块滤波器应用于当前块的基础。当去块滤波器被应用于块时,可以根据所需的去块滤波强度来应用强滤波器或弱滤波器。此外,在应用去块滤波器时,可以并行地处理水平方向滤波和垂直方向滤波。The deblocking filter can remove block distortion that occurs due to the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, the pixels in several rows or columns included in the block can be the basis for determining whether to apply the deblocking filter to the current block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. In addition, when applying the deblocking filter, horizontal filtering and vertical filtering can be processed in parallel.
偏移校正模块可以在经受去块的图片中以像素为单位校正与原始图片的偏移。为了对特定图片执行偏移校正,可以使用在考虑每个像素的边缘信息的情况下应用偏移的方法或下述方法:将图片的像素划分为预定数目的区域、确定要经受执行偏移的区域以及将偏移应用于所确定的区域。The offset correction module can correct the offset from the original picture in units of pixels in the picture subjected to deblocking. In order to perform offset correction on a specific picture, a method of applying an offset in consideration of edge information of each pixel or a method of dividing the pixels of the picture into a predetermined number of regions, determining the region to be subjected to performing the offset, and applying the offset to the determined region can be used.
可以基于通过将经滤波的重构图片与原始图片进行比较而获得的值来执行自适应环路滤波(ALF)。可以将图片中包括的像素分成预定的组,可以确定要应用于组中的每个组的滤波器,并且可以针对每个组来单独地执行滤波。可以通过编码单元(CU)传送关于是否应用ALF的信息和亮度信号。用于ALF的滤波器的形状和滤波器系数可以根据每个块而不同。此外,无论应用目标块的特征如何,都可以应用相同形状(固定形状)的用于ALF的滤波器。Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed picture with an original picture. The pixels included in the picture can be divided into predetermined groups, a filter to be applied to each group in the group can be determined, and filtering can be performed separately for each group. Information on whether ALF is applied and a luminance signal can be transmitted by a coding unit (CU). The shape and filter coefficients of the filter used for ALF can be different for each block. In addition, regardless of the characteristics of the application target block, a filter for ALF of the same shape (fixed shape) can be applied.
存储器155可以存储通过滤波器模块150计算的重构块或重构图片。可以在执行帧间预测时将所存储的重构块或重构图片提供至预测模块120和125。The memory 155 may store the reconstructed block or the reconstructed picture calculated by the filter module 150. The stored reconstructed block or the reconstructed picture may be provided to the prediction modules 120 and 125 when performing inter prediction.
图2是示出了根据本发明的实施方式的用于对视频进行解码的装置的框图。FIG. 2 is a block diagram showing an apparatus for decoding a video according to an embodiment of the present invention.
参照图2,用于对视频进行解码的装置200可以包括:熵解码模块210、重排模块215、逆量化模块220、逆变换模块225、预测模块230和235、滤波器模块240以及存储器245。2 , the apparatus 200 for decoding a video may include an entropy decoding module 210 , a rearrangement module 215 , an inverse quantization module 220 , an inverse transform module 225 , prediction modules 230 and 235 , a filter module 240 , and a memory 245 .
当从用于对视频进行编码的装置输入视频比特流时,可以根据用于对视频进行编码的装置的逆处理对输入的比特流进行解码。When a video bitstream is input from the apparatus for encoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding a video.
熵解码模块210可以根据由用于对视频进行编码的装置的熵编码模块进行的熵编码的逆处理来执行熵解码。例如,对应于由用于对视频进行编码的装置执行的方法,可以应用诸如指数哥伦布编码、上下文自适应可变长编码(CAVLC)和上下文自适应二进制算术编码(CABAC)的各种方法。The entropy decoding module 210 may perform entropy decoding according to an inverse process of entropy encoding performed by an entropy encoding module of a device for encoding a video. For example, corresponding to a method performed by a device for encoding a video, various methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC) may be applied.
熵解码模块210可以对关于由用于对视频进行编码的装置执行的帧内预测和帧间预测的信息进行解码。The entropy decoding module 210 may decode information about intra prediction and inter prediction performed by the apparatus for encoding a video.
重排模块215可以基于在用于对视频进行编码的装置中使用的重排方法对由熵解码模块210熵解码的比特流执行重排。重排模块可以将一维向量形式的系数重构和重排为二维块形式的系数。重排模块215可以接收与在用于对视频进行编码的装置中执行的系数扫描相关的信息,并且可以经由基于在用于对视频进行编码的装置中执行的扫描顺序对系数进行逆扫描的方法来执行重排。The rearrangement module 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding module 210 based on the rearrangement method used in the apparatus for encoding a video. The rearrangement module may reconstruct and rearrange coefficients in the form of a one-dimensional vector into coefficients in the form of a two-dimensional block. The rearrangement module 215 may receive information related to coefficient scanning performed in the apparatus for encoding a video, and may perform rearrangement via a method of inversely scanning the coefficients based on the scanning order performed in the apparatus for encoding a video.
逆量化模块220可以基于从用于对视频进行编码的装置接收的量化参数和经重排的块的系数来执行逆量化。The inverse quantization module 220 may perform inverse quantization based on a quantization parameter received from the apparatus for encoding a video and coefficients of the rearranged block.
逆变换模块225可以对由用于对视频进行编码的装置的量化结果执行逆变换即逆DCT、逆DST和逆KLT,该逆变换是由变换模块执行的变换即DCT、DST和KLT的逆处理。可以基于由用于对视频进行编码的装置确定的传输单元来执行逆变换。用于对视频进行解码的装置的逆变换模块225可以根据诸如预测方法、当前块的大小、预测方向等的多条信息来选择性地执行变换方案(例如,DCT、DST和KLT)。The inverse transform module 225 may perform an inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, on the quantization result of the apparatus for encoding the video, which is an inverse process of the transform, i.e., DCT, DST, and KLT, performed by the transform module. The inverse transform may be performed based on a transmission unit determined by the apparatus for encoding the video. The inverse transform module 225 of the apparatus for decoding the video may selectively perform a transform scheme (e.g., DCT, DST, and KLT) according to multiple pieces of information such as a prediction method, a size of a current block, a prediction direction, and the like.
预测模块230和235可以基于从熵解码模块210接收的关于预测块生成的信息和从存储器245接收的先前解码的块或图片信息来生成预测块。The prediction modules 230 and 235 may generate a prediction block based on the information on prediction block generation received from the entropy decoding module 210 and previously decoded block or picture information received from the memory 245 .
如上所述,类似于用于对视频进行编码的装置的操作,在执行帧内预测时,当预测单元的大小与变换单元的大小相同时,可以基于位于预测单元的左侧、左上侧和上侧的像素对预测单元执行帧内预测。在执行帧内预测时,当预测单元的大小与变换单元的大小不同时,可以使用基于变换单元的参考像素来执行帧内预测。此外,使用NxN划分的帧内预测可以仅用于最小编码单元。As described above, similar to the operation of the apparatus for encoding a video, when performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and upper sides of the prediction unit. When performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using NxN partitioning can be used only for the minimum coding unit.
预测模块230和235可以包括预测单元确定模块、帧间预测模块和帧内预测模块。预测单元确定模块可以从熵解码模块210接收各种信息例如预测单元信息、帧内预测方法的预测模式信息、关于帧间预测方法的运动预测的信息等,可以将当前编码单元分成预测单元,并且可以确定对预测单元执行帧间预测还是帧内预测。通过使用从用于对视频进行编码的装置接收的当前预测单元的帧间预测中所需的信息,帧间预测模块230可以基于包括当前预测单元的当前图片的先前图片或后续图片中的至少一个的信息来对当前预测单元执行帧间预测。替选地,可以基于包括当前预测单元的当前图片中的一些预先重构区域的信息来执行帧间预测。The prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module may receive various information such as prediction unit information, prediction mode information of an intra-frame prediction method, information about motion prediction of an inter-frame prediction method, etc. from the entropy decoding module 210, may divide the current coding unit into prediction units, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required in the inter-frame prediction of the current prediction unit received from the device for encoding a video, the inter-frame prediction module 230 may perform inter-frame prediction on the current prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit. Alternatively, inter-frame prediction may be performed based on information of some pre-reconstructed areas in the current picture including the current prediction unit.
为了执行帧间预测,可以针对编码单元来确定将跳过模式、合并模式、AMVP模式和帧间块复制模式中的哪种模式用作包括在编码单元中的预测单元的运动预测方法。In order to perform inter prediction, which mode of the skip mode, the merge mode, the AMVP mode, and the inter block copy mode to use as a motion prediction method of a prediction unit included in the coding unit may be determined for the coding unit.
帧内预测模块235可以基于当前图片中的像素信息来生成预测块。当预测单元是经受帧内预测的预测单元时,可以基于从用于对视频进行编码的装置接收的预测单元的帧内预测模式信息来执行帧内预测。帧内预测模块235可以包括自适应帧内平滑(AIS)滤波器、参考像素插值模块和DC滤波器。AIS滤波器对当前块的参考像素执行滤波,并且可以根据当前预测单元的预测模式来确定是否应用滤波器。可以通过使用从用于对视频进行编码的装置接收的AIS滤波器信息和预测单元的预测模式来对当前块的参考像素执行AIS滤波。在当前块的预测模式是不执行AIS滤波的模式时,可以不应用AIS滤波器。The intra prediction module 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit subjected to intra prediction, intra prediction can be performed based on intra prediction mode information of the prediction unit received from the device for encoding the video. The intra prediction module 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and it can be determined whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block by using the AIS filter information received from the device for encoding the video and the prediction mode of the prediction unit. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.
当预测单元的预测模式是其中基于通过对参考像素进行插值而获得的像素值来执行帧内预测的预测模式时,参考像素插值模块可以对参考像素进行插值,以生成整像素或小于整像素的参考像素。在当前预测单元的预测模式是其中在没有对参考像素进行插值的情况下生成预测块的预测模式时,可以不对参考像素进行插值。在当前块的预测模式是DC模式时,DC滤波器可以通过滤波来生成预测块。When the prediction mode of the prediction unit is a prediction mode in which intra prediction is performed based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation module may interpolate the reference pixels to generate reference pixels that are integer pixels or smaller than integer pixels. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, a DC filter may generate a prediction block by filtering.
可以将重构的块或图片提供至滤波器模块240。滤波器模块240可以包括去块滤波器、偏移校正模块和ALF。The reconstructed block or picture may be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.
可以从用于对视频进行编码的装置接收关于是否将去块滤波器应用于相应的块或图片的信息以及关于在应用去块滤波器时应用强滤波器和弱滤波器中的哪种滤波器的信息。用于对视频进行解码的装置的去块滤波器可以从用于对视频进行编码的装置接收关于去块滤波器的信息,并且可以对相应的块执行去块滤波。Information about whether to apply a deblocking filter to a corresponding block or picture and information about which filter of a strong filter and a weak filter to apply when applying the deblocking filter can be received from a device for encoding a video. The deblocking filter of a device for decoding a video can receive information about the deblocking filter from a device for encoding a video, and can perform deblocking filtering on the corresponding block.
偏移校正模块可以基于在执行编码时应用于图片的偏移校正的类型和偏移值信息来对重构图片执行偏移校正。The offset correction module may perform offset correction on the reconstructed picture based on the type of offset correction applied to the picture when encoding is performed and offset value information.
可以基于从用于对视频进行编码的装置接收的关于是否应用ALF的信息、ALF系数信息等来将ALF应用于编码单元。ALF信息可以被提供为被包括在特定参数集中。The ALF may be applied to the coding unit based on information on whether the ALF is applied, ALF coefficient information, etc. received from the apparatus for encoding a video. The ALF information may be provided to be included in a specific parameter set.
存储器245可以存储重构的图片或块以用作参考图片或块,并且可以将重构的图片提供至输出模块。The memory 245 may store the reconstructed picture or block to be used as a reference picture or block, and may provide the reconstructed picture to the output module.
如上所述,在本发明的实施方式中,为了便于说明,编码单元用作表示用于编码的单元的术语,但是编码单元可以用作执行解码以及编码的单元。As described above, in the embodiments of the present invention, for convenience of explanation, a coding unit is used as a term indicating a unit for encoding, but the coding unit may be used as a unit that performs decoding as well as encoding.
另外,当前块可以表示要被编码/解码的目标块。并且,根据编码/解码步骤,当前块可以表示编码树块(或编码树单元)、编码块(或编码单元)、变换块(或变换单元)、预测块(或预测单元)等。在本说明书中,‘单元’可以表示用于执行特定的编码/解码处理的基本单元,而‘块’可以表示预定大小的样本阵列。除非另有说明,否则‘块’和‘单元’可以用作相同的含义。例如,在后面提及的示例中,可以理解,编码块和编码单元彼此具有相同的含义。In addition, the current block may represent a target block to be encoded/decoded. And, according to the encoding/decoding step, the current block may represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), a prediction block (or prediction unit), etc. In the present specification, a 'unit' may represent a basic unit for performing a specific encoding/decoding process, and a 'block' may represent a sample array of a predetermined size. Unless otherwise specified, 'block' and 'unit' may be used as the same meaning. For example, in the examples mentioned later, it can be understood that the coding block and the coding unit have the same meaning as each other.
可以通过分成具有正方形形状或非正方形形状的基本块来对一个图片进行编码/解码。此时,基本块可以被称为编码树单元。编码树单元可以被定义为序列或切片(slice)内允许的最大大小的编码单元。可以通过序列参数集、图片参数集或片头(slice header)用信号发送表示编码树单元是具有正方形形状还是具有非正方形形状的信息或与编码树单元的大小有关的信息。编码树单元可以被分成更小大小的划分。此时,如果假设通过分割编码树单元生成的划分的深度是1,则通过分割深度为1的划分生成的划分的深度可以被定义为2。也就是说,通过分割编码树单元中深度为k的划分生成的划分可以被定义为深度为k+1。A picture can be encoded/decoded by being divided into basic blocks having a square shape or a non-square shape. At this time, the basic block can be referred to as a coding tree unit. The coding tree unit can be defined as a coding unit of the maximum size allowed within a sequence or slice. Information indicating whether the coding tree unit has a square shape or a non-square shape or information related to the size of the coding tree unit can be signaled through a sequence parameter set, a picture parameter set, or a slice header. The coding tree unit can be divided into smaller-sized partitions. At this time, if it is assumed that the depth of the partition generated by splitting the coding tree unit is 1, the depth of the partition generated by splitting the partition with a depth of 1 can be defined as 2. That is, the partition generated by splitting the partition with a depth of k in the coding tree unit can be defined as a depth of k+1.
通过分割编码树单元生成的任意大小的划分可以被定义为编码单元。编码单元可以被递归地分割或分成用于执行预测、量化、变换或环路滤波等的基本单元。例如,通过分割编码单元生成的任意大小的划分可以被定义为编码单元,或者可以被定义为变换单元或预测单元,该编码单元、变换单元或预测单元是用于执行预测、量化、变换或环路滤波等的基本单元。A partition of any size generated by splitting a coding tree unit may be defined as a coding unit. A coding unit may be recursively split or divided into a basic unit for performing prediction, quantization, transformation, or loop filtering, etc. For example, a partition of any size generated by splitting a coding unit may be defined as a coding unit, or may be defined as a transformation unit or a prediction unit, which is a basic unit for performing prediction, quantization, transformation, or loop filtering, etc.
替选地,可以通过编码块的预测划分来确定与编码块具有相同的大小或小于编码块的预测块。对于编码块的预测划分,可以指定表示编码块的划分形状的划分模式(Part_mode)候选中的任何一个。可以通过比特流用信号发送用于确定指示划分模式候选中的任何一个的划分索引的信息。替选地,可以基于编码块的大小、形状或编码模式中的至少一个来确定编码块的划分索引。可以基于由划分索引指定的划分模式来确定预测块的大小或形状。划分模式候选可以包括非对称划分形状(例如,nLx2N、nRx2N、2NxnU、2NxnD)。可以基于编码块的大小、形状或编码模式中的至少一个来确定编码块可用的非对称划分模式候选的数目或类型。Alternatively, a prediction block having the same size as or smaller than the coding block can be determined by predictive partitioning of the coding block. For the predictive partitioning of the coding block, any one of the partitioning mode (Part_mode) candidates representing the partitioning shape of the coding block can be specified. Information for determining a partitioning index indicating any one of the partitioning mode candidates can be sent by a bitstream signal. Alternatively, the partitioning index of the coding block can be determined based on at least one of the size, shape, or coding mode of the coding block. The size or shape of the prediction block can be determined based on the partitioning mode specified by the partitioning index. The partitioning mode candidates may include asymmetric partitioning shapes (e.g., nLx2N, nRx2N, 2NxnU, 2NxnD). The number or type of asymmetric partitioning mode candidates available for the coding block can be determined based on at least one of the size, shape, or coding mode of the coding block.
图3是示出了当通过帧间预测对编码块进行编码时可以应用于编码块的划分模式候选的图。FIG. 3 is a diagram showing partition mode candidates that can be applied to a coding block when the coding block is encoded through inter prediction.
当通过帧间预测对编码块进行编码时,可以将图3中所示的8个划分模式候选中的任意一个应用于编码块。When a coding block is encoded by inter prediction, any one of the eight partition mode candidates shown in FIG. 3 may be applied to the coding block.
另一方面,当通过帧内预测对编码块进行编码时,可以仅将正方形划分式划分应用于编码块。换言之,当通过帧内预测对编码块进行编码时,可以将划分模式,PART_2Nx2N或PART_NxN,应用于编码块。On the other hand, when the coding block is encoded by intra prediction, only the square partitioning mode may be applied to the coding block. In other words, when the coding block is encoded by intra prediction, the partitioning mode, PART_2Nx2N or PART_NxN, may be applied to the coding block.
当编码块具有最小大小时,可以应用PART_NxN。在本文中,可以在编码器和解码器中预定义编码块的最小大小。替选地,可以通过比特流用信号发送与编码块的最小大小有关的信息。在示例中,可以通过片头用信号发送编码块的最小大小。因此,可以对于每个切片不同地确定编码块的最小大小。When the coding block has a minimum size, PART_NxN can be applied. In this article, the minimum size of the coding block can be predefined in the encoder and decoder. Alternatively, information related to the minimum size of the coding block can be signaled through the bitstream. In an example, the minimum size of the coding block can be signaled through the slice header. Therefore, the minimum size of the coding block can be determined differently for each slice.
在另一示例中,可以根据编码块的大小或形状中的至少一个来不同地确定可用于编码块的划分模式候选。在示例中,可以根据编码块的大小或形状中的至少一个来不同地确定可用于编码块的划分模式候选的数目或类型。In another example, the partition mode candidates available for the coding block may be determined differently according to at least one of the size or shape of the coding block. In an example, the number or type of partition mode candidates available for the coding block may be determined differently according to at least one of the size or shape of the coding block.
替选地,可以基于编码块的大小或形状来确定可用于编码块的非对称划分模式候选的类型或数目。可以根据编码块的大小或形状中的至少一个来不同地确定可用于编码块的非对称划分模式候选的数目或类型。在示例中,当编码块具有宽度大于高度的非正方形形状时,可以不将PART_2NxN、PART_2NxnU或PART_2NxnD中的至少一个用作编码块的划分模式候选。当编码块具有高度大于宽度的非正方形形状时,可以不将PART_Nx2N、PART_nLx2N、PART_nRx2N中的至少一个用作编码块的划分模式候选。Alternatively, the type or number of asymmetric partitioning pattern candidates available for the coding block may be determined based on the size or shape of the coding block. The number or type of asymmetric partitioning pattern candidates available for the coding block may be determined differently according to at least one of the size or shape of the coding block. In the example, when the coding block has a non-square shape with a width greater than the height, at least one of PART_2NxN, PART_2NxnU, or PART_2NxnD may not be used as a partitioning pattern candidate for the coding block. When the coding block has a non-square shape with a height greater than the width, at least one of PART_Nx2N, PART_nLx2N, PART_nRx2N may not be used as a partitioning pattern candidate for the coding block.
通常,预测块可以具有4x4至64x64的大小。但是,当通过帧间预测对编码块进行编码时,可以将预测块限制为不具有4x4的大小以减小执行运动补偿时的存储带宽。Generally, the prediction block may have a size of 4x4 to 64x64. However, when the coding block is encoded by inter-frame prediction, the prediction block may be restricted to not have a size of 4x4 to reduce the memory bandwidth when performing motion compensation.
基于划分模式,可以递归地划分编码块。换言之,基于由划分索引确定的划分模式,编码块可以被划分并且可以将通过对编码块进行划分而生成的每个划分定义为编码块。Based on the partition mode, the coding block may be recursively partitioned. In other words, based on the partition mode determined by the partition index, the coding block may be partitioned and each partition generated by partitioning the coding block may be defined as a coding block.
在下文中,将更详细地描述划分编码单元的方法。在后面提及的示例中,编码单元可以意指编码树单元或包括在编码树单元中的编码单元。另外,通过对编码块进行划分而生成的“划分”可以意指“编码块”。后面提及的划分方法可以在将编码块划分为多个预测块或变换块时应用。Hereinafter, the method of dividing the coding unit will be described in more detail. In the examples mentioned later, the coding unit may refer to a coding tree unit or a coding unit included in a coding tree unit. In addition, "division" generated by dividing a coding block may refer to a "coding block". The division method mentioned later may be applied when dividing a coding block into a plurality of prediction blocks or transform blocks.
可以通过至少一条线来对编码单元进行划分。在这种情况下,对编码单元进行划分的线的角度可以是0至360度的范围内的值。例如,水平线的角度可以是0度,垂直线的角度可以是90度,右上方向上的对角线的角度可以是45度,而左上对角线的角度可以是135度。The coding unit may be divided by at least one line. In this case, the angle of the line dividing the coding unit may be a value in the range of 0 to 360 degrees. For example, the angle of the horizontal line may be 0 degrees, the angle of the vertical line may be 90 degrees, the angle of the diagonal line in the upper right direction may be 45 degrees, and the angle of the upper left diagonal line may be 135 degrees.
在通过多条线来对编码单元进行划分时,多条线中的所有线都可以具有相同的角度。替选地,多条线中的至少一条可以具有与其他线不同的角度。替选地,对编码树单元或编码单元进行划分的多条线可以具有预定义的角度差(例如,90度)。When the coding unit is divided by multiple lines, all the lines in the multiple lines may have the same angle. Alternatively, at least one of the multiple lines may have an angle different from the other lines. Alternatively, the multiple lines that divide the coding tree unit or the coding unit may have a predefined angle difference (e.g., 90 degrees).
可以通过划分模式来确定与对编码单元进行划分的线有关的信息。替选地,可以对关于线在块中的数目、方向、角度或位置中的至少一个的信息进行编码。Information about the lines dividing the coding unit may be determined by a division pattern. Alternatively, information about at least one of the number, direction, angle, or position of the lines in the block may be encoded.
为了便于描述,在之后提及的示例中,假设通过使用垂直线或水平线中的至少一条将编码单元划分为多个编码单元。For convenience of description, in an example mentioned later, it is assumed that a coding unit is divided into a plurality of coding units by using at least one of a vertical line or a horizontal line.
对编码单元进行划分的垂直线或水平线的数目可以是至少一个或更多个。在示例中,可以通过使用一条垂直线或一条水平线来将编码单元划分为2个划分。替选地,可以通过使用两条垂直线或两条水平线来将编码单元划分为3个划分。替选地,可以通过使用一条垂直线或一条水平线将编码单元划分为4个划分,所述4个划分的宽度和高度相对于编码单元减半。The number of vertical lines or horizontal lines that divide the coding unit may be at least one or more. In the example, the coding unit may be divided into 2 partitions by using one vertical line or one horizontal line. Alternatively, the coding unit may be divided into 3 partitions by using two vertical lines or two horizontal lines. Alternatively, the coding unit may be divided into 4 partitions by using one vertical line or one horizontal line, and the width and height of the 4 partitions are halved relative to the coding unit.
当通过使用至少一条垂直线或至少一条水平线将编码单元划分为多个划分时,划分可以具有统一的大小。替选地,一个划分可以具有与其他划分不同的大小,或者每个划分可以具有不同的大小。在示例中,当通过两条水平线或两条垂直线对编码单元进行划分时,可以将编码单元划分为3个划分。在这种情况下,3个划分的宽度比或高度比可以是n:2n:n、2n:n:n或n:n:2n。When a coding unit is divided into multiple partitions by using at least one vertical line or at least one horizontal line, the partitions may have a uniform size. Alternatively, one partition may have a different size from the other partitions, or each partition may have a different size. In the example, when the coding unit is divided by two horizontal lines or two vertical lines, the coding unit may be divided into 3 partitions. In this case, the width ratio or height ratio of the 3 partitions may be n:2n:n, 2n:n:n, or n:n:2n.
在后面提及的示例中,将编码块划分为4个划分被称为基于四叉树的划分。并且,将编码块划分为2个划分被称为基于二叉树的划分。另外,将编码块划分为3个划分被称为基于三叉树的划分。In the examples mentioned later, dividing the coding block into 4 partitions is called quadtree-based partitioning. And, dividing the coding block into 2 partitions is called binary tree-based partitioning. In addition, dividing the coding block into 3 partitions is called ternary tree-based partitioning.
在后面提及的附图中,将示出使用一条垂直线和/或一条水平线来对编码单元进行划分,但是将描述的是,通过使用比所示的更多垂直线和/或更多水平线将编码单元划分为比所示的更多的划分或者将编码单元划分为比所示的更少的划分也包括在本发明的范围内。In the figures mentioned later, it will be shown that the coding unit is divided using one vertical line and/or one horizontal line, but it will be described that dividing the coding unit into more divisions than shown by using more vertical lines and/or more horizontal lines than shown or dividing the coding unit into fewer divisions than shown is also included in the scope of the present invention.
图4示出了作为应用了本发明的实施方式的基于树结构对编码块进行层次划分的示例。FIG. 4 shows an example of hierarchical division of coding blocks based on a tree structure as an embodiment to which the present invention is applied.
以预定的块单元对输入视频信号进行解码,并且用于对输入视频信号进行解码的基本单元被称为编码块。编码块可以是执行帧内/帧间预测、变换以及量化的单元。另外,可以以编码块为单位确定预测模式(例如,帧内预测模式或帧间预测模式),并且包括在编码块中的预测块可以共享所确定的预测模式。编码块可以是在8x8至64x64的范围内的任意大小的正方形块或非正方形块,或者可以是具有128x128、256x256或更大的大小的正方形块或非正方形块。The input video signal is decoded in predetermined block units, and the basic unit for decoding the input video signal is called a coding block. A coding block may be a unit that performs intra/inter prediction, transformation, and quantization. In addition, a prediction mode (e.g., an intra prediction mode or an inter prediction mode) may be determined in units of coding blocks, and the prediction blocks included in the coding block may share the determined prediction mode. A coding block may be a square block or a non-square block of any size in the range of 8x8 to 64x64, or may be a square block or a non-square block having a size of 128x128, 256x256, or larger.
具体地,可以基于四叉树划分方法、二叉树划分方法或三叉树划分方法中的至少一种来对编码块进行层次划分。基于四叉树的划分可以意指将2Nx2N编码块划分为四个NxN编码块的方法。基于二叉树的划分可以意指将一个编码块划分为两个编码块的方法。基于三叉树的划分可以意指将一个编码块划分为三个编码块的方法。即使当基于三叉树或基于二叉树的划分被执行时,也可以在较低的深度处存在正方形编码块。Specifically, the coding block may be hierarchically divided based on at least one of a quadtree partitioning method, a binary tree partitioning method, or a ternary tree partitioning method. Quadtree-based partitioning may mean a method of dividing a 2Nx2N coding block into four NxN coding blocks. Binary tree-based partitioning may mean a method of dividing one coding block into two coding blocks. Ternary tree-based partitioning may mean a method of dividing one coding block into three coding blocks. Even when ternary tree-based or binary tree-based partitioning is performed, square coding blocks may exist at a lower depth.
通过基于二叉树的划分生成的划分可以是对称的或非对称的。另外,基于二叉树划分的编码块可以是正方形块或非正方形块(例如,矩形)。The partitions generated by the binary tree-based partitioning may be symmetric or asymmetric. In addition, the coding blocks based on the binary tree partitioning may be square blocks or non-square blocks (eg, rectangular).
图5是示出了基于二叉树划分的编码块的划分形状的图。基于二叉树划分的编码块的划分形状可以包括诸如2NxN(水平方向上的非正方形编码单元)或Nx2N(垂直方向上的非正方形编码单元)等的对称类型,或者诸如nLx2N、nRx2N、2NxnU或2NxnD等的非对称类型。可以仅允许对称类型或非对称类型之一作为编码块的划分形状。5 is a diagram showing the division shape of a coding block based on binary tree division. The division shape of the coding block based on binary tree division may include a symmetric type such as 2NxN (non-square coding unit in the horizontal direction) or Nx2N (non-square coding unit in the vertical direction), or an asymmetric type such as nLx2N, nRx2N, 2NxnU, or 2NxnD. Only one of the symmetric type or the asymmetric type may be allowed as the division shape of the coding block.
三叉树划分形状可以包括将编码块划分为2条垂直线的形状或将编码块划分为2条水平线的形状中的至少一种。可以通过三叉树划分生成3个非正方形划分。The ternary tree partition shape may include at least one of a shape of dividing the coding block into 2 vertical lines or a shape of dividing the coding block into 2 horizontal lines. Three non-square partitions may be generated by the ternary tree partition.
图6示出了三叉树划分形状。FIG6 shows a ternary tree partition shape.
三叉树划分形状可以包括将编码块划分为2条水平线的形状或将编码块划分为2条垂直线的形状。通过对编码块进行划分而生成的划分的宽度比或高度比可以是n:2n:n、2n:n:n或n:n:2n。The ternary tree partition shape may include a shape of dividing the coding block into 2 horizontal lines or a shape of dividing the coding block into 2 vertical lines. The width ratio or height ratio of the partition generated by dividing the coding block may be n:2n:n, 2n:n:n, or n:n:2n.
可以在编码器和解码器中预定义在3个划分中具有最大宽度或高度的划分的位置。替选地,可以通过比特流用信号发送指示在3个划分中具有最大宽度或高度的划分的信息。The position of the partition having the largest width or height among the three partitions may be predefined in the encoder and the decoder. Alternatively, information indicating the partition having the largest width or height among the three partitions may be signaled through a bitstream.
对于编码单元,可以仅允许正方形形状或非正方形对称形状的划分。在这种情况下,将编码单元划分为正方形划分可以对应于四叉树CU划分,并且将编码单元划分为对称形状的非正方形划分可以对应于二叉树划分。将编码树单元划分为正方形划分和对称形状的非正方形划分可以对应于四叉树和二叉树CU划分(QTBT)。For coding units, only square-shaped or non-square-shaped symmetrical partitions may be allowed. In this case, the partitioning of the coding unit into square partitions may correspond to a quadtree CU partition, and the partitioning of the coding unit into a symmetrically shaped non-square partition may correspond to a binary tree partition. The partitioning of the coding tree unit into a square partition and a symmetrically shaped non-square partition may correspond to a quadtree and binary tree CU partition (QTBT).
可以对不再执行基于四叉树的划分的编码块执行基于二叉树或基于三叉树的划分。通过基于二叉树或基于三叉树的划分生成的编码块可以被划分为更小的编码块。在这种情况下,可以将四叉树划分、三叉树划分或二叉树划分中的至少一种设置成不被应用于编码块。替选地,对于编码块,可以不允许在预定方向上的二叉树划分或在预定方向上的三叉树划分。在示例中,对于通过基于二叉树或基于三叉树的划分生成的编码块,四叉树划分和三叉树划分可以被设置成为不允许的。对于该编码块,可以允许仅二叉树划分。Binary tree or ternary tree based partitioning may be performed on a coding block for which quadtree based partitioning is no longer performed. A coding block generated by binary tree or ternary tree based partitioning may be divided into smaller coding blocks. In this case, at least one of quadtree partitioning, ternary tree partitioning, or binary tree partitioning may be set not to be applied to the coding block. Alternatively, for a coding block, binary tree partitioning in a predetermined direction or ternary tree partitioning in a predetermined direction may not be allowed. In an example, for a coding block generated by binary tree or ternary tree based partitioning, quadtree partitioning and ternary tree partitioning may be set to be not allowed. For the coding block, only binary tree partitioning may be allowed.
替选地,可以仅将通过基于三叉树的划分生成的3个编码块中的最大编码块划分为较小的编码块。替选地,可以仅使得通过基于三叉树的划分生成的3个编码块中的最大编码块允许基于二叉树的划分或基于三叉树的划分。Alternatively, only the largest coding block among the three coding blocks generated by the ternary tree-based partitioning may be partitioned into smaller coding blocks. Alternatively, only the largest coding block among the three coding blocks generated by the ternary tree-based partitioning may be allowed to be partitioned based on a binary tree or partitioned based on a ternary tree.
可以基于较高深度的划分的划分形状来相应地确定较低深度的划分的划分形状。在示例中,当较高的划分和较低的划分基于二叉树被划分时,对于较低深度的划分,可以仅允许与较高深度的划分的二叉树划分形状相同的形状的基于二叉树的划分。例如,当较高深度的划分的二叉树划分形状是2NxN时,较低深度的划分的二叉树划分形状也可以被设置成为2NxN。替选地,当较高深度的划分的二叉树划分形状是Nx2N时,较低深度的划分的划分形状也可以被设置成为Nx2N。The division shape of the lower depth division can be determined accordingly based on the division shape of the higher depth division. In the example, when the higher division and the lower division are divided based on the binary tree, for the lower depth division, only the binary tree-based division of the same shape as the binary tree division shape of the higher depth division can be allowed. For example, when the binary tree division shape of the higher depth division is 2NxN, the binary tree division shape of the lower depth division can also be set to 2NxN. Alternatively, when the binary tree division shape of the higher depth division is Nx2N, the division shape of the lower depth division can also be set to Nx2N.
替选地,对于通过基于三叉树的划分生成的划分中的最大划分,在与较高深度的划分相同的划分方向上的二叉树划分或在与较高深度的划分相同的划分方向上的三叉树划分可以被设置成为不允许的。Alternatively, for the maximum partition among the partitions generated by ternary-tree based partitioning, binary tree partitioning in the same partition direction as a partition at a higher depth or ternary tree partitioning in the same partition direction as a partition at a higher depth may be set to be disallowed.
替选地,可以通过考虑较高深度的划分的划分形状和相邻的较低深度的划分的划分形状来确定较低深度的划分的划分形状。具体地,如果基于二叉树来对较高深度的划分进行划分,则可以确定较低深度的划分的划分形状,使得不会出现与基于四叉树对较高深度的划分进行划分的结果相同的结果。在示例中,当较高深度的划分的划分形状是2NxN并且相邻的较低深度的划分的划分形状是Nx2N时,当前较低深度的划分的划分形状可以不被设置成为Nx2N。这是因为在当前较低深度的划分的划分形状为Nx2N时,其导致与基于成NxN形状的四叉树对较高深度的划分进行划分的结果相同的结果。当较高深度的划分的划分形状是Nx2N并且相邻的较低深度的划分的划分形状是2NxN时,当前较低深度的划分的划分形状可以不被设置成为2NxN。换言之,当较高深度的划分的二叉树划分形状与相邻的较低深度的划分的二叉树划分形状不同时,当前较低深度的划分的二叉树划分形状可以被设置为与较高深度的划分的二叉树划分形状相同。Alternatively, the partition shape of the partition of the lower depth can be determined by considering the partition shape of the partition of the higher depth and the partition shape of the adjacent partition of the lower depth. Specifically, if the partition of the higher depth is partitioned based on a binary tree, the partition shape of the partition of the lower depth can be determined so that the same result as the result of partitioning the partition of the higher depth based on a quadtree will not occur. In the example, when the partition shape of the partition of the higher depth is 2NxN and the partition shape of the adjacent partition of the lower depth is Nx2N, the partition shape of the current partition of the lower depth may not be set to Nx2N. This is because when the partition shape of the current partition of the lower depth is Nx2N, it leads to the same result as the result of partitioning the partition of the higher depth based on a quadtree of an NxN shape. When the partition shape of the partition of the higher depth is Nx2N and the partition shape of the adjacent partition of the lower depth is 2NxN, the partition shape of the current partition of the lower depth may not be set to 2NxN. In other words, when the binary tree partition shape of a higher depth partition is different from the binary tree partition shape of an adjacent lower depth partition, the binary tree partition shape of the current lower depth partition may be set to be the same as that of the higher depth partition.
替选地,较低深度的划分的二叉树划分形状可以被设置成与较高深度的划分的二叉树划分形状不同。Alternatively, the binary tree division shape of the division at a lower depth may be set to be different from the binary tree division shape of the division at a higher depth.
可以以序列、切片或编码单元为单位来确定允许的二叉树划分形状。在示例中,可以将编码树单元允许的二叉树划分形状限制为2NxN或Nx2N形状。可以在编码器或解码器中预定义允许的划分形状。替选地,关于允许的划分形状或不允许的划分形状的信息可以被编码并且通过比特流用信号发送。The allowed binary tree partition shape can be determined in units of sequence, slice or coding unit. In an example, the binary tree partition shape allowed by the coding tree unit can be limited to 2NxN or Nx2N shape. The allowed partition shape can be predefined in the encoder or decoder. Alternatively, information about the allowed partition shape or the disallowed partition shape can be encoded and sent by signaling through the bitstream.
图7是示出了仅允许特定形状的基于二叉树的划分的示例的图。FIG. 7 is a diagram showing an example of binary tree-based partitioning that allows only specific shapes.
图7(a)表示仅允许基于成Nx2N形状的二叉树的划分的示例,并且图7(b)表示仅允许基于成2NxN形状的二叉树的划分的示例。FIG. 7( a ) shows an example in which only partitioning based on a binary tree in an N×2N shape is allowed, and FIG. 7( b ) shows an example in which only partitioning based on a binary tree in a 2N×N shape is allowed.
为了表示各种划分形状,可以使用关于四叉树划分的信息、关于二叉树划分的信息或关于三叉树划分的信息。关于四叉树划分的信息可以包括指示是否执行基于四叉树的划分的信息或关于允许基于四叉树的划分的编码块的大小/深度的信息中的至少一个。关于二叉树划分的信息可以包括以下中的至少一个:指示是否执行基于二叉树的划分的信息、关于基于二叉树的划分是垂直方向还是水平方向的信息、关于允许基于二叉树的划分的编码块的大小/深度的信息或者关于不允许基于二叉树的划分的编码块的大小/深度的信息。关于三叉树划分的信息可以包括以下中的至少一个:指示是否执行基于三叉树的划分的信息、关于基于三叉树的划分是垂直方向还是水平方向的信息、关于允许基于三叉树的划分的编码块的大小/深度的信息或者关于不允许基于三叉树的划分的编码块的大小/深度的信息。关于编码块的大小的信息可以表示编码块的宽度、高度、宽度和高度的乘积或宽度与高度的比中的至少一个最小值或最大值。In order to represent various partition shapes, information about quadtree partition, information about binary tree partition, or information about ternary tree partition may be used. The information about quadtree partition may include at least one of information indicating whether quadtree-based partition is performed or information about the size/depth of the coding block that allows quadtree-based partition. The information about binary tree partition may include at least one of the following: information indicating whether binary tree-based partition is performed, information about whether binary tree-based partition is vertical or horizontal, information about the size/depth of the coding block that allows binary tree-based partition, or information about the size/depth of the coding block that does not allow binary tree-based partition. The information about ternary tree partition may include at least one of the following: information indicating whether ternary tree-based partition is performed, information about whether ternary tree-based partition is vertical or horizontal, information about the size/depth of the coding block that allows ternary tree-based partition, or information about the size/depth of the coding block that does not allow ternary tree-based partition. The information about the size of the coding block may represent at least one minimum or maximum value of the width, height, product of width and height, or ratio of width to height of the coding block.
在示例中,当编码块的宽度或高度小于允许二叉树划分的最小大小时,或者当编码块的划分深度大于允许二叉树划分的最大深度时,对于该编码块,可以不允许基于二叉树的划分。In an example, when the width or height of a coding block is smaller than the minimum size of allowed binary tree partitioning, or when the partition depth of the coding block is greater than the maximum depth of allowed binary tree partitioning, binary tree-based partitioning may not be allowed for the coding block.
在示例中,当编码块的宽度或高度小于允许三叉树划分的最小大小时,或者当编码块的划分深度大于允许三叉树划分的最大深度时,对于该编码块,可以不允许基于三叉树的划分。In an example, when the width or height of a coding block is smaller than the minimum size allowed for ternary tree partitioning, or when the partition depth of the coding block is greater than the maximum depth allowed for ternary tree partitioning, ternary tree-based partitioning may not be allowed for the coding block.
可以通过比特流用信号发送关于允许基于二叉树或基于三叉树的划分的条件的信息。可以以序列、图片或部分图像为单位对信息进行编码。部分图像可以意指切片、图块(tile)组、图块、区块(brick)、编码块、预测块或变换块中的至少一个。Information about the conditions for allowing binary tree-based or ternary tree-based partitioning may be signaled through a bitstream. The information may be encoded in units of a sequence, a picture, or a partial image. A partial image may mean at least one of a slice, a tile group, a tile, a brick, a coding block, a prediction block, or a transform block.
在示例中,可以通过比特流来对语法‘max_mtt_depth_idx_minus1’进行编码/解码,该语法‘max_mtt_depth_idx_minus1’表示允许二叉树/三叉树划分的最大深度。在这种情况下,max_mtt_depth_idx_minus1+1可以指示允许二叉树/三叉树划分的最大深度。In an example, the syntax 'max_mtt_depth_idx_minus1' may be encoded/decoded by the bitstream, indicating the maximum depth allowed for binary/ternary tree partitioning. In this case, max_mtt_depth_idx_minus1+1 may indicate the maximum depth allowed for binary/ternary tree partitioning.
在示例中,可以在序列或切片级别用信号发送允许二叉树/三叉树划分的次数、允许二叉树/三叉树划分的最大深度或允许二叉树/三叉树划分的深度的数目中的至少一个。因此,对于第一切片和第二切片,允许二叉树/三叉树划分的次数、允许二叉树/三叉树划分的最大深度或允许二叉树/三叉树划分的深度的数目中的至少一个可以不同。在示例中,虽然对于第一切片,可以仅在一个深度上允许二叉树/三叉树划分,但是对于第二切片,可以在两个深度上允许二叉树/三叉树划分。In an example, at least one of the number of allowed binary/ternary tree partitions, the maximum depth of allowed binary/ternary tree partitions, or the number of depths of allowed binary/ternary tree partitions may be signaled at a sequence or slice level. Thus, at least one of the number of allowed binary/ternary tree partitions, the maximum depth of allowed binary/ternary tree partitions, or the number of depths of allowed binary/ternary tree partitions may be different for a first slice and a second slice. In an example, while for a first slice, binary/ternary tree partitions may be allowed at only one depth, for a second slice, binary/ternary tree partitions may be allowed at two depths.
在图8中所示的示例中,图8示出了对深度为2的编码单元和深度为3的编码单元执行二叉树划分。因此,可以通过比特流对以下中的至少一个进行编码/解码:表示在编码树单元中执行二叉树划分的次数(2次)的信息、表示在编码树单元中通过二叉树划分而生成的划分的最大深度(深度3)的信息或表示在编码树单元中应用二叉树划分的划分深度的数目(2个深度,深度2和深度3)的信息。In the example shown in FIG. 8 , FIG. 8 shows that binary tree partitioning is performed on a coding unit having a depth of 2 and a coding unit having a depth of 3. Therefore, at least one of the following may be encoded/decoded through a bitstream: information indicating the number of times binary tree partitioning is performed in a coding tree unit (2 times), information indicating the maximum depth (depth 3) of partitions generated by binary tree partitioning in a coding tree unit, or information indicating the number of partition depths (2 depths, depth 2 and depth 3) to which binary tree partitioning is applied in a coding tree unit.
替选地,可以在编码器和解码器中预定义允许二叉树/三叉树划分的次数、允许二叉树/三叉树划分的深度或允许二叉树/三叉树划分的深度的数目。替选地,可以基于序列或切片的索引或者编码单元的大小/形状中的至少一个来确定允许二叉树/三叉树划分的次数、允许二叉树/三叉树划分的深度或允许二叉树/三叉树划分的深度的数目。在示例中,对于第一切片,可以在一个深度上允许二叉树/三叉树划分,而对于第二切片,可以在两个深度上允许二叉树/三叉树划分。Alternatively, the number of times binary/ternary tree divisions are allowed, the depth of binary/ternary tree divisions allowed, or the number of depths of binary/ternary tree divisions allowed may be predefined in the encoder and decoder. Alternatively, the number of times binary/ternary tree divisions are allowed, the depth of binary/ternary tree divisions allowed, or the number of depths of binary/ternary tree divisions allowed may be determined based on at least one of the index of the sequence or slice or the size/shape of the coding unit. In the example, for the first slice, binary/ternary tree division may be allowed at one depth, and for the second slice, binary/ternary tree division may be allowed at two depths.
在另一示例中,可以根据切片或图片的时间级别标识符(TemporalID)不同地设置允许二叉树划分的次数、允许二叉树划分的深度或允许二叉树划分的深度的数目中的至少一个。在本文中,时间级别标识符(TemporalID)用于标识图像中的具有至少一个或更多个视角、空间、时间或质量的可缩放性的多个层中的每个层。In another example, at least one of the number of times binary tree partitioning is allowed, the depth of binary tree partitioning is allowed, or the number of depths of binary tree partitioning is allowed can be set differently according to a temporal level identifier (TemporalID) of a slice or picture. In this article, the temporal level identifier (TemporalID) is used to identify each of a plurality of layers of scalability having at least one or more perspective, space, time, or quality in an image.
如图4中所示,可以基于四叉树将划分深度(拆分深度)为k的第一编码块300划分为多个第二编码块。例如,第二编码块310至340可以是宽度和高度相对于第一编码块减半的正方形块,并且第二编码块的划分深度可以增加至k+1。As shown in Figure 4, the first coding block 300 with a division depth (split depth) of k can be divided into a plurality of second coding blocks based on a quadtree. For example, the second coding blocks 310 to 340 may be square blocks with a width and a height halved relative to the first coding block, and the division depth of the second coding block may be increased to k+1.
划分深度为k+1的第二编码块310可以被划分为划分深度为k+2的多个第三编码块。可以通过根据划分方法选择性地使用四叉树或二叉树之一来执行第二编码块310的划分。在这种情况下,可以基于指示基于四叉树的划分的信息或指示基于二叉树的划分的信息中的至少一个来确定划分方法。The second coding block 310 with a division depth of k+1 may be divided into a plurality of third coding blocks with a division depth of k+2. The division of the second coding block 310 may be performed by selectively using one of a quadtree or a binary tree according to a division method. In this case, the division method may be determined based on at least one of information indicating a quadtree-based division or information indicating a binary tree-based division.
当基于四叉树对第二编码块310进行划分时,第二编码块310可以被划分具有第二编码块的一半的宽度和高度的四个第三编码块310a,并且第三编码块310a的划分深度可以增加至k+2。换言之,当基于二叉树对第二编码块310进行划分时,第二编码块310可以被划分为两个第三编码块。在这种情况下,两个第三编码块中的每个可以宽度和高度之一相对于第二编码块减半的非正方形块,并且划分深度可以增加至k+2。可以根据划分方向将第二编码块确定为水平方向或垂直方向上的非方形块,并且可以基于关于是在垂直方向上还是在水平方向上执行基于二叉树的划分的信息来确定划分方向。When the second coding block 310 is divided based on a quadtree, the second coding block 310 may be divided into four third coding blocks 310a having half the width and height of the second coding block, and the division depth of the third coding block 310a may be increased to k+2. In other words, when the second coding block 310 is divided based on a binary tree, the second coding block 310 may be divided into two third coding blocks. In this case, each of the two third coding blocks may be a non-square block with one of the width and height halved relative to the second coding block, and the division depth may be increased to k+2. The second coding block may be determined as a non-square block in the horizontal direction or in the vertical direction according to the division direction, and the division direction may be determined based on information about whether the binary tree-based division is performed in the vertical direction or in the horizontal direction.
同时,第二编码块310可以被确定为不再基于四叉树或二叉树被划分的叶子编码块,并且在这种情况下,相应的编码块可以被用作预测块或变换块。Meanwhile, the second coding block 310 may be determined as a leaf coding block that is no longer divided based on the quadtree or the binary tree, and in this case, the corresponding coding block may be used as a prediction block or a transform block.
类似于第二编码块310的划分,第三编码块310a可以被确定为叶子编码块,或者可以基于四叉树或二叉树被进一步划分。Similar to the division of the second coding block 310, the third coding block 310a may be determined as a leaf coding block, or may be further divided based on a quadtree or a binary tree.
另一方面,基于二叉树被划分的第三编码块310b可以基于二叉树被进一步划分为垂直方向上的编码块310b-2或水平方向上的编码块310b-3,并且相应的编码块的划分深度可以增加至k+3。替选地,第三编码块310b可以被确定为不再基于二叉树被划分的叶子编码块310b-1,并且在这种情况下,相应的编码块310b-1可以被用作预测块或变换块。然而,可以基于以下中的至少一个来限制性地执行以上提及的划分处理:关于允许基于四叉树的划分的编码块的大小/深度的信息、关于允许基于二叉树的划分的编码块的大小/深度的信息或关于不允许基于二叉树的划分的编码块的大小/深度的信息。On the other hand, the third coding block 310b divided based on the binary tree can be further divided into a coding block 310b-2 in the vertical direction or a coding block 310b-3 in the horizontal direction based on the binary tree, and the division depth of the corresponding coding block can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer divided based on the binary tree, and in this case, the corresponding coding block 310b-1 can be used as a prediction block or a transform block. However, the above-mentioned division process can be restrictively performed based on at least one of the following: information about the size/depth of the coding block that allows quadtree-based division, information about the size/depth of the coding block that allows binary tree-based division, or information about the size/depth of the coding block that does not allow binary tree-based division.
表示编码块的大小的候选的数目可以被限制为预定数目,或者预定单元中的编码块的大小可以具有固定值。在示例中,序列中或图片中的编码块的大小可以被限制为具有256x256、128x128或32x32中的任意一个。可以以序列头或图片头用信号发送表示序列中或图片中的编码块的大小的信息。The number of candidates representing the size of the coding block may be limited to a predetermined number, or the size of the coding block in a predetermined unit may have a fixed value. In an example, the size of the coding block in a sequence or in a picture may be limited to any one of 256x256, 128x128, or 32x32. Information representing the size of the coding block in the sequence or in the picture may be signaled in a sequence header or a picture header.
作为基于四叉树和二叉树划分的结果,编码单元可以被表示为任意大小的正方形或矩形形状。As a result of quadtree and binary tree based partitioning, the coding unit can be represented as a square or rectangular shape of any size.
如图4中所示,可以基于四叉树将划分深度(拆分深度)为k的第一编码块300划分为多个第二编码块。例如,第二编码块310至340可以是具有第一编码块的一半的宽度和高度的正方形块,并且第二编码块的划分深度可以增加至k+1。As shown in Figure 4, the first coding block 300 with a division depth (split depth) of k can be divided into a plurality of second coding blocks based on a quadtree. For example, the second coding blocks 310 to 340 may be square blocks having a width and height half of the first coding block, and the division depth of the second coding block may be increased to k+1.
划分深度为k+1的第二编码块310可以被划分为划分深度为k+2的多个第三编码块。可以通过根据划分方法选择性地使用四叉树或二叉树之一来执行第二编码块310的划分。在这种情况下,可以基于指示基于四叉树的划分的信息或指示基于二叉树的划分的信息中的至少一个来确定划分方法。The second coding block 310 with a division depth of k+1 may be divided into a plurality of third coding blocks with a division depth of k+2. The division of the second coding block 310 may be performed by selectively using one of a quadtree or a binary tree according to a division method. In this case, the division method may be determined based on at least one of information indicating a quadtree-based division or information indicating a binary tree-based division.
当基于四叉树对第二编码块310进行划分时,第二编码块310可以被划分为宽度和高度相对于第二编码块减半的四个第三编码块310a,并且第三编码块310a的划分深度可以增加至k+2。换言之,当基于二叉树对第二编码块310进行划分时,第二编码块310可以被划分为两个第三编码块。在这种情况下,两个第三编码块中的每个可以是宽度和高度之一相对于第二编码块减半的非正方形块,并且划分深度可以增加至k+2。可以根据划分方向将第二编码块确定为水平方向或垂直方向上的非方形块,并且可以基于关于是在垂直方向上还是在水平方向上执行基于二叉树的划分的信息来确定划分方向。When the second coding block 310 is divided based on a quadtree, the second coding block 310 may be divided into four third coding blocks 310a whose width and height are halved relative to the second coding block, and the division depth of the third coding block 310a may be increased to k+2. In other words, when the second coding block 310 is divided based on a binary tree, the second coding block 310 may be divided into two third coding blocks. In this case, each of the two third coding blocks may be a non-square block whose width and height are halved relative to the second coding block, and the division depth may be increased to k+2. The second coding block may be determined as a non-square block in the horizontal direction or in the vertical direction according to the division direction, and the division direction may be determined based on information about whether the binary tree-based division is performed in the vertical direction or in the horizontal direction.
同时,第二编码块310可以被确定为不再基于四叉树或二叉树被划分的叶子编码块,并且在这种情况下,相应的编码块可以被用作预测块或变换块。Meanwhile, the second coding block 310 may be determined as a leaf coding block that is no longer divided based on the quadtree or the binary tree, and in this case, the corresponding coding block may be used as a prediction block or a transform block.
类似于第二编码块310的划分,第三编码块310a可以被确定为叶子编码块,或者可以基于四叉树或二叉树被进一步划分。Similar to the division of the second coding block 310, the third coding block 310a may be determined as a leaf coding block, or may be further divided based on a quadtree or a binary tree.
另一方面,基于二叉树被划分的第三编码块310b可以基于二叉树被进一步划分为垂直方向上的编码块310b-2或水平方向上的编码块310b-3,并且相应的编码块的划分深度可以增加至k+3。替选地,第三编码块310b可以被确定为不再基于二叉树被划分的叶子编码块310b-1,并且在这种情况下,相应的编码块310b-1可以被用作预测块或变换块。然而,可以基于以下中的至少一个来限制性地执行以上提及的划分处理:关于允许基于四叉树的划分的编码块的大小/深度的信息、关于允许基于二叉树的划分的编码块的大小/深度的信息或关于不允许基于二叉树的划分的编码块的大小/深度的信息。On the other hand, the third coding block 310b divided based on the binary tree can be further divided into a coding block 310b-2 in the vertical direction or a coding block 310b-3 in the horizontal direction based on the binary tree, and the division depth of the corresponding coding block can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer divided based on the binary tree, and in this case, the corresponding coding block 310b-1 can be used as a prediction block or a transform block. However, the above-mentioned division process can be restrictively performed based on at least one of the following: information about the size/depth of the coding block that allows quadtree-based division, information about the size/depth of the coding block that allows binary tree-based division, or information about the size/depth of the coding block that does not allow binary tree-based division.
表示编码块的大小的候选的数目可以被限制为预定数目,或者预定单元中的编码块的大小可以具有固定值。在示例中,序列中或图片中的编码块的大小可以被限制为具有256x256、128x128或32x32中的任意一个。可以以序列头或图片头用信号发送表示序列中或图片中的编码块的大小的信息。The number of candidates representing the size of the coding block may be limited to a predetermined number, or the size of the coding block in a predetermined unit may have a fixed value. In an example, the size of the coding block in a sequence or in a picture may be limited to any one of 256x256, 128x128, or 32x32. Information representing the size of the coding block in the sequence or in the picture may be signaled in a sequence header or a picture header.
作为基于四叉树和二叉树划分的结果,编码单元可以被表示为任意大小的正方形或矩形形状。As a result of quadtree and binary tree based partitioning, the coding unit can be represented as a square or rectangular shape of any size.
可以将变换跳过设置成不用于通过基于二叉树的划分或基于三叉树的划分生成的编码单元。替选地,可以将变换跳过设置成应用于非正方形编码单元中的垂直方向或水平方向中的至少一个。在示例中,当将变换跳过应用于水平方向时,其表示仅在水平方向上执行缩放而没有执行变换/逆变换,并且在垂直方向上执行使用DCT或DST的变换/逆变换。当将变换跳过应用于垂直方向时,其表示仅在垂直方向上执行缩放而没有执行变换/逆变换,并且在水平方向上执行使用DCT或DST的变换/逆变换。The transform skip may be set not to be used for a coding unit generated by binary tree-based partitioning or ternary tree-based partitioning. Alternatively, the transform skip may be set to be applied to at least one of a vertical direction or a horizontal direction in a non-square coding unit. In the example, when the transform skip is applied to the horizontal direction, it means that scaling is performed only in the horizontal direction without performing transform/inverse transform, and transform/inverse transform using DCT or DST is performed in the vertical direction. When the transform skip is applied to the vertical direction, it means that scaling is performed only in the vertical direction without performing transform/inverse transform, and transform/inverse transform using DCT or DST is performed in the horizontal direction.
可以通过比特流用信号发送关于是否跳过水平方向的逆变换的信息或关于是否跳过垂直方向的逆变换的信息。在示例中,关于是否跳过水平方向的逆变换的信息可以是1比特标志‘hor_transform_skip_flag’,并且关于是否跳过垂直方向的逆变换的信息可以是1比特标志‘ver_transform_skip_flag’。Information about whether to skip the inverse transform in the horizontal direction or information about whether to skip the inverse transform in the vertical direction may be transmitted by a bitstream signal. In an example, the information about whether to skip the inverse transform in the horizontal direction may be a 1-bit flag 'hor_transform_skip_flag', and the information about whether to skip the inverse transform in the vertical direction may be a 1-bit flag 'ver_transform_skip_flag'.
编码器可以根据当前块的大小和/或形状确定是否对‘hor_transform_skip_flag’或‘ver_transform_skip_flag’进行编码。在示例中,在当前块具有Nx2N形状时,hor_transform_skip_flag可以被编码并且ver_transform_skip_flag的编码可以被省略。在当前块具有2NxN形状时,ver_transform_skip_flag可以被编码,并且可以省略hor_transform_skip_flag。The encoder may determine whether to encode 'hor_transform_skip_flag' or 'ver_transform_skip_flag' according to the size and/or shape of the current block. In an example, when the current block has an Nx2N shape, hor_transform_skip_flag may be encoded and the encoding of ver_transform_skip_flag may be omitted. When the current block has a 2NxN shape, ver_transform_skip_flag may be encoded and hor_transform_skip_flag may be omitted.
替选地,基于当前块的大小和/或形状,可以确定是否执行水平方向的变换跳过或是否执行垂直方向的变换跳过。在示例中,在当前块具有Nx2N形状时,可以将变换跳过应用于水平方向,并且可以对垂直方向执行变换/逆变换。在当前块具有2NxN形状时,可以将变换跳过应用于垂直方向,并且可以对水平方向执行变换/逆变换。可以基于DCT或DST中的至少一个来执行变换/逆变换。Alternatively, based on the size and/or shape of the current block, it may be determined whether to perform transform skipping in the horizontal direction or whether to perform transform skipping in the vertical direction. In an example, when the current block has an Nx2N shape, transform skipping may be applied to the horizontal direction, and transform/inverse transform may be performed in the vertical direction. When the current block has a 2NxN shape, transform skipping may be applied to the vertical direction, and transform/inverse transform may be performed in the horizontal direction. Transform/inverse transform may be performed based on at least one of DCT or DST.
作为基于四叉树、二叉树或三叉树划分的结果,可以将不再被划分的编码块用作预测块或变换块。换言之,通过四叉树划分或二叉树划分生成的编码块可以用作预测块或变换块。在示例中,可以以编码块为单位生成预测图像,并且可以以编码块为单位对残差信号、原始图像与预测图像之间的差进行变换。为了以编码块为单位生成预测图像,可以基于编码块确定运动信息,或者可以基于编码块确定帧内预测模式。因此,可以通过使用跳过模式、帧内预测或帧间预测中的至少一个来对编码块进行编码。As a result of partitioning based on a quadtree, a binary tree, or a ternary tree, a coding block that is no longer divided can be used as a prediction block or a transform block. In other words, a coding block generated by quadtree partitioning or binary tree partitioning can be used as a prediction block or a transform block. In the example, a predicted image can be generated in units of coding blocks, and the difference between the residual signal, the original image, and the predicted image can be transformed in units of coding blocks. In order to generate a predicted image in units of coding blocks, motion information can be determined based on the coding blocks, or an intra-frame prediction mode can be determined based on the coding blocks. Therefore, the coding block can be encoded by using at least one of a skip mode, an intra-frame prediction, or an inter-frame prediction.
替选地,可以将通过对编码块进行划分而生成的多个编码块设置成共享运动信息、合并候选、参考样本、参考样本行或帧内预测模式中的至少一个。在示例中,当通过三叉树对编码块进行划分时,通过对编码块进行划分而生成的划分可以根据编码块的大小或形状共享运动信息、合并候选、参考样本、参考样本行或帧内预测模式中的至少一个。替选地,可以将多个编码块中的仅一部分设置成共享信息,并且可以将其余的编码块设置成不共享信息。Alternatively, multiple coding blocks generated by dividing the coding block may be set to share at least one of motion information, merge candidates, reference samples, reference sample rows, or intra-frame prediction modes. In an example, when the coding block is divided by a ternary tree, the divisions generated by dividing the coding block may share at least one of motion information, merge candidates, reference samples, reference sample rows, or intra-frame prediction modes according to the size or shape of the coding block. Alternatively, only a portion of the multiple coding blocks may be set to share information, and the remaining coding blocks may be set not to share information.
在另一示例中,可以通过对编码块进行划分使用小于编码块的预测块或变换块。In another example, a prediction block or a transform block smaller than the coding block may be used by partitioning the coding block.
在下文中,将详细地描述对编码块或通过划分编码块而生成的预测块执行帧间预测的方法。Hereinafter, a method of performing inter prediction on a coding block or a prediction block generated by splitting the coding block will be described in detail.
图9是示出作为应用了本发明的实施方式的帧间预测方法的流程图。FIG. 9 is a flowchart showing an inter-frame prediction method as an embodiment to which the present invention is applied.
参照图9,可以确定当前块的运动信息S910。当前块的运动信息可以包括当前块的运动向量、当前块的参考图片索引、当前块的帧间预测方向或加权预测的权重中的至少一个。加权预测的权重可以表示施加至L0参考块的权重和施加至L1参考块的权重。9, the motion information of the current block may be determined S910. The motion information of the current block may include at least one of a motion vector of the current block, a reference picture index of the current block, an inter-prediction direction of the current block, or a weight of weighted prediction. The weight of weighted prediction may represent a weight applied to the L0 reference block and a weight applied to the L1 reference block.
可以基于通过比特流用信号发送的信息来确定当前块的运动向量。运动向量的精度表示用于表达当前块的运动向量的基本单位。例如,当前块的运动向量的精度可以被确定为整数像素、1/2像素、1/4像素或1/8像素之一。可以以每个图片为基础、以每个切片为基础、以每个图块组为基础、以每个图块为基础或以每个块为基础来确定运动向量的精度。块可以表示编码树单元、编码单元、预测单元或变换单元。The motion vector of the current block may be determined based on information signaled by the bitstream. The precision of the motion vector represents the basic unit used to express the motion vector of the current block. For example, the precision of the motion vector of the current block may be determined as one of integer pixels, 1/2 pixels, 1/4 pixels, or 1/8 pixels. The precision of the motion vector may be determined on a per-picture basis, on a per-slice basis, on a per-tile group basis, on a per-tile basis, or on a per-block basis. A block may represent a coding tree unit, a coding unit, a prediction unit, or a transform unit.
可以基于通过比特流用信号发送的信息或与当前块相邻的相邻块的运动信息中的至少一个来获得当前块的运动信息。The motion information of the current block may be obtained based on at least one of information signaled through a bitstream or motion information of a neighboring block adjacent to the current block.
图10是示出了当合并模式被应用于当前块时导出当前块的运动信息的过程的图。FIG. 10 is a diagram illustrating a process of deriving motion information of a current block when a merge mode is applied to the current block.
合并模式表示根据相邻块导出当前块的运动信息的方法。The merge mode indicates a method of deriving motion information of a current block from neighboring blocks.
当合并模式被应用于当前块时,可以根据当前块的空间相邻块导出空间合并候选S1010。空间相邻块可以包括与当前块的上侧边界、左侧边界或者角(例如,左上角、右上角或左下角中的至少一个)邻近的块中的至少一个。When the merge mode is applied to the current block, a spatial merge candidate may be derived according to the spatial neighboring blocks of the current block S1010. The spatial neighboring blocks may include at least one of the blocks adjacent to the upper boundary, left boundary, or corner (e.g., at least one of the upper left corner, upper right corner, or lower left corner) of the current block.
图11是示出了空间相邻块的示例的图。FIG. 11 is a diagram showing an example of spatially adjacent blocks.
作为图11中所示的示例,空间相邻块可以包括以下中的至少一个:与当前块的左侧邻近的相邻块A1、与当前块的上侧邻近的相邻块B1、与当前块的左下角邻近的相邻块A0、与当前块的右上角邻近的相邻块B0和与当前块的左上角邻近的相邻块B2。例如,假设当前块的左上角样本的位置是(0,0),当前块的宽度是W,并且当前块的高度是H。块A1可以包括在位置(-1,H-1)处的样本。块B1可以包括在位置(W-1,-1)处的样本。块A0可以包括在位置(-1,H)处的样本。块B0可以包括在位置(W,-1)处的样本。块B2可以包括在位置(-1,-1)处的样本。As an example shown in FIG. 11, the spatial neighboring blocks may include at least one of the following: a neighboring block A1 adjacent to the left side of the current block, a neighboring block B1 adjacent to the upper side of the current block, a neighboring block A0 adjacent to the lower left corner of the current block, a neighboring block B0 adjacent to the upper right corner of the current block, and a neighboring block B2 adjacent to the upper left corner of the current block. For example, assuming that the position of the upper left corner sample of the current block is (0, 0), the width of the current block is W, and the height of the current block is H. Block A1 may include a sample at a position (-1, H-1). Block B1 may include a sample at a position (W-1, -1). Block A0 may include a sample at a position (-1, H). Block B0 may include a sample at a position (W, -1). Block B2 may include a sample at a position (-1, -1).
进一步扩展图11的示例,空间合并候选可以根据与当前块的左上样本邻近的块或与当前块的上侧中心样本邻近的块导出。例如,与当前块的左上样本相邻的块可以包含包括在位置(0,-1)处的样本的块或包括在位置(-1,0)处的样本的块中的至少一个。或者,可以根据与当前块的上侧中心样本相邻的块或与当前块的左侧中心样本相邻的块中的至少一个导出空间合并候选。例如,与当前块的上侧中心样本相邻的块可以包括在位置(W/2,-1)处的样本。与当前块的左侧中心样本相邻的块可以包括在位置(-1,H/2)处的样本。Further extending the example of FIG. 11 , the spatial merge candidate may be derived based on a block adjacent to the upper left sample of the current block or a block adjacent to the upper center sample of the current block. For example, the block adjacent to the upper left sample of the current block may include at least one of a block including a sample at position (0, -1) or a block including a sample at position (-1, 0). Alternatively, the spatial merge candidate may be derived based on at least one of a block adjacent to the upper center sample of the current block or a block adjacent to the left center sample of the current block. For example, a block adjacent to the upper center sample of the current block may include a sample at position (W/2, -1). A block adjacent to the left center sample of the current block may include a sample at position (-1, H/2).
基于当前块的大小和/或形状,可以确定用于导出空间合并候选的上侧相邻块和/或左侧相邻块的位置。在示例中,在当前块的大小大于阈值时,可以根据与当前块的上侧中心样本相邻的块和与当前块的左侧中心样本相邻的块导出空间合并候选。另一方面,在当前块的大小小于阈值时,可以根据与当前块的右上样本相邻的块和与当前块的左下样本相邻的块导出空间合并候选。在本文中,可以基于宽度、高度、宽度与高度的和、宽度与高度的积或宽度与高度的比中的至少一个来表达当前块的大小。阈值可以是整数,例如2、4、8、16、32或128。Based on the size and/or shape of the current block, the position of the upper adjacent block and/or the left adjacent block for deriving the spatial merge candidate can be determined. In the example, when the size of the current block is greater than a threshold, the spatial merge candidate can be derived based on the block adjacent to the upper center sample of the current block and the block adjacent to the left center sample of the current block. On the other hand, when the size of the current block is less than the threshold, the spatial merge candidate can be derived based on the block adjacent to the upper right sample of the current block and the block adjacent to the lower left sample of the current block. In this article, the size of the current block can be expressed based on at least one of the width, height, the sum of the width and the height, the product of the width and the height, or the ratio of the width to the height. The threshold can be an integer, such as 2, 4, 8, 16, 32, or 128.
根据当前块的形状,可以确定扩展的空间相邻块的可用性。在示例中,在当前块是宽度大于高度的非正方形块时,可以确定与当前块的左上样本邻近的块、与左侧中心样本邻近的块或与当前块的左下样本邻近的块不可用。同时,在当前块是高度大于宽度的块时,可以确定与当前块的左上样本邻近的块、与上侧中心样本邻近的块或与当前块的右上样本邻近的块不可用。According to the shape of the current block, the availability of the extended spatial neighboring blocks can be determined. In the example, when the current block is a non-square block with a width greater than a height, it can be determined that the block adjacent to the upper left sample of the current block, the block adjacent to the left center sample, or the block adjacent to the lower left sample of the current block is unavailable. At the same time, when the current block is a block with a height greater than a width, it can be determined that the block adjacent to the upper left sample of the current block, the block adjacent to the upper center sample, or the block adjacent to the upper right sample of the current block is unavailable.
可以将空间合并候选的运动信息设置成与空间相邻块的运动信息相同。The motion information of the spatial merging candidate may be set to be the same as the motion information of the spatial neighboring blocks.
可以通过以预定顺序搜索相邻块来确定空间合并候选。在示例中,在图11中所示的示例中,可以以块A1、B1、B0、A0和B2的顺序执行搜索以用于确定空间合并候选。在本文中,当不存在其余块(即,A1、B1、B0和A0)中的至少一个或者通过帧内预测模式对至少一个进行编码时,可以使用块B2。The spatial merging candidate may be determined by searching the adjacent blocks in a predetermined order. In an example, in the example shown in FIG. 11 , the search may be performed in the order of blocks A 1 , B 1 , B 0 , A 0 , and B 2 for determining the spatial merging candidate. Herein, when at least one of the remaining blocks (i.e., A 1 , B 1 , B 0 , and A 0 ) does not exist or at least one is encoded by an intra prediction mode, block B 2 may be used.
可以在编码器/解码器中预定义用于空间合并候选的搜索的顺序。替选地,可以根据当前块的大小或形状来自适应地确定搜索空间合并候选的顺序。替选地,可以基于通过比特流用信号发送的信息来确定搜索空间合并候选的顺序。The order of searching for spatial merging candidates may be predefined in the encoder/decoder. Alternatively, the order of searching for spatial merging candidates may be adaptively determined according to the size or shape of the current block. Alternatively, the order of searching for spatial merging candidates may be determined based on information signaled through the bitstream.
可以根据当前块的时间相邻块导出时间合并候选S1020。时间相邻块可以意指在同位图片中包括的同位块。同位图片具有与包括当前块的当前图片不同的POC。同位图片可以被确定为参考图片列表中具有预定义索引的图片或者与当前图片的POC差最小的图片。替选地,可以由通过比特流用信号发送的信息来确定同位图片。通过比特流用信号发送的信息可以包括以下中的至少一个:指示包括同位图片的参考图片列表(例如,L0参考图片列表或L1参考图片列表)的信息和指示在该参考图片列表内的同位图片的索引。可以在图片参数集、片头和块级别中的至少一个中用信号发送用于确定同位图片的信息。A temporal merge candidate may be derived from the temporal neighboring blocks of the current block S1020. The temporal neighboring blocks may refer to the co-located blocks included in the co-located picture. The co-located picture has a different POC from the current picture including the current block. The co-located picture may be determined as a picture with a predefined index in a reference picture list or a picture with the smallest POC difference from the current picture. Alternatively, the co-located picture may be determined by information signaled by a bitstream. The information signaled by the bitstream may include at least one of: information indicating a reference picture list (e.g., an L0 reference picture list or an L1 reference picture list) including the co-located picture and an index indicating the co-located picture in the reference picture list. Information for determining the co-located picture may be signaled in at least one of a picture parameter set, a slice header, and a block level.
可以基于同位块的运动信息来确定关于时间合并候选的运动信息。在示例中,可以基于同位块的运动向量来确定时间合并候选的运动向量。例如,时间合并候选的运动向量可以被设置成与同位块的运动向量相同。替选地,可以通过基于在当前块的当前图片与参考图片之间的POC差和在同位的同位图片与参考图片之间的POC差中的至少一个缩放同位块的运动向量来导出时间合并候选的运动向量。The motion information about the temporal merge candidate may be determined based on the motion information of the co-located block. In an example, the motion vector of the temporal merge candidate may be determined based on the motion vector of the co-located block. For example, the motion vector of the temporal merge candidate may be set to be the same as the motion vector of the co-located block. Alternatively, the motion vector of the temporal merge candidate may be derived by scaling the motion vector of the co-located block based on at least one of the POC difference between the current picture of the current block and the reference picture and the POC difference between the co-located co-located picture and the reference picture.
图12是示出了导出时间合并候选的运动向量的示例的图。FIG. 12 is a diagram showing an example of deriving a motion vector of a temporal merging candidate.
在图12中所示的示例中,tb表示当前图片curr_pic与当前图片的参考图片curr_ref之间的POC差,并且td表示同位块的同位图片col_pic与参考图片col_ref之间的POC差。可以通过基于tb和/或td缩放同位块col_PU的运动向量来导出时间合并候选的运动向量。In the example shown in Figure 12, tb represents the POC difference between the current picture curr_pic and the reference picture curr_ref of the current picture, and td represents the POC difference between the co-located picture col_pic and the reference picture col_ref of the co-located block. The motion vector of the temporal merge candidate can be derived by scaling the motion vector of the co-located block col_PU based on tb and/or td.
替选地,考虑到同位块是否可用,该同位块的运动向量和通过缩放同位块的运动向量获得的运动向量可以用作时间合并候选的运动向量。在示例中,同位块的运动向量被设置为第一时间合并候选的运动向量,并且通过缩放同位块的运动向量获得的值可以被设置为第二时间合并候选的运动向量。Alternatively, considering whether the co-located block is available, the motion vector of the co-located block and the motion vector obtained by scaling the motion vector of the co-located block can be used as the motion vector of the temporal merge candidate. In an example, the motion vector of the co-located block is set as the motion vector of the first temporal merge candidate, and the value obtained by scaling the motion vector of the co-located block can be set as the motion vector of the second temporal merge candidate.
时间合并候选的帧间预测方向可以被设置成与时间相邻块的帧间预测方向相同。然而,时间合并候选的参考图片索引可以具有固定值。在示例中,时间合并候选的参考图片索引可以被设置为“0”。替选地,可以基于空间合并候选的参考图片索引、当前图片的参考图片索引中的至少一个来自适应地确定时间合并候选的参考图片索引。The inter-frame prediction direction of the temporal merge candidate may be set to be the same as the inter-frame prediction direction of the temporal neighboring block. However, the reference picture index of the temporal merge candidate may have a fixed value. In the example, the reference picture index of the temporal merge candidate may be set to "0". Alternatively, the reference picture index of the temporal merge candidate may be adaptively determined based on at least one of the reference picture index of the spatial merge candidate and the reference picture index of the current picture.
可以将同位图片内的与当前块具有相同位置和大小的特定块,或者和与具有与当前块相同位置和大小的块邻近的块邻近的块确定为同位块。A specific block having the same position and size as the current block within the co-located picture, or a block adjacent to a block adjacent to a block having the same position and size as the current block may be determined as the co-located block.
图13是示出了可以用作同位块的候选块的位置的图。FIG. 13 is a diagram showing positions of candidate blocks that can be used as co-located blocks.
候选块可以包括以下中的至少一个:同位图片内的与当前块的左上角的位置邻近的块、同位图片内的与当前块的中心样本的位置邻近的块和同位图片内的与当前块的左下角的位置邻近的块。The candidate blocks may include at least one of: a block adjacent to the upper left corner of the current block in the same picture, a block adjacent to the center sample of the current block in the same picture, and a block adjacent to the lower left corner of the current block in the same picture.
在示例中,候选块可以包括以下中的至少一个:同位图片内的包括当前块的左上样本的位置的块TL、同位图片内的包括当前块的右下样本的位置的块BR、同位图片内的与当前块的右下角邻近的块H、同位图片内的包括当前块的中心样本的位置的块C3以及同位图片内的与当前块的中心样本邻近的块C0(例如,包括与当前块的中心样本相隔(-1,-1)的样本的位置的块)。In an example, the candidate blocks may include at least one of: a block TL within the co-located picture including the position of the upper left sample of the current block, a block BR within the co-located picture including the position of the lower right sample of the current block, a block H within the co-located picture adjacent to the lower right corner of the current block, a block C3 within the co-located picture including the position of the center sample of the current block, and a block C0 within the co-located picture adjacent to the center sample of the current block (e.g., a block including the position of a sample separated from the center sample of the current block by (-1, -1)).
除了图13中所示的示例之外,可以选择同位图片内的包括与当前块的预定边界邻近的相邻块的位置的块作为同位块。In addition to the example shown in FIG. 13 , a block within the co-located picture including a position of a neighboring block adjacent to a predetermined boundary of the current block may be selected as the co-located block.
时间合并候选的数目可以是1或更多。在示例中,可以基于至少一个同位块来导出至少一个时间合并候选。The number of temporal merging candidates may be 1 or more. In an example, at least one temporal merging candidate may be derived based on at least one co-located block.
关于时间合并候选的最大数目的信息可以通过编码器编码并用信号发送。替选地,可以基于可能包括在合并候选列表中的合并候选的最大数目和/或空间合并候选的最大数目来导出时间合并候选的最大数目。替选地,可以基于可用的同位块的数目来确定时间合并候选的最大数目。Information about the maximum number of temporal merge candidates may be encoded by an encoder and sent by a signal. Alternatively, the maximum number of temporal merge candidates may be derived based on the maximum number of merge candidates that may be included in the merge candidate list and/or the maximum number of spatial merge candidates. Alternatively, the maximum number of temporal merge candidates may be determined based on the number of available co-located blocks.
可以根据预定的优先级确定候选块是否可用,并且可以基于上述确定和时间合并候选的最大数目来确定至少一个同位块。在示例中,当包括当前块的中心样本的位置的块C3和与当前块的右下角邻近的块H为候选块时,块C3和块H中的任意一个可以被确定为同位块。当块H可用时,可以将块H确定为同位块。然而,当块H不可用时(例如,当通过帧内预测对块H进行编码时、当块H不可用时或者当块H位于最大编码单元(LCU)之外时等),可以将块C3确定为同位块。Whether the candidate block is available can be determined according to a predetermined priority, and at least one co-located block can be determined based on the above determination and the maximum number of candidates for temporal merging. In the example, when block C3 including the position of the center sample of the current block and block H adjacent to the lower right corner of the current block are candidate blocks, any one of block C3 and block H can be determined as a co-located block. When block H is available, block H can be determined as a co-located block. However, when block H is not available (for example, when block H is encoded by intra-frame prediction, when block H is not available, or when block H is located outside the maximum coding unit (LCU), etc.), block C3 can be determined as a co-located block.
在另一示例中,当在同位图片内的与当前块的右下角位置邻近的多个块中的至少一个不可用(例如,块H和/或块BR)时,该不可用块可以用另一个可用块替换。替换不可用块的另一可用块可以包括同位图片内的与当前块的中心样本位置邻近的至少一个块(例如,C0和/或C3)以及同位图片内的与当前块的左下角邻近的块(例如,TL)。In another example, when at least one of the plurality of blocks adjacent to the lower right corner position of the current block in the co-located picture is unavailable (e.g., block H and/or block BR), the unavailable block may be replaced with another available block. The other available block replacing the unavailable block may include at least one block adjacent to the center sample position of the current block in the co-located picture (e.g., C0 and/or C3) and a block adjacent to the lower left corner of the current block in the co-located picture (e.g., TL).
当同位图片内的与当前块的中心样本位置邻近的多个块中的至少一个不可用时,或者当同位图片内的与当前块的左上角位置邻近的多个块中的至少一个不可用时,可以用另一个可用块替换该不可用块。When at least one of the multiple blocks adjacent to the center sample position of the current block in the same picture is unavailable, or when at least one of the multiple blocks adjacent to the upper left corner position of the current block in the same picture is unavailable, the unavailable block can be replaced by another available block.
随后,可以生成包括空间合并候选和时间合并候选的合并候选列表(S1030)。当配置合并候选列表时,可以从合并候选列表中去除具有与现有合并候选相同的运动信息的合并候选。Subsequently, a merge candidate list including a spatial merge candidate and a temporal merge candidate may be generated (S1030). When configuring the merge candidate list, a merge candidate having the same motion information as an existing merge candidate may be removed from the merge candidate list.
可以通过比特流用信号发送关于合并候选的最大数目的信息。在示例中,可以通过序列参数或图片参数用信号发送指示合并候选的最大数目的信息。在示例中,当合并候选的最大数目是六个时,可以从空间合并候选和时间合并候选中选择总共六个。例如,可以从五个合并候选中选择五个空间合并候选,并且可以从两个时间合并候选中选择一个时间合并候选。Information about the maximum number of merge candidates may be signaled via the bitstream. In an example, information indicating the maximum number of merge candidates may be signaled via a sequence parameter or a picture parameter. In an example, when the maximum number of merge candidates is six, a total of six may be selected from the spatial merge candidates and the temporal merge candidates. For example, five spatial merge candidates may be selected from five merge candidates, and one temporal merge candidate may be selected from two temporal merge candidates.
替选地,可以在编码器和解码器中预定义合并候选的最大数目。例如,合并候选的最大数目可以是2、3、4、5或6。替选地,可以基于是否执行带有MVD的合并(MMVD)、是否执行组合的预测或者是否执行三角划分中的至少一个来确定合并候选的最大数目。Alternatively, the maximum number of merge candidates may be predefined in the encoder and the decoder. For example, the maximum number of merge candidates may be 2, 3, 4, 5, or 6. Alternatively, the maximum number of merge candidates may be determined based on at least one of whether merge with MVD (MMVD) is performed, whether combined prediction is performed, or whether triangulation is performed.
如果包括在合并候选列表中的合并候选的数目小于合并候选的最大数目,则可以将包括在第二合并候选列表中的合并候选添加至该合并候选列表。If the number of merge candidates included in the merge candidate list is less than the maximum number of merge candidates, the merge candidates included in the second merge candidate list may be added to the merge candidate list.
第二合并候选列表可以包括基于在当前块之前的通过帧间预测编码/解码的块的运动信息而导出的合并候选。在示例中,如果执行编码模式为帧间预测的块的运动补偿,则可以将基于该块的运动信息导出的合并候选添加至第二合并候选列表。如果完成了当前块的编码/解码,则可以将当前块的运动信息添加至第二合并候选列表以用于后续块的帧间预测。The second merge candidate list may include merge candidates derived based on motion information of a block encoded/decoded by inter-frame prediction before the current block. In an example, if motion compensation of a block whose coding mode is inter-frame prediction is performed, the merge candidate derived based on the motion information of the block may be added to the second merge candidate list. If encoding/decoding of the current block is completed, the motion information of the current block may be added to the second merge candidate list for inter-frame prediction of subsequent blocks.
可以以CTU、图块或切片为单位来对第二合并候选列表进行初始化。可以在编码器和解码器中预定义可以包括在第二合并候选列表中的合并候选的最大数目。替选地,可以通过比特流用信号发送表示可以包括在第二合并候选列表中的合并候选的最大数目的信息。The second merge candidate list may be initialized in units of CTU, tile, or slice. The maximum number of merge candidates that may be included in the second merge candidate list may be predefined in the encoder and decoder. Alternatively, information indicating the maximum number of merge candidates that may be included in the second merge candidate list may be signaled via a bitstream.
可以基于添加至第二合并候选列表的顺序来确定第二合并候选列表中包括的合并候选的索引。在示例中,分配给添加至第二合并候选列表的第N合并候选的索引可以具有比分配给添加至第二合并候选列表的第N+1合并候选的索引更小的值。例如,第N+1合并候选的索引可以被设置成相对于第N合并候选的索引增加了1的值。替选地,第N合并候选的索引可以被设置成第N+1合并候选的索引,并且第N合并候选的索引的值可以减去1。The indexes of the merge candidates included in the second merge candidate list may be determined based on the order of addition to the second merge candidate list. In an example, the index assigned to the Nth merge candidate added to the second merge candidate list may have a smaller value than the index assigned to the N+1th merge candidate added to the second merge candidate list. For example, the index of the N+1th merge candidate may be set to a value increased by 1 relative to the index of the Nth merge candidate. Alternatively, the index of the Nth merge candidate may be set to the index of the N+1th merge candidate, and the value of the index of the Nth merge candidate may be subtracted by 1.
替选地,分配给添加至第二合并候选列表的第N合并候选的索引可以具有比分配给添加至第二合并候选列表的第N+1合并候选的索引更大的值。例如,第N合并候选的索引可以被设置成第N+1合并候选的索引,并且第N合并候选的索引的值可以增加1。Alternatively, the index assigned to the Nth merge candidate added to the second merge candidate list may have a greater value than the index assigned to the N+1th merge candidate added to the second merge candidate list. For example, the index of the Nth merge candidate may be set to the index of the N+1th merge candidate, and the value of the index of the Nth merge candidate may be increased by 1.
基于执行运动补偿的块的运动信息是否与第二合并候选列表中包括的合并候选的运动信息相同,可以确定是否将根据该块导出的合并候选添加至第二合并候选列表。在示例中,当具有与该块相同的运动信息的合并候选被包括在第二合并候选列表中时,基于该块的运动信息而导出的合并候选可以不被添加至第二合并候选列表。替选地,当具有与该块相同的运动信息的合并候选被包括在第二合并候选列表中时,可以从第二合并候选列表中删除该合并候选,并且可以将基于该块的运动信息导出的合并候选添加至第二合并候选列表。Based on whether the motion information of the block on which motion compensation is performed is the same as the motion information of the merge candidate included in the second merge candidate list, it can be determined whether to add the merge candidate derived from the block to the second merge candidate list. In the example, when a merge candidate having the same motion information as the block is included in the second merge candidate list, the merge candidate derived based on the motion information of the block may not be added to the second merge candidate list. Alternatively, when a merge candidate having the same motion information as the block is included in the second merge candidate list, the merge candidate may be deleted from the second merge candidate list, and the merge candidate derived based on the motion information of the block may be added to the second merge candidate list.
当第二合并候选列表中包括的合并候选的数目与合并候选的最大数目相同时,可以从第二合并候选列表中删除具有最低索引的合并候选或具有最高索引的合并候选,并且可以将基于该块的运动信息导出的合并候选添加至第二合并候选列表。换言之,在删除第二合并候选列表中包括的合并候选之中的最旧的合并候选之后,可以将基于该块的运动信息导出的合并候选添加至第二合并候选列表。When the number of merge candidates included in the second merge candidate list is the same as the maximum number of merge candidates, the merge candidate with the lowest index or the merge candidate with the highest index may be deleted from the second merge candidate list, and the merge candidate derived based on the motion information of the block may be added to the second merge candidate list. In other words, after deleting the oldest merge candidate among the merge candidates included in the second merge candidate list, the merge candidate derived based on the motion information of the block may be added to the second merge candidate list.
当包括在合并候选列表中的合并候选的数目尚未达到合并候选的最大数目时,通过组合两个或更多个合并候选获得的组合的合并候选或者具有(0,0)运动向量(零运动向量)的合并候选可以被包括在合并候选列表中。When the number of merge candidates included in the merge candidate list has not reached the maximum number of merge candidates, a combined merge candidate obtained by combining two or more merge candidates or a merge candidate having a (0, 0) motion vector (zero motion vector) may be included in the merge candidate list.
替选地,可以将找到两个或更多个合并候选的运动向量的平均值的平均合并候选添加至合并候选列表。可以通过找到包括在合并候选列表中的两个或更多个合并候选的运动向量的平均值来导出平均合并候选。在示例中,当第一合并候选和第二合并候选被添加至合并候选列表时,可以计算第一合并候选的运动向量和第二合并候选的运动向量的平均值,以便获得平均合并候选。详细地,可以通过计算第一合并候选的L0运动向量和第二合并候选的L0运动向量的平均值来导出平均合并候选的L0运动向量,并且可以通过计算第一合并候选的L1运动向量和第二合并候选的L1运动向量的平均值来导出平均合并候选的L1运动向量。当对第一合并候选和第二合并候选中的任意一个应用双向预测,并且对另一个合并候选执行单向预测时,可以将双向合并候选的运动向量按原样设置为平均合并候选的L0运动向量或L1运动向量。在示例中,当对第一合并候选执行LO方向预测和L1方向预测,但是对第二合并候选执行LO方向预测时,可以通过计算第一合并候选的L0运动向量和第二合并候选的L0运动向量的平均值来导出平均合并候选的L0运动向量。同时,可以将平均合并候选的L1运动向量导出为第一合并候选的L1运动向量。Alternatively, an average merge candidate in which the average value of the motion vectors of two or more merge candidates is found may be added to the merge candidate list. The average merge candidate may be derived by finding the average value of the motion vectors of two or more merge candidates included in the merge candidate list. In the example, when the first merge candidate and the second merge candidate are added to the merge candidate list, the average value of the motion vector of the first merge candidate and the motion vector of the second merge candidate may be calculated so as to obtain the average merge candidate. In detail, the L0 motion vector of the average merge candidate may be derived by calculating the average value of the L0 motion vector of the first merge candidate and the L0 motion vector of the second merge candidate, and the L1 motion vector of the average merge candidate may be derived by calculating the average value of the L1 motion vector of the first merge candidate and the L1 motion vector of the second merge candidate. When bidirectional prediction is applied to any one of the first merge candidate and the second merge candidate, and unidirectional prediction is performed on the other merge candidate, the motion vector of the bidirectional merge candidate may be set as is to the L0 motion vector or the L1 motion vector of the average merge candidate. In the example, when the L0 direction prediction and the L1 direction prediction are performed on the first merge candidate, but the L0 direction prediction is performed on the second merge candidate, the L0 motion vector of the average merge candidate can be derived by calculating the average of the L0 motion vector of the first merge candidate and the L0 motion vector of the second merge candidate. At the same time, the L1 motion vector of the average merge candidate can be derived as the L1 motion vector of the first merge candidate.
当第一合并候选的参考图片与第二合并候选不同时,可以根据各个合并候选的参考图片与当前图片之间的距离(即,POC差)来缩放第一合并候选或第二合并候选的运动向量。例如,在缩放第二合并候选的运动向量之后,可以通过计算第一合并候选的运动向量和第二合并候选的缩放的运动向量的平均值来导出平均合并候选。在本文中,可以基于每个合并候选的参考图片索引的值、每个合并候选的参考图片与当前块之间的距离、或者是否应用双向预测来设置优先级,并且可以对具有高(或低)优先级的合并候选的运动向量应用缩放。When the reference picture of the first merge candidate is different from the second merge candidate, the motion vector of the first merge candidate or the second merge candidate may be scaled according to the distance between the reference picture of each merge candidate and the current picture (i.e., POC difference). For example, after scaling the motion vector of the second merge candidate, the average merge candidate may be derived by calculating the average of the motion vector of the first merge candidate and the scaled motion vector of the second merge candidate. In this article, priority may be set based on the value of the reference picture index of each merge candidate, the distance between the reference picture of each merge candidate and the current block, or whether bidirectional prediction is applied, and scaling may be applied to the motion vector of a merge candidate with a high (or low) priority.
平均合并候选的参考图片索引可以被设置成指示参考图片列表内的特定位置处的参考图片。在示例中,平均合并候选的参考图片索引可以指示参考图片列表内的第一参考图片或最后参考图片。替选地,平均合并候选的参考图片索引可以被设置成与第一合并候选或第二合并候选的参考图片索引相同。在示例中,当第一合并候选的参考图片索引与第二合并候选相同时,平均合并候选的参考图片索引可以被设置成与第一合并候选和第二合并候选的参考图片索引相同。当第一合并候选的参考图片索引与第二合并候选不同时,可以基于每个合并候选的参考图片索引的值、每个合并候选的参考图片与当前块之间的距离、或者是否应用双向预测来设置优先级,并且可以将具有高(或低)优先级的合并候选的参考图片索引设置为平均合并候选的参考图片索引。在示例中,当双向预测被应用于第一合并候选,并且单向预测被应用于第二合并候选时,可以将应用双向预测的第一合并候选的参考图片索引确定为平均合并候选的参考图片索引。The reference picture index of the average merge candidate may be set to indicate a reference picture at a specific position within the reference picture list. In an example, the reference picture index of the average merge candidate may indicate the first reference picture or the last reference picture within the reference picture list. Alternatively, the reference picture index of the average merge candidate may be set to be the same as the reference picture index of the first merge candidate or the second merge candidate. In an example, when the reference picture index of the first merge candidate is the same as the second merge candidate, the reference picture index of the average merge candidate may be set to be the same as the reference picture index of the first merge candidate and the second merge candidate. When the reference picture index of the first merge candidate is different from the second merge candidate, the priority may be set based on the value of the reference picture index of each merge candidate, the distance between the reference picture of each merge candidate and the current block, or whether bidirectional prediction is applied, and the reference picture index of the merge candidate with high (or low) priority may be set to the reference picture index of the average merge candidate. In an example, when bidirectional prediction is applied to the first merge candidate and unidirectional prediction is applied to the second merge candidate, the reference picture index of the first merge candidate to which bidirectional prediction is applied may be determined as the reference picture index of the average merge candidate.
基于合并候选的组合之间的优先级,可以确定用于生成平均合并候选的组合的序列。可以在编码器和解码器中预定义优先级。替选地,可以基于是否执行合并候选的双向预测来确定组合的序列。例如,使用双向预测编码的合并候选的组合可以被设置成比使用单向预测编码的合并候选的组合具有更高的优先级。替选地,可以基于合并候选的参考图片来确定组合的序列。例如,具有相同参考图片的合并候选的组合可以比具有不同参考图片的合并候选的组合具有更高的优先级。Based on the priority between the combinations of merge candidates, a sequence of combinations for generating average merge candidates can be determined. The priorities can be predefined in the encoder and the decoder. Alternatively, the sequence of combinations can be determined based on whether bidirectional prediction of the merge candidates is performed. For example, a combination of merge candidates encoded using bidirectional prediction can be set to have a higher priority than a combination of merge candidates encoded using unidirectional prediction. Alternatively, the sequence of combinations can be determined based on the reference pictures of the merge candidates. For example, a combination of merge candidates with the same reference picture can have a higher priority than a combination of merge candidates with different reference pictures.
可以根据预定义的优先级将合并候选包括在合并候选列表中。具有高优先级的合并候选可以被分配为具有小的索引值。在示例中,空间合并候选可以先于时间合并候选被添加至合并候选列表。另外,可以按左侧相邻块的空间合并候选,上侧相邻块的空间合并候选、与右上角邻近的块的空间合并候选、与左下角邻近的块的空间合并候选以及与左上角邻近的块的空间合并候选的顺序将空间合并候选添加至合并候选列表。替选地,可以设置成使得根据与当前块的左上角邻近的相邻块(图11的B2)导出的空间合并候选迟于时间合并候选被添加至合并候选列表。The merge candidates may be included in the merge candidate list according to a predefined priority. A merge candidate with a high priority may be assigned a small index value. In the example, the spatial merge candidate may be added to the merge candidate list before the temporal merge candidate. In addition, the spatial merge candidates may be added to the merge candidate list in the order of the spatial merge candidates of the left adjacent block, the spatial merge candidates of the upper adjacent block, the spatial merge candidates of the block adjacent to the upper right corner, the spatial merge candidates of the block adjacent to the lower left corner, and the spatial merge candidates of the block adjacent to the upper left corner. Alternatively, it may be arranged so that the spatial merge candidate derived from the adjacent block adjacent to the upper left corner of the current block (B2 of FIG. 11) is added to the merge candidate list later than the temporal merge candidate.
在另一示例中,可以根据当前块的大小或形状来确定合并候选之间的优先级。在示例中,在当前块具有宽度大于高度的矩形形状时,左侧相邻块的空间合并候选可以先与上侧相邻块的空间合并候选被添加至合并候选列表。换言之,在当前块具有高度大于宽度的矩形形状时,上侧相邻块的空间合并候选可以先于左侧相邻块的空间合并候选被添加至合并候选列表。In another example, the priority between the merge candidates may be determined according to the size or shape of the current block. In the example, when the current block has a rectangular shape with a width greater than a height, the spatial merge candidate of the left neighboring block may be added to the merge candidate list before the spatial merge candidate of the upper neighboring block. In other words, when the current block has a rectangular shape with a height greater than a width, the spatial merge candidate of the upper neighboring block may be added to the merge candidate list before the spatial merge candidate of the left neighboring block.
在另一示例中,可以根据各个合并候选的运动信息来确定合并候选之间的优先级。在示例中,具有双向运动信息的合并候选可以比具有单向运动信息的合并候选具有更高的优先级。因此,具有双向运动信息的合并候选可以先于具有单向运动信息的合并候选被添加至合并候选列表。In another example, the priority between the merge candidates can be determined according to the motion information of each merge candidate. In the example, the merge candidate with bidirectional motion information can have a higher priority than the merge candidate with unidirectional motion information. Therefore, the merge candidate with bidirectional motion information can be added to the merge candidate list before the merge candidate with unidirectional motion information.
在另一示例中,可以根据预定义的优先级生成合并候选列表,并且然后可以对合并候选进行重排。可以基于合并候选的运动信息来执行重排。在示例中,可以基于合并候选是否具有双向运动信息、运动向量的大小、运动向量的精度或者合并候选的参考图片与当前图片之间的POC差来执行重排。详细地,具有双向运动信息的合并候选可以被重排成比具有单向运动信息的合并候选具有更高的优先级。替选地,具有精度值为分数像素的运动向量的合并候选可以重排成比具有精度为整数像素的运动向量的合并候选具有更高的优先级。In another example, a merge candidate list may be generated according to a predefined priority, and then the merge candidates may be rearranged. The rearrangement may be performed based on the motion information of the merge candidate. In the example, the rearrangement may be performed based on whether the merge candidate has bidirectional motion information, the size of the motion vector, the precision of the motion vector, or the POC difference between the reference picture of the merge candidate and the current picture. In detail, a merge candidate with bidirectional motion information may be rearranged to have a higher priority than a merge candidate with unidirectional motion information. Alternatively, a merge candidate with a motion vector having a precision value of fractional pixels may be rearranged to have a higher priority than a merge candidate with a motion vector having a precision of integer pixels.
当生成合并候选列表时,可以基于合并候选索引来指定在合并候选列表中包括的合并候选中的至少一个(S1040)。When generating a merge candidate list, at least one of the merge candidates included in the merge candidate list may be specified based on the merge candidate index ( S1040 ).
可以将当前块的运动信息设置成与由合并候选索引指定的合并候选的运动信息相同(S1050)。在示例中,在通过合并候选索引选择空间合并候选时,可以将当前块的运动信息设置成与空间相邻块的运动信息相同。替选地,在通过合并候选索引选择时间合并候选时,可以将当前块的运动信息设置成与时间相邻块的运动信息相同。The motion information of the current block may be set to be the same as the motion information of the merge candidate specified by the merge candidate index (S1050). In the example, when a spatial merge candidate is selected by the merge candidate index, the motion information of the current block may be set to be the same as the motion information of the spatial neighboring block. Alternatively, when a temporal merge candidate is selected by the merge candidate index, the motion information of the current block may be set to be the same as the motion information of the temporal neighboring block.
图14是示出了当AMVP模式被应用于当前块时导出当前块的运动信息的处理的图。FIG. 14 is a diagram illustrating a process of deriving motion information of a current block when the AMVP mode is applied to the current block.
当AMVP模式被应用于当前块时,可以从比特流解码当前块的帧间预测方向和参考图片索引中的至少一个S1410。换言之,当应用AMVP模式时,可以基于通过比特流编码的信息来确定当前块的帧间预测方向和参考图片索引中的至少一个。When the AMVP mode is applied to the current block, at least one of the inter prediction direction and the reference picture index of the current block may be decoded from the bitstream S1410. In other words, when the AMVP mode is applied, at least one of the inter prediction direction and the reference picture index of the current block may be determined based on information encoded by the bitstream.
可以基于当前块的空间相邻块的运动向量来确定空间运动向量候选S1420。空间运动向量候选可以包括以下中的至少一个:根据当前块的上侧相邻块导出的第一空间运动向量候选和根据当前块的左侧相邻块导出的第二空间运动向量候选。在本文中,上侧相邻块可以包括与当前块的上侧和右上角邻近的块中的至少一个,并且当前块的左侧相邻块包括与当前块的左侧和左下角邻近的块中的至少一个。与当前块的左上角邻近的块可以用作上侧相邻块或者可以用作左侧相邻块。A spatial motion vector candidate may be determined based on the motion vector of the spatial neighboring block of the current block S1420. The spatial motion vector candidate may include at least one of the following: a first spatial motion vector candidate derived from an upper neighboring block of the current block and a second spatial motion vector candidate derived from a left neighboring block of the current block. In this article, the upper neighboring block may include at least one of the blocks adjacent to the upper side and upper right corner of the current block, and the left neighboring block of the current block includes at least one of the blocks adjacent to the left side and lower left corner of the current block. The block adjacent to the upper left corner of the current block may be used as an upper neighboring block or may be used as a left neighboring block.
替选地,可以根据不与当前块邻近的空间非相邻块来导出空间运动向量候选。在示例中,可以通过使用以下中的至少一个来导出当前块的空间运动向量候选:与邻近当前块的上侧、右上角或左上角的块位于同一垂直线的块;与邻近当前块的左侧、左下角或左上角的块位于同一水平线的块;以及,与邻近当前块的角的块位于同一对角线的块。当空间相邻块不可用时,可以通过使用空间非相邻块来导出空间运动向量候选。Alternatively, a spatial motion vector candidate may be derived from a spatial non-adjacent block that is not adjacent to the current block. In an example, a spatial motion vector candidate for the current block may be derived by using at least one of: a block located on the same vertical line as a block adjacent to the upper side, upper right corner, or upper left corner of the current block; a block located on the same horizontal line as a block adjacent to the left side, lower left corner, or upper left corner of the current block; and a block located on the same diagonal line as a block adjacent to a corner of the current block. When spatially adjacent blocks are not available, spatial motion vector candidates may be derived by using spatially non-adjacent blocks.
在另一示例中,可以通过使用空间相邻块和空间非相邻块来导出至少两个空间运动向量候选。在示例中,可以通过使用与当前块邻近的相邻块来导出第一空间运动向量候选和第二空间运动向量候选。同时,可以基于不与当前块邻近但与以上相邻块邻近的块来导出第三空间运动向量候选和/或第四空间运动向量候选。In another example, at least two spatial motion vector candidates may be derived by using spatial adjacent blocks and spatial non-adjacent blocks. In an example, a first spatial motion vector candidate and a second spatial motion vector candidate may be derived by using adjacent blocks adjacent to the current block. Meanwhile, a third spatial motion vector candidate and/or a fourth spatial motion vector candidate may be derived based on blocks that are not adjacent to the current block but are adjacent to the above adjacent blocks.
在当前块在参考图片上与空间相邻块不同时,可以通过对空间相邻块的运动向量执行缩放来获得空间运动向量。可以基于当前块的时间相邻块的运动向量来确定时间运动向量候选S1430。在当前块在参考图片上与时间相邻块不同时,可以通过对时间相邻块的运动向量执行缩放来获得时间运动向量。在本文中,当空间运动向量候选的数目等于或小于预定数目时,可以导出时间运动向量候选。When the current block is different from the spatial neighboring blocks on the reference picture, the spatial motion vector may be obtained by scaling the motion vectors of the spatial neighboring blocks. A temporal motion vector candidate may be determined based on the motion vectors of the temporal neighboring blocks of the current block S1430. When the current block is different from the temporal neighboring blocks on the reference picture, the temporal motion vector may be obtained by scaling the motion vectors of the temporal neighboring blocks. In this article, when the number of spatial motion vector candidates is equal to or less than a predetermined number, the temporal motion vector candidate may be derived.
可以生成包括空间运动向量候选和时间运动向量候选的运动向量候选列表S1440。A motion vector candidate list including spatial motion vector candidates and temporal motion vector candidates may be generated S1440.
当生成运动向量候选列表时,可以基于指定运动向量候选列表中的至少一个的信息来指定包括在运动向量候选列表中的运动向量候选中的至少一个S1450。When generating the motion vector candidate list, at least one of the motion vector candidates included in the motion vector candidate list may be specified based on information specifying at least one of the motion vector candidate list S1450.
由该信息指定的运动向量候选可以被设置为当前块的运动向量的预测值,并且可以通过将运动向量的残差值和运动向量的预测值相加来获得当前块的运动向量S1460。在本文中,可以通过比特流来解析运动向量的残差值。The motion vector candidate specified by the information may be set as a prediction value of the motion vector of the current block, and the motion vector of the current block may be obtained by adding the residual value of the motion vector and the prediction value of the motion vector S1460. Herein, the residual value of the motion vector may be parsed through the bitstream.
当获得当前块的运动信息时,可以基于所获得的运动信息来执行当前块的运动补偿S920。详细地,可以基于帧间预测方向、参考图片索引和当前块的运动向量来执行当前块的运动补偿。帧间预测方向表示是否执行L0预测、L1预测或双预测。当通过双预测对当前块进行编码时,可以基于L0参考块和L1参考块的加权和运算或平均运算来获得当前块的预测块。When the motion information of the current block is obtained, motion compensation of the current block may be performed based on the obtained motion information S920. In detail, motion compensation of the current block may be performed based on the inter prediction direction, the reference picture index, and the motion vector of the current block. The inter prediction direction indicates whether L0 prediction, L1 prediction, or bi-prediction is performed. When the current block is encoded by bi-prediction, a prediction block of the current block may be obtained based on a weighted sum operation or an average operation of the L0 reference block and the L1 reference block.
当通过执行运动补偿获得预测样本时,可以基于所生成的预测样本来重构当前块。详细地,可以通过将当前块的预测样本与残差样本相加来获得重构样本。When the prediction sample is obtained by performing motion compensation, the current block can be reconstructed based on the generated prediction sample. In detail, the reconstructed sample can be obtained by adding the prediction sample of the current block to the residual sample.
如在上述示例中的,基于在当前块之前的使用帧间预测来编码/解码的块的运动信息,可以导出当前块的合并候选。例如,基于在与当前块邻近的预定义位置处的相邻块的运动信息,可以导出当前块的合并候选。相邻块的示例可以包括以下之中的至少一个:与当前块的左侧邻近的块、与当前块的上侧邻近的块、与当前块的左上角邻近的块、与当前块的右上角邻近的块以及与当前块的左下角邻近的块。As in the above example, based on the motion information of the block encoded/decoded using inter-frame prediction before the current block, the merge candidate of the current block can be derived. For example, based on the motion information of the neighboring block at the predefined position adjacent to the current block, the merge candidate of the current block can be derived. Examples of the neighboring blocks may include at least one of the following: a block adjacent to the left side of the current block, a block adjacent to the upper side of the current block, a block adjacent to the upper left corner of the current block, a block adjacent to the upper right corner of the current block, and a block adjacent to the lower left corner of the current block.
可以基于除了相邻块之外的块的运动信息来导出当前块的合并候选。为了便于描述,在与当前块邻近的预定义位置处的相邻块被称为第一合并候选块,并且在与第一合并候选块不同的位置处的块被称为第二合并候选块。The merging candidate of the current block can be derived based on the motion information of the blocks other than the neighboring blocks. For ease of description, the neighboring block at a predefined position adjacent to the current block is referred to as a first merging candidate block, and the block at a position different from the first merging candidate block is referred to as a second merging candidate block.
第二合并候选块可以包括以下中的至少一个:在当前块之前的使用帧间预测编码/解码的块、与第一合并候选块邻近的块或者与第一合并候选块位于同一条线上的块。图15示出了与第一合并候选块邻近的第二合并候选块,并且图16示出了与第一合并候选块位于同一条线上的第二合并候选块。The second merge candidate block may include at least one of the following: a block encoded/decoded using inter-frame prediction before the current block, a block adjacent to the first merge candidate block, or a block located on the same line as the first merge candidate block. FIG. 15 shows a second merge candidate block adjacent to the first merge candidate block, and FIG. 16 shows a second merge candidate block located on the same line as the first merge candidate block.
当第一合并候选块不可用时,基于第二合并候选块的运动信息导出的合并候选被添加至合并候选列表。替选地,即使空间合并候选和时间合并候选之中的至少一个被添加至合并候选列表,当合并候选列表中包括的合并候选的数目小于合并候选的最大数目时,将基于第二合并候选块的运动信息导出的合并候选添加至合并候选列表。When the first merge candidate block is not available, the merge candidate derived based on the motion information of the second merge candidate block is added to the merge candidate list. Alternatively, even if at least one of the spatial merge candidate and the temporal merge candidate is added to the merge candidate list, when the number of merge candidates included in the merge candidate list is less than the maximum number of merge candidates, the merge candidate derived based on the motion information of the second merge candidate block is added to the merge candidate list.
图15是示出了当第一合并候选块不可用时从第二合并候选块导出合并候选的示例的图。FIG. 15 is a diagram showing an example of deriving a merge candidate from a second merge candidate block when a first merge candidate block is unavailable.
当第一合并候选块AN(在本文中,N的范围从0到4)不可用时,基于第二合并候选块BM(在本文中,M的范围从0到6)的运动信息导出当前块的合并候选。也就是说,可以通过用第二合并候选块替换不可用的第一合并候选块来导出当前块的合并候选。When the first merge candidate block AN (herein, N ranges from 0 to 4) is unavailable, a merge candidate of the current block is derived based on motion information of a second merge candidate block BM (herein, M ranges from 0 to 6). That is, the merge candidate of the current block can be derived by replacing the unavailable first merge candidate block with the second merge candidate block.
在与第一合并候选块邻近的块之中,从第一合并候选块在预定义方向上放置的块可以被设置为第二合并候选块。预定义方向可以是向左方向、向右方向、向上方向、向下方向或对角线方向。可以为每个第一合并候选块设置预定义方向。例如,与当前块的左侧邻近的第一合并候选块的预定义方向可以是向左方向。与当前块的上侧邻近的第一合并候选块的预定义方向可以是向上方向。与当前块的角邻近的第一合并候选块的预定义方向可以包括向左方向、向上方向或对角线方向中的至少一个。Among the blocks adjacent to the first merge candidate block, a block placed in a predefined direction from the first merge candidate block may be set as a second merge candidate block. The predefined direction may be a left direction, a right direction, an upward direction, a downward direction, or a diagonal direction. The predefined direction may be set for each first merge candidate block. For example, the predefined direction of the first merge candidate block adjacent to the left side of the current block may be a left direction. The predefined direction of the first merge candidate block adjacent to the upper side of the current block may be an upward direction. The predefined direction of the first merge candidate block adjacent to the corner of the current block may include at least one of a left direction, an upward direction, or a diagonal direction.
例如,当与当前块的左侧邻近的A0不可用时,基于与A1邻近的B0导出当前块的合并候选。当与当前块的上侧邻近的A1不可用时,基于与A1邻近的B1导出当前块的合并候选。当与当前块的右上角邻近的A2不可用时,基于与A2邻近的B2导出当前块的合并候选。当与当前块的左下角邻近的A3不可用时,基于与A3邻近的B3导出当前块的合并候选。当与当前块的左上角邻近的A4不可用时,基于与A4邻近的B4至B6之中的至少一个来导出当前块的合并候选。For example, when A0 adjacent to the left side of the current block is not available, a merge candidate for the current block is derived based on B0 adjacent to A1. When A1 adjacent to the upper side of the current block is not available, a merge candidate for the current block is derived based on B1 adjacent to A1. When A2 adjacent to the upper right corner of the current block is not available, a merge candidate for the current block is derived based on B2 adjacent to A2. When A3 adjacent to the lower left corner of the current block is not available, a merge candidate for the current block is derived based on B3 adjacent to A3. When A4 adjacent to the upper left corner of the current block is not available, a merge candidate for the current block is derived based on at least one of B4 to B6 adjacent to A4.
图15中所示的示例仅用于描述本发明的实施方式,而并不限制本发明。第二合并候选块的位置可以被设置为与图15中所示的样本不同。例如,与第一合并候选块邻近的第二合并候选块可以在第一合并候选块的向上方向或向下方向上定位,该第一合并候选块与当前块的左侧邻近。替选地,与第一合并候选块邻近的第二合并候选块可以在第一合并候选块的向左方向或向右方向上定位,该第一合并候选块与当前块的上侧邻近。The example shown in FIG15 is only used to describe the embodiments of the present invention, and does not limit the present invention. The position of the second merge candidate block may be set to be different from the sample shown in FIG15. For example, the second merge candidate block adjacent to the first merge candidate block may be positioned in the upward direction or the downward direction of the first merge candidate block, and the first merge candidate block is adjacent to the left side of the current block. Alternatively, the second merge candidate block adjacent to the first merge candidate block may be positioned in the left direction or the right direction of the first merge candidate block, and the first merge candidate block is adjacent to the upper side of the current block.
图16是示出了根据与第一合并候选块位于同一条线上的第二合并候选块导出合并候选的示例的图。FIG. 16 is a diagram showing an example of deriving a merge candidate from a second merge candidate block located on the same line as a first merge candidate block.
与第一合并候选块位于同一条线上的块可以包括以下中的至少一个:与第一合并候选块位于同一水平线上的块、与第一合并候选块位于同一垂直线上的块或者与第一合并候选块位于同一对角线上的块。位于同一水平线上的块的y坐标位置相同。位于同一垂直线上的块的x坐标位置相同。位于同一对角线上的块的x坐标位置之间的差值与y坐标位置之间的差值相同。The blocks located on the same line as the first merge candidate block may include at least one of the following: a block located on the same horizontal line as the first merge candidate block, a block located on the same vertical line as the first merge candidate block, or a block located on the same diagonal line as the first merge candidate block. The y coordinate positions of the blocks located on the same horizontal line are the same. The x coordinate positions of the blocks located on the same vertical line are the same. The difference between the x coordinate positions of the blocks located on the same diagonal line is the same as the difference between the y coordinate positions.
假设当前块的左上样本位于(0,0)处,并且当前块的宽度和高度分别为W和H。在图18中,示出了基于在编码块的上侧的最右侧块(例如,包括坐标(W-1,-1)的块A1)来确定与第一合并候选块位于同一垂直线上的第二合并候选块(例如,B4、C6)的位置。另外,在图18中,示出了基于在编码块的左侧的最低块(例如,包括坐标(-1,H-1)的块A0)来确定与第一合并候选块位于同一水平线上的第二合并候选块(例如,B1、C1)的位置。Assume that the upper left sample of the current block is located at (0, 0), and the width and height of the current block are W and H, respectively. In FIG. 18, it is shown that the position of the second merge candidate block (e.g., B4, C6) located on the same vertical line as the first merge candidate block is determined based on the rightmost block on the upper side of the coding block (e.g., block A1 including coordinates (W-1, -1)). In addition, in FIG. 18, it is shown that the position of the second merge candidate block (e.g., B1, C1) located on the same horizontal line as the first merge candidate block is determined based on the lowest block on the left side of the coding block (e.g., block A0 including coordinates (-1, H-1)).
在另一示例中,可以基于在编码块的上侧的最左侧块(例如,包括坐标(0,-1)的块)或位于编码块的上侧中心的块(例如,包括坐标(W/2,-1)的块)来确定第二合并候选块的位置。另外,可以基于在编码块的左侧的最上侧块(例如,包括坐标(-1,0)的块)或位于编码块的左侧中心的块(例如,包括坐标(-1,H/2)的块)来确定第二合并候选块的位置。In another example, the position of the second merge candidate block may be determined based on the leftmost block on the upper side of the coding block (e.g., a block including coordinates (0, -1)) or a block located at the upper center of the coding block (e.g., a block including coordinates (W/2, -1)). In addition, the position of the second merge candidate block may be determined based on the uppermost block on the left side of the coding block (e.g., a block including coordinates (-1, 0)) or a block located at the left center of the coding block (e.g., a block including coordinates (-1, H/2)).
在另一示例中,当存在与当前块的上侧邻近的多个上侧相邻块时,可以通过使用多个上侧相邻块中的全部或部分来确定第二合并候选块。在示例中,可以通过使用在多个上侧相邻块之中的特定位置处的块(例如,位于最左侧的上侧相邻块、位于最右侧的上侧相邻块或位于中心的上侧相邻块中的至少一个)来确定第二合并候选块。多个上侧相邻块之中的用于确定第二合并候选块的上侧相邻块的数目可以是1、2、3或更多。另外,当存在与当前块的左侧邻近的多个左侧相邻块时,可以通过使用多个左侧相邻块中的全部或部分来确定第二合并候选块。在示例中,可以通过使用多个左侧相邻块之中的特定位置处的块(例如,位于最下侧的左侧相邻块、位于最上侧的左侧相邻块或位于中心的左侧相邻块中的至少一个)来确定第二合并候选块。多个左侧相邻块之中的用于确定第二合并候选块的左侧相邻块的数目可以是1、2、3或更多。In another example, when there are multiple upper adjacent blocks adjacent to the upper side of the current block, the second merge candidate block can be determined by using all or part of the multiple upper adjacent blocks. In the example, the second merge candidate block can be determined by using a block at a specific position among the multiple upper adjacent blocks (for example, at least one of the upper adjacent block located at the leftmost side, the upper adjacent block located at the rightmost side, or the upper adjacent block located at the center). The number of upper adjacent blocks used to determine the second merge candidate block among the multiple upper adjacent blocks can be 1, 2, 3 or more. In addition, when there are multiple left adjacent blocks adjacent to the left side of the current block, the second merge candidate block can be determined by using all or part of the multiple left adjacent blocks. In the example, the second merge candidate block can be determined by using a block at a specific position among the multiple left adjacent blocks (for example, at least one of the left adjacent block located at the bottom, the left adjacent block located at the top, or the left adjacent block located at the center). The number of left adjacent blocks used to determine the second merge candidate block among the multiple left adjacent blocks can be 1, 2, 3 or more.
根据当前块的大小和/或形状,可以不同地确定用于确定第二合并候选块的上侧相邻块和/或左侧相邻块的位置和/或数目。在示例中,在当前块的大小大于阈值时,可以基于上侧中心块和/或左侧中心块来确定第二合并候选块。另一方面,在当前块的大小小于阈值时,可以基于最右上块和/或最左下块来确定第二合并候选块。阈值可以是整数,例如8、16、32、64或128。Depending on the size and/or shape of the current block, the position and/or number of the upper adjacent blocks and/or the left adjacent blocks used to determine the second merge candidate block can be determined differently. In the example, when the size of the current block is greater than the threshold, the second merge candidate block can be determined based on the upper center block and/or the left center block. On the other hand, when the size of the current block is less than the threshold, the second merge candidate block can be determined based on the upper right block and/or the lower left block. The threshold can be an integer, such as 8, 16, 32, 64, or 128.
可以构造第一合并候选列表和第二合并候选列表,并且可以基于第一合并候选列表或第二合并候选列表中的至少一个来执行当前块的运动补偿。A first merge candidate list and a second merge candidate list may be constructed, and motion compensation of the current block may be performed based on at least one of the first merge candidate list or the second merge candidate list.
第一合并候选列表可以包括以下中的至少一个:基于与当前块邻近的在预定义位置处的相邻块的运动信息导出的空间合并候选,或者基于同位块的运动信息导出的时间合并候选。The first merge candidate list may include at least one of: a spatial merge candidate derived based on motion information of a neighboring block at a predefined position adjacent to the current block, or a temporal merge candidate derived based on motion information of a co-located block.
第二合并候选列表可以包括基于第二合并候选块的运动信息导出的合并候选。The second merge candidate list may include merge candidates derived based on the motion information of the second merge candidate block.
作为本发明的实施方式,第一合并候选列表可以被构造为包括根据第一合并候选块导出的合并候选,并且第二合并候选列表可以被构造为包括根据第二合并候选块导出的合并候选。在示例中,在图15中所示的示例中,可以将从块A0至A4导出的合并候选添加至第一合并候选列表,并且可以将根据块B0至B6导出的合并候选添加至第二合并候选列表。在示例中,在图16中所示的示例中,可以将根据块A0至A4导出的合并候选添加至第一合并候选列表,并且可以将根据块B0至B5、C0至C7导出的合并候选添加至第二合并候选列表。As an embodiment of the present invention, a first merge candidate list may be constructed to include merge candidates derived from a first merge candidate block, and a second merge candidate list may be constructed to include merge candidates derived from a second merge candidate block. In an example, in the example shown in FIG. 15 , merge candidates derived from blocks A0 to A4 may be added to the first merge candidate list, and merge candidates derived from blocks B0 to B6 may be added to the second merge candidate list. In an example, in the example shown in FIG. 16 , merge candidates derived from blocks A0 to A4 may be added to the first merge candidate list, and merge candidates derived from blocks B0 to B5, C0 to C7 may be added to the second merge candidate list.
替选地,第二合并候选列表可以包括基于在当前块之前的使用帧间预测编码/解码的块的运动信息导出的合并候选。例如,当执行编码模式为帧间预测的块的运动补偿时,基于该块的运动信息导出的合并候选被添加至第二合并候选列表。在当前块的编码/解码完成时,当前块的运动信息被添加至第二合并候选列表以用于后续块的帧间预测。Alternatively, the second merge candidate list may include merge candidates derived based on motion information of a block encoded/decoded using inter-frame prediction before the current block. For example, when motion compensation of a block whose coding mode is inter-frame prediction is performed, a merge candidate derived based on the motion information of the block is added to the second merge candidate list. When encoding/decoding of the current block is completed, the motion information of the current block is added to the second merge candidate list for inter-frame prediction of subsequent blocks.
可以基于向第二合并候选列表添加合并候选的顺序来确定第二合并候选列表中包括的合并候选的索引。例如,分配给添加至第二合并候选列表的第N合并候选的索引可以具有比分配给添加至第二合并候选列表的第N+1合并候选的索引更低的值。例如,第N+1合并候选的索引可以被设置成具有比第N合并候选的索引高1的值。替选地,第N合并候选的索引可以被设置为第N+1合并候选的索引,并且第N合并候选的索引的值减小1。The indexes of the merge candidates included in the second merge candidate list may be determined based on the order in which the merge candidates are added to the second merge candidate list. For example, the index assigned to the Nth merge candidate added to the second merge candidate list may have a lower value than the index assigned to the N+1th merge candidate added to the second merge candidate list. For example, the index of the N+1th merge candidate may be set to have a value that is 1 higher than the index of the Nth merge candidate. Alternatively, the index of the Nth merge candidate may be set to the index of the N+1th merge candidate, and the value of the index of the Nth merge candidate is reduced by 1.
替选地,分配给添加至第二合并候选列表的第N合并候选的索引可以具有比分配给添加至第二合并候选列表的第N+1合并候选的索引更高的值。例如,第N合并候选的索引可以被设置为第N+1合并候选的索引,并且第N合并候选的索引的值增加1。Alternatively, the index assigned to the Nth merge candidate added to the second merge candidate list may have a higher value than the index assigned to the N+1th merge candidate added to the second merge candidate list. For example, the index of the Nth merge candidate may be set to the index of the N+1th merge candidate, and the value of the index of the Nth merge candidate is increased by 1.
基于经受运动补偿的块的运动信息是否与第二合并候选列表中包括的合并候选的运动信息相同,可以确定是否将根据该块导出的合并候选添加至第二合并候选列表。例如,当具有与该块相同的运动信息的合并候选被包括在第二合并候选列表中时,基于该块的运动信息导出的合并候选不被添加至第二合并候选列表。替选地,当具有与该块相同的运动信息的合并候选被包括在第二合并候选列表中时,从第二合并候选列表中删除该合并候选,并且基于该块的运动信息导出的合并候选被添加至第二合并候选列表。Based on whether the motion information of the block subjected to motion compensation is the same as the motion information of the merge candidate included in the second merge candidate list, it can be determined whether to add the merge candidate derived from the block to the second merge candidate list. For example, when a merge candidate having the same motion information as the block is included in the second merge candidate list, the merge candidate derived based on the motion information of the block is not added to the second merge candidate list. Alternatively, when a merge candidate having the same motion information as the block is included in the second merge candidate list, the merge candidate is deleted from the second merge candidate list, and the merge candidate derived based on the motion information of the block is added to the second merge candidate list.
当第二合并候选列表中包括的合并候选的数目与合并候选的最大数目相同时,从第二合并候选列表中检测具有最低索引的合并候选或具有最高索引的合并候选,并且基于该块的运动信息导出的合并候选被添加至第二合并候选列表。也就是说,在删除第二合并候选列表中包括的合并候选之中的最旧的合并候选之后,可以将基于该块的运动信息导出的合并候选添加至第二合并候选列表。When the number of merge candidates included in the second merge candidate list is the same as the maximum number of merge candidates, a merge candidate with a lowest index or a merge candidate with a highest index is detected from the second merge candidate list, and a merge candidate derived based on the motion information of the block is added to the second merge candidate list. That is, after deleting the oldest merge candidate among the merge candidates included in the second merge candidate list, a merge candidate derived based on the motion information of the block may be added to the second merge candidate list.
可以以CTU、图块或切片为单位来对第二合并候选列表进行初始化。换言之,包括在CTU、图块或切片中的不同于当前块的块可以被设置成不可用作为第二合并候选块。可以在编码器和解码器中预定义可以包括在第二合并候选列表中的合并候选的最大数目。替选地,可以通过比特流用信号发送表示可以包括在第二合并候选列表中的合并候选的最大数目的信息。The second merge candidate list may be initialized in units of CTU, tile, or slice. In other words, a block different from the current block included in the CTU, tile, or slice may be set to be unavailable as a second merge candidate block. The maximum number of merge candidates that may be included in the second merge candidate list may be predefined in the encoder and the decoder. Alternatively, information indicating the maximum number of merge candidates that may be included in the second merge candidate list may be signaled via a bitstream.
可以选择第一合并候选列表或第二合并候选列表,并且可以使用所选择的合并候选列表来执行当前块的帧间预测。具体地,基于索引信息,可以选择包括在合并候选列表中的合并候选中的任何一个,并且可以从合并候选获取当前块的运动信息。The first merge candidate list or the second merge candidate list may be selected, and the selected merge candidate list may be used to perform inter prediction of the current block. Specifically, based on the index information, any one of the merge candidates included in the merge candidate list may be selected, and motion information of the current block may be obtained from the merge candidate.
可以通过比特流用信号发送指定第一合并候选列表或第二合并候选列表的信息。解码器可以基于该信息选择第一合并候选列表或第二合并候选列表。Information specifying the first merge candidate list or the second merge candidate list may be signaled through the bitstream, and the decoder may select the first merge candidate list or the second merge candidate list based on the information.
替选地,在第一合并候选列表和第二合并候选列表之中,可以选择包括较大量的可用合并候选的合并候选列表。Alternatively, among the first merge candidate list and the second merge candidate list, a merge candidate list including a larger number of available merge candidates may be selected.
替选地,可以基于当前块的大小、形状和划分深度中的至少一个来选择第一合并候选列表或第二合并候选列表。Alternatively, the first merge candidate list or the second merge candidate list may be selected based on at least one of the size, shape, and split depth of the current block.
替选地,合并候选列表通过向第一合并候选列表和第二合并候选列表中的任意一个添加(或附加)第一合并候选列表和第二合并候选列表中的另一个至来配置。Alternatively, the merge candidate list is configured by adding (or appending) the other one of the first merge candidate list and the second merge candidate list to any one of the first merge candidate list and the second merge candidate list.
例如,可以基于具有在第一合并候选列表中包括的至少一个合并候选和在第二合并候选列表中包括的至少一个合并候选的合并候选列表来执行帧间预测。For example, inter prediction may be performed based on a merge candidate list having at least one merge candidate included in a first merge candidate list and at least one merge candidate included in a second merge candidate list.
例如,可以将包括在第二合并候选列表中的合并候选添加至第一合并候选列表。替选地,可以将包括在第一合并候选列表中的合并候选添加至第二合并候选。For example, the merge candidates included in the second merge candidate list may be added to the first merge candidate list. Alternatively, the merge candidates included in the first merge candidate list may be added to the second merge candidate list.
当第一合并候选列表中包括的合并候选的数目小于最大数目时,或者当第一合并候选块不可用时,第二合并候选列表中包括的合并候选被添加至第一合并候选列表。When the number of merge candidates included in the first merge candidate list is less than the maximum number, or when the first merge candidate block is unavailable, merge candidates included in the second merge candidate list are added to the first merge candidate list.
替选地,当第一合并候选块不可用时,将第二合并候选列表中包括的合并候选之中的根据与第一合并候选块邻近的块导出的合并候选添加至第一合并候选列表。参照图15,当A0不可用时,将第二合并候选列表中包括的合并候选之中的基于B0的运动信息导出的合并候选添加至第一合并候选列表。当A1不可用时,将第二合并候选列表中包括的合并候选之中的基于B1的运动信息导出的合并候选添加至第一合并候选列表。当A2不可用时,将第二合并候选列表中包括的合并候选之中的基于B2的运动信息导出的合并候选添加至第一合并候选列表。当A3不可用时,将第二合并候选列表中包括的合并候选之中的基于B3的运动信息导出的合并候选添加至第一合并候选列表。当A4不可用时,将第二合并候选列表中包括的合并候选之中的基于B4、B5或B6的运动信息导出的合并候选添加至第一合并候选列表。Alternatively, when the first merge candidate block is not available, a merge candidate derived from a block adjacent to the first merge candidate block among the merge candidates included in the second merge candidate list is added to the first merge candidate list. Referring to FIG. 15 , when A0 is not available, a merge candidate derived based on motion information of B0 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A1 is not available, a merge candidate derived based on motion information of B1 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A2 is not available, a merge candidate derived based on motion information of B2 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A3 is not available, a merge candidate derived based on motion information of B3 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A4 is not available, a merge candidate derived based on motion information of B4, B5 or B6 among the merge candidates included in the second merge candidate list is added to the first merge candidate list.
替选地,可以根据第二合并候选列表中包括的合并候选的优先级来确定要被添加至第一合并候选列表的合并候选。可以基于分配给每个合并候选的索引值来确定优先级。例如,当第一合并候选列表中包括的合并候选的数目小于最大数目时,或者当第一合并候选块不可用时,第二合并候选列表中包括的合并候选之中的具有最小索引值的合并候选或具有最大索引值的合并候选被添加至第一合并候选列表。Alternatively, the merge candidate to be added to the first merge candidate list may be determined according to the priority of the merge candidates included in the second merge candidate list. The priority may be determined based on the index value assigned to each merge candidate. For example, when the number of merge candidates included in the first merge candidate list is less than the maximum number, or when the first merge candidate block is unavailable, the merge candidate with the smallest index value or the merge candidate with the largest index value among the merge candidates included in the second merge candidate list is added to the first merge candidate list.
当在第一合并候选列表中包括与在第二合并候选列表中包括的合并候选中的具有最高优先级的合并候选具有相同的运动信息的合并候选时,可以不将具有最高优先级的合并候选添加至第一合并候选列表。另外,可以确定是否可以将具有下一个优先级的合并候选(例如,给其分配比分配给具有最高优先级的合并候选的索引值大1的索引值的合并候选或者给其分配比分配给具有最高优先级的合并候选的索引值小1的索引值的合并候选)添加至第一合并候选列表。When a merge candidate having the same motion information as a merge candidate with the highest priority among the merge candidates included in the second merge candidate list is included in the first merge candidate list, the merge candidate with the highest priority may not be added to the first merge candidate list. In addition, it may be determined whether a merge candidate with the next priority (for example, a merge candidate to which an index value greater than the index value assigned to the merge candidate with the highest priority is assigned by 1 or a merge candidate to which an index value less than the index value assigned to the merge candidate with the highest priority is assigned by 1) can be added to the first merge candidate list.
替选地,可以生成包括基于第一合并候选块的运动信息导出的合并候选和基于第二合并候选块的运动信息导出的合并候选的合并候选列表。合并候选列表可以是第一合并候选列表和第二合并候选列表的组合。Alternatively, a merge candidate list including merge candidates derived based on motion information of the first merge candidate block and merge candidates derived based on motion information of the second merge candidate block may be generated. The merge candidate list may be a combination of the first merge candidate list and the second merge candidate list.
例如,根据预定的搜索顺序,可以通过搜索第一合并候选块和第二合并候选块来生成合并候选列表。For example, according to a predetermined search order, a merge candidate list may be generated by searching the first merge candidate block and the second merge candidate block.
图17至图20是示出了搜索合并候选块的顺序的图。17 to 20 are diagrams showing an order of searching for merge candidate blocks.
图17至图20将搜索合并候选的顺序示出为如下。17 to 20 illustrate the order of searching for merging candidates as follows.
A0→A1→A2→A3→A4→B0→B1→B2→B3→B4→(B5)→(B6)。A0→A1→A2→A3→A4→B0→B1→B2→B3→B4→(B5)→(B6).
仅当块B4不可用时或者当合并候选列表中包括的合并候选的数目等于或小于预设数目时,才进行块B5和B6的搜索。Only when block B4 is unavailable or when the number of merge candidates included in the merge candidate list is equal to or less than a preset number, the search for blocks B5 and B6 is performed.
可以设置与图17至图20中所示的示例不同的搜索顺序。A search order different from the examples shown in FIGS. 17 to 20 may be set.
可以生成合并候选列表,其包括第一合并候选列表中包括的至少一个合并候选和第二合并候选列表中包括的至少一个合并候选的组合。例如,组合的合并候选列表可以包括第一合并候选列表中包括的合并候选中的N个合并候选和第二合并候选列表中包括的合并候选中的M个合并候选。字母N和M可以表示相同的数字或不同的数字。替选地,可以基于包括在第一合并候选列表中的合并候选的数目和包括在第二合并候选列表中的合并候选的数目之中的至少一个来确定N和M之中的至少一个。替选地,可以通过比特流用信号发送用于确定N和M之中的至少一个的信息。N和M之中的任意一个可以通过组合的合并候选列表中的合并候选的最大数目减去N和M之中的另一个来导出。A merge candidate list may be generated that includes a combination of at least one merge candidate included in a first merge candidate list and at least one merge candidate included in a second merge candidate list. For example, the combined merge candidate list may include N merge candidates among the merge candidates included in the first merge candidate list and M merge candidates among the merge candidates included in the second merge candidate list. The letters N and M may represent the same number or different numbers. Alternatively, at least one of N and M may be determined based on at least one of the number of merge candidates included in the first merge candidate list and the number of merge candidates included in the second merge candidate list. Alternatively, information for determining at least one of N and M may be signaled via a bitstream. Any one of N and M may be derived by subtracting the other of N and M from the maximum number of merge candidates in the combined merge candidate list.
可以根据预定义的优先级来确定要被添加至组合的合并候选列表的合并候选。可以基于分配给合并候选的索引来确定预定义的优先级。The merge candidates to be added to the combined merge candidate list may be determined according to a predefined priority. The predefined priority may be determined based on an index assigned to the merge candidate.
替选地,可以基于合并候选之间的关联来确定要被添加至组合的合并候选列表的合并候选。例如,当包括在第一合并候选列表中的A0被添加至组合的合并候选列表时,在与A0邻近的位置处的合并候选(例如,B0)不被添加至组合的合并列表。Alternatively, the merge candidates to be added to the combined merge candidate list may be determined based on the association between the merge candidates. For example, when A0 included in the first merge candidate list is added to the combined merge candidate list, a merge candidate (e.g., B0) at a position adjacent to A0 is not added to the combined merge list.
当第一合并候选列表中包括的合并候选的数目小于N时,第二合并候选列表中包括的合并候选中的大于M个的合并候选被添加至组合的合并候选列表。例如,当N为4且M为2时,将第一合并候选列表中包括的合并候选中的4个合并候选添加至组合的合并候选列表,并且将第二合并候选列表中包括的合并候选中的2个合并候选添加至组合的合并候选列表。当第一合并候选列表中包括的合并候选的数目小于4时,第二合并候选列表中包括的合并候选之中的两个或更多个合并候选被添加至组合的合并候选列表。当第二合并候选列表中包括的合并候选的数目小于2时,第一合并候选列表中包括的合并候选中的四个或更多个合并候选被添加至组合的合并候选列表。When the number of merge candidates included in the first merge candidate list is less than N, more than M merge candidates among the merge candidates included in the second merge candidate list are added to the combined merge candidate list. For example, when N is 4 and M is 2, 4 merge candidates among the merge candidates included in the first merge candidate list are added to the combined merge candidate list, and 2 merge candidates among the merge candidates included in the second merge candidate list are added to the combined merge candidate list. When the number of merge candidates included in the first merge candidate list is less than 4, two or more merge candidates among the merge candidates included in the second merge candidate list are added to the combined merge candidate list. When the number of merge candidates included in the second merge candidate list is less than 2, four or more merge candidates among the merge candidates included in the first merge candidate list are added to the combined merge candidate list.
也就是说,可以根据每个合并候选列表中包括的合并候选的数目来调整N或M的值。通过调整N或M的值,包括在组合的合并候选列表中的合并候选的总数可以被固定。当包括在组合的合并候选列表中的合并候选的总数小于合并候选的最大数目时,添加组合的合并候选、平均合并候选或零运动向量候选。That is, the value of N or M may be adjusted according to the number of merge candidates included in each merge candidate list. By adjusting the value of N or M, the total number of merge candidates included in the combined merge candidate list may be fixed. When the total number of merge candidates included in the combined merge candidate list is less than the maximum number of merge candidates, a combined merge candidate, an average merge candidate, or a zero motion vector candidate is added.
可以通过使用包括在第一合并候选列表和第二合并候选列表中的合并候选中的至少一个来执行当前块的运动补偿。编码器可以对用于指定多个合并候选中的任何一个的索引信息进行编码。在示例中,‘merge_idx’可以指定多个合并候选中的任何一个。在示例中,表1表示根据图16中所示的第一合并候选块和第二合并候选块导出的每个合并候选的合并索引。Motion compensation of the current block may be performed by using at least one of the merge candidates included in the first merge candidate list and the second merge candidate list. The encoder may encode index information for specifying any one of a plurality of merge candidates. In an example, 'merge_idx' may specify any one of a plurality of merge candidates. In an example, Table 1 represents a merge index of each merge candidate derived from the first merge candidate block and the second merge candidate block shown in FIG. 16.
【表1】【Table 1】
然而,随着合并候选列表中包括的合并候选的数目增加,用于对合并索引进行编码的码字变得更长。因此,出现降低编码/解码效率的问题。为了减小码字的长度,可以通过使用前缀和后缀来确定合并索引。在示例中,可以通过使用表示合并索引的前缀的merge_idx_prefix和表示合并索引的后缀的merge_idx_suffix来确定合并索引。However, as the number of merge candidates included in the merge candidate list increases, the codeword used to encode the merge index becomes longer. Therefore, there is a problem of reducing encoding/decoding efficiency. In order to reduce the length of the codeword, the merge index can be determined by using a prefix and a suffix. In the example, the merge index can be determined by using merge_idx_prefix representing the prefix of the merge index and merge_idx_suffix representing the suffix of the merge index.
表2表示每个合并索引的合并索引前缀值和合并索引后缀值,并且表3表示基于合并索引前缀值和合并索引后缀值确定合并索引的处理。Table 2 shows the merged index prefix value and the merged index suffix value of each merged index, and Table 3 shows the process of determining the merged index based on the merged index prefix value and the merged index suffix value.
【表2】【Table 2】
【表3】【Table 3】
如表2和表3中所示,当合并索引前缀值小于阈值时,可以将合并索引设置成与合并索引前缀值相同。另一方面,当合并索引前缀值大于阈值时,可以通过从合并索引前缀中减去基准值并将合并索引后缀与使该结果移位的值相加来确定合并索引。基准值可以是阈值,或者可以是通过从阈值中减去1而获得的值。As shown in Tables 2 and 3, when the merge index prefix value is less than the threshold value, the merge index may be set to be the same as the merge index prefix value. On the other hand, when the merge index prefix value is greater than the threshold value, the merge index may be determined by subtracting a reference value from the merge index prefix and adding a merge index suffix to a value that shifts the result. The reference value may be a threshold value, or may be a value obtained by subtracting 1 from the threshold value.
表2和表3示出了阈值是4。可以基于合并候选列表中包括的合并候选的数目、第二合并候选块的数目或包括第二合并候选块的线的数目中的至少一个来确定阈值。替选地,可以在编码器和解码器中预定义阈值。Tables 2 and 3 show that the threshold is 4. The threshold may be determined based on at least one of the number of merge candidates included in the merge candidate list, the number of second merge candidate blocks, or the number of lines including the second merge candidate blocks. Alternatively, the threshold may be predefined in the encoder and the decoder.
可以根据包括在合并候选列表中的合并候选的数目或可以包括在合并候选列表中的合并候选的最大数目来确定是否使用前缀和后缀来确定合并索引。在示例中,当可以包括在合并候选列表中的合并候选的最大数目大于阈值时,可以用信号发送用于确定合并索引的合并索引前缀和合并索引后缀。另一方面,当合并候选的最大数目小于阈值时,可以用信号发送合并索引。Whether to use the prefix and suffix to determine the merge index may be determined according to the number of merge candidates included in the merge candidate list or the maximum number of merge candidates that can be included in the merge candidate list. In an example, when the maximum number of merge candidates that can be included in the merge candidate list is greater than a threshold, a merge index prefix and a merge index suffix used to determine the merge index may be sent with a signal. On the other hand, when the maximum number of merge candidates is less than the threshold, the merge index may be sent with a signal.
可以将矩形块划分为多个三角形块。可以基于包括三角形块的矩形块来导出三角形块的合并候选。三角形块可以共享相同的合并候选。The rectangular block may be divided into a plurality of triangular blocks. Merging candidates of the triangular blocks may be derived based on the rectangular block including the triangular blocks. The triangular blocks may share the same merging candidate.
可以为每个三角形块用信号发送合并索引。在这种情况下,可以将三角形块设置成不使用相同的合并候选。在示例中,用于第一三角形块的合并候选可以不用作第二三角形块的合并候选。因此,第二三角形块的合并索引可以指定除了为第一三角形块选择的合并候选之外的其余合并候选中的任何一个。A merge index may be signaled for each triangle block. In this case, the triangle blocks may be set to not use the same merge candidate. In an example, a merge candidate for a first triangle block may not be used as a merge candidate for a second triangle block. Thus, the merge index for the second triangle block may specify any one of the remaining merge candidates other than the merge candidate selected for the first triangle block.
可以基于具有预定形状或预定大小或更大的块来导出合并候选。在当前块不处于预定形状时,或者在当前块的大小小于预定大小时,基于包括当前块并且处于预定形状或处于预定大小或更大的块来导出当前块的合并候选。预定形状可以是正方形形状或非正方形形状。The merge candidate may be derived based on a block having a predetermined shape or a predetermined size or larger. When the current block is not in the predetermined shape, or when the size of the current block is smaller than the predetermined size, a merge candidate of the current block is derived based on a block including the current block and in the predetermined shape or in the predetermined size or larger. The predetermined shape may be a square shape or a non-square shape.
当预定形状是正方形形状时,基于包括非正方形形状的编码单元的正方形形状的编码单元导出非正方形形状的编码单元的合并候选。When the predetermined shape is a square shape, a merge candidate of the non-square shaped coding unit is derived based on the square shaped coding units including the non-square shaped coding units.
图21是示出了基于正方形块导出非正方形块的合并候选的示例的图。FIG. 21 is a diagram showing an example of deriving merging candidates of non-square blocks based on square blocks.
可以基于包括非正方形块的正方形块来导出非正方形块的合并候选。例如,可以基于包括编码块0和编码块1的正方形形状的块来导出非正方形形状的编码块0和非正方形形状的编码块1的合并候选。也就是说,可以基于正方形形状的块的位置、宽度/高度或大小来确定空间相邻块的位置。可以基于与正方形形状的块邻近的空间相邻块A0、A1、A2、A3和A4之中的至少一个来导出编码块0和编码块1的合并候选。Merge candidates for non-square blocks can be derived based on square blocks including non-square blocks. For example, merge candidates for non-square shaped coding block 0 and non-square shaped coding block 1 can be derived based on square shaped blocks including coding block 0 and coding block 1. That is, the position of the spatially adjacent blocks can be determined based on the position, width/height or size of the square shaped blocks. Merge candidates for coding block 0 and coding block 1 can be derived based on at least one of the spatially adjacent blocks A0, A1, A2, A3 and A4 adjacent to the square shaped blocks.
可以基于正方形形状的块来确定时间合并候选。也就是说,可以基于正方形形状的块的位置、宽度/高度或大小来确定时间相邻块。例如,可以基于依据正方形形状的块确定的时间相邻块来导出编码块0和编码块1的合并候选。Temporal merge candidates may be determined based on square-shaped blocks. That is, temporal neighboring blocks may be determined based on the position, width/height, or size of the square-shaped blocks. For example, merge candidates for coding block 0 and coding block 1 may be derived based on temporal neighboring blocks determined based on square-shaped blocks.
替选地,可以基于正方形块来导出空间合并候选和时间合并候选之中的任意一个,并且可以基于非正方形块来导出另一合并候选。例如,可以基于正方形块来导出编码块0的空间合并候选,而可以基于编码块0来导出编码块0的时间合并候选。Alternatively, any one of the spatial merge candidate and the temporal merge candidate may be derived based on a square block, and the other merge candidate may be derived based on a non-square block. For example, a spatial merge candidate for coding block 0 may be derived based on a square block, and a temporal merge candidate for coding block 0 may be derived based on coding block 0.
预定形状或预定大小或更大的块中包括的多个块可以共享合并候选。例如,在图21中所示的示例中,编码块0和编码块1的空间合并候选和时间合并候选之中的至少一个可以相同。A plurality of blocks included in a block of a predetermined shape or a predetermined size or larger may share a merge candidate. For example, in the example shown in FIG. 21 , at least one of a spatial merge candidate and a temporal merge candidate of coding block 0 and coding block 1 may be the same.
预定形状可以是非正方形形状,例如2NxN、Nx2N等。当预定形状是非正方形形状时,可以基于包括当前块的非正方形块来导出当前块的合并候选。例如,在当前块处于2Nxn形状(在本文中,n为1/2N)时,基于2NxN形状的非正方形块来导出当前块的合并候选。替选地,在当前块处于nx2N形状时,基于Nx2N形状的非正方形块来导出当前块的合并候选。The predetermined shape may be a non-square shape, such as 2NxN, Nx2N, etc. When the predetermined shape is a non-square shape, a merge candidate of the current block may be derived based on a non-square block including the current block. For example, when the current block is in a 2Nxn shape (herein, n is 1/2N), a merge candidate of the current block is derived based on a non-square block of a 2NxN shape. Alternatively, when the current block is in an nx2N shape, a merge candidate of the current block is derived based on a non-square block of an Nx2N shape.
可以通过比特流用信号发送指示预定形状或预定大小的信息。例如,可以通过比特流用信号发送指示非正方形形状或正方形形状之中的任意一个的信息。Information indicating a predetermined shape or a predetermined size may be signaled through a bitstream. For example, information indicating any one of a non-square shape or a square shape may be signaled through a bitstream.
替选地,可以根据在编码器和解码器中预定义的规则来确定预定形状或预定大小。Alternatively, the predetermined shape or the predetermined size may be determined according to a rule predefined in an encoder and a decoder.
当子节点不满足预定条件时,基于满足预定条件的亲体节点来导出子节点的合并候选。在本文中,预定条件可以包括以下之中的至少一个:该块是否是由于四叉树划分而生成的块、是否发生超过了该块的大小、该块的形状和图片边界、以及子节点与亲体节点之间的深度的差是否等于或大于预定值。When the child node does not meet the predetermined condition, a merge candidate of the child node is derived based on the parent node that meets the predetermined condition. In this article, the predetermined condition may include at least one of the following: whether the block is a block generated due to quadtree partitioning, whether the size of the block is exceeded, the shape of the block and the picture boundary, and whether the depth difference between the child node and the parent node is equal to or greater than a predetermined value.
例如,预定条件可以包括该块是否是由于四叉树划分而生成的块,以及该块是否是预定大小或更大的正方形形状的编码块。当通过二叉树划分或三叉树划分来生成当前块时,基于包括当前块并且满足预定条件的高级节点块来导出当前块的合并候选。当不存在满足预定条件的高级节点块时,基于当前块、包括当前块并且处于预定大小或更大的块、或者包括当前块并且与当前块的深度差为一的高级节点块来导出当前块的合并候选。For example, the predetermined condition may include whether the block is a block generated due to quadtree partitioning, and whether the block is a coded block of a square shape of a predetermined size or larger. When the current block is generated by binary tree partitioning or ternary tree partitioning, a merge candidate of the current block is derived based on a high-level node block that includes the current block and satisfies the predetermined condition. When there is no high-level node block that satisfies the predetermined condition, a merge candidate of the current block is derived based on the current block, a block that includes the current block and is of a predetermined size or larger, or a high-level node block that includes the current block and has a depth difference of one with the current block.
图22是示出了基于高级节点块导出合并候选的示例的图。FIG. 22 is a diagram showing an example of deriving merge candidates based on high-level node blocks.
通过基于二叉树对正方形块进行划分来生成块0和块1。可以基于依据包括块0和块1的高级节点块确定的相邻块(即,A0、A1、A2、A3和A4之中的至少一个)来导出块0和块1的合并候选。因此,块0和块1可以使用相同的空间合并候选。Block 0 and block 1 are generated by partitioning a square block based on a binary tree. Merge candidates of block 0 and block 1 may be derived based on neighboring blocks (i.e., at least one of A0, A1, A2, A3, and A4) determined from high-level node blocks including block 0 and block 1. Therefore, block 0 and block 1 may use the same spatial merge candidate.
可以通过基于二叉树对正方形块进行划分来生成包括块2和块3以及块4的高级节点块。另外,可以通过基于二叉树对非正方形形状的块进行划分来生成块2和块3。可以基于包括非正方形形状的块2、块3和块4的高级节点块来导出非正方形形状的块2、块3和块4的合并候选。也就是说,可以基于依据包括块2、块3和块4的正方形块的位置、宽度/高度或大小确定的相邻块(例如,B0、B1、B2、B3和B4之中的至少一个)来导出合并候选。因此,块2、块3和块4可以使用相同的空间合并候选。A high-level node block including block 2, block 3, and block 4 may be generated by partitioning a square block based on a binary tree. In addition, block 2 and block 3 may be generated by partitioning a non-square shaped block based on a binary tree. Merge candidates of non-square shaped blocks 2, block 3, and block 4 may be derived based on a high-level node block including non-square shaped blocks 2, block 3, and block 4. That is, a merge candidate may be derived based on an adjacent block (e.g., at least one of B0, B1, B2, B3, and B4) determined according to the position, width/height, or size of the square block including blocks 2, block 3, and block 4. Therefore, blocks 2, block 3, and block 4 may use the same spatial merge candidate.
可以基于高级节点块来导出非正方形形状的块的时间合并候选。例如,可以基于包括块0和块1的正方形块来导出块0和块1的时间合并候选。可以基于包括块2、块3和块4的正方形块来导出块2、块3和块4的时间合并候选。另外,可以使用从基于每个四叉树块确定的时间相邻块导出的相同的时间合并候选。Temporal merge candidates for non-square shaped blocks may be derived based on high-level node blocks. For example, temporal merge candidates for blocks 0 and 1 may be derived based on a square block including blocks 0 and 1. Temporal merge candidates for blocks 2, 3, and 4 may be derived based on a square block including blocks 2, 3, and 4. In addition, the same temporal merge candidates derived from temporal neighboring blocks determined based on each quadtree block may be used.
包括在高级节点块中的低级节点块可以共享空间合并候选和时间合并候选之中的至少一个。例如,包括在高级节点块中的低级节点块可以使用相同的合并候选列表。The lower-level node blocks included in the higher-level node block may share at least one of the spatial merge candidate and the temporal merge candidate. For example, the lower-level node blocks included in the higher-level node block may use the same merge candidate list.
替选地,可以基于低级节点块来导出空间合并候选和时间合并候选之中的至少一个,并且可以基于高级节点块来导出另一个。例如,可以基于高级节点块来导出块0和块1的空间合并候选。然而,可以基于块0来导出块0的时间合并候选,并且可以基于块1来导出块1的时间合并候选。Alternatively, at least one of the spatial merge candidate and the temporal merge candidate may be derived based on the low-level node block, and the other may be derived based on the high-level node block. For example, the spatial merge candidate of block 0 and block 1 may be derived based on the high-level node block. However, the temporal merge candidate of block 0 may be derived based on block 0, and the temporal merge candidate of block 1 may be derived based on block 1.
替选地,当低级节点块包括的样本的数目小于预定义数目时,基于包括预定义数目或更多的样本的高级节点块来导出合并候选。例如,当满足以下条件中的至少一个时:基于四叉树划分、二叉树划分和三叉树划分之中的至少一个生成的低级节点块中的至少一个小于预设大小的情况;低级节点块中的至少一个是非正方形块的情况;高级节点块不超过图片边界的情况;以及高级节点块的宽度或高度等于或大于预定义值的情况,基于包括预定义数目或更多的样本(例如,64、128或256个样本)的正方形或非正方形形状的高级节点块来导出合并候选。包括在高级节点块中的低级节点块可以共享基于高级节点块导出的合并候选。Alternatively, when the number of samples included in the low-level node block is less than a predefined number, a merge candidate is derived based on a high-level node block including a predefined number or more of samples. For example, when at least one of the following conditions is met: at least one of the low-level node blocks generated based on at least one of quadtree partitioning, binary tree partitioning, and ternary tree partitioning is less than a preset size; at least one of the low-level node blocks is a non-square block; the high-level node block does not exceed the picture boundary; and the width or height of the high-level node block is equal to or greater than a predefined value, a merge candidate is derived based on a square or non-square high-level node block including a predefined number or more of samples (e.g., 64, 128, or 256 samples). The low-level node blocks included in the high-level node block can share the merge candidates derived based on the high-level node block.
可以基于低级节点块中的任何一个来导出合并候选,并且其他低级节点块可以被设置成使用该合并候选。低级节点块可以包括在预定形状或预定大小或更大的块中。例如,低级节点块可以共享基于低级节点块中的任何一个导出的合并候选列表。可以通过比特流用信号发送作为合并候选的导出的基础的低级节点块的信息。该信息可以是指示低级节点块中的任何一个的索引信息。替选地,可以基于低级节点块的位置、大小、形状和扫描顺序之中的至少一个来确定作为合并候选的导出的基础的低级节点块。A merge candidate can be derived based on any one of the low-level node blocks, and other low-level node blocks can be set to use the merge candidate. The low-level node blocks may be included in blocks of a predetermined shape or a predetermined size or larger. For example, the low-level node blocks may share a merge candidate list derived based on any one of the low-level node blocks. Information of the low-level node blocks serving as the basis for derivation of the merge candidate may be signaled via a bitstream. The information may be index information indicating any one of the low-level node blocks. Alternatively, the low-level node blocks serving as the basis for derivation of the merge candidate may be determined based on at least one of the position, size, shape, and scanning order of the low-level node blocks.
可以通过比特流用信号发送指示低级节点块是否共享基于高级节点块导出的合并候选列表的信息。基于该信息,可以确定不处于预定形状的块或大小小于预定大小的的块的合并候选是否基于包括块的高级节点块来导出。替选地,根据在编码器和解码器中预定义的规则,可以确定是否基于高级节点块来导出合并候选。Information indicating whether a low-level node block shares a merge candidate list derived based on a high-level node block may be signaled through a bitstream. Based on this information, it may be determined whether a merge candidate for a block that is not in a predetermined shape or a block that is less than a predetermined size is derived based on a high-level node block including the block. Alternatively, it may be determined whether to derive a merge candidate based on a high-level node block according to rules predefined in an encoder and a decoder.
当在预定义区域内存在与当前块邻近的相邻块时,确定该相邻块不可用作为空间合并候选。预定义区域可以是被定义用于块之间的并行处理的并行处理区域。并行处理区域可以被称为合并估计区域(MER)。例如,当与当前块邻近的相邻块被包括在与当前块相同的合并估计区域中时,确定该相邻块不可用。可以执行移位操作以便确定当前块和相邻块是否包括在同一合并估计区域中。具体地,基于通过移位当前块的左上参考样本的位置获得的值是否与通过移位相邻块的左上参考样本的位置获得的值相同,可以确定当前块和相邻块是否包括在同一合并估计区域中。When there is a neighboring block adjacent to the current block within a predefined area, it is determined that the neighboring block is not available as a spatial merging candidate. The predefined area may be a parallel processing area defined for parallel processing between blocks. The parallel processing area may be referred to as a merge estimation region (MER). For example, when a neighboring block adjacent to the current block is included in the same merge estimation region as the current block, it is determined that the neighboring block is not available. A shift operation may be performed to determine whether the current block and the neighboring block are included in the same merge estimation region. Specifically, based on whether the value obtained by shifting the position of the upper left reference sample of the current block is the same as the value obtained by shifting the position of the upper left reference sample of the adjacent block, it may be determined whether the current block and the adjacent block are included in the same merge estimation region.
图23是示出了基于合并估计区域来确定空间相邻块的可用性的示例的图。FIG. 23 is a diagram showing an example of determining the availability of spatially neighboring blocks based on a merged estimated region.
在图23中,示出了合并估计区域处于Nx2N形状。In FIG. 23 , it is shown that the merged estimation area is in an Nx2N shape.
可以基于与块1邻近的空间相邻块来导出块1的合并候选。空间相邻块可以包括B0、B1、B2、B3和B4。在本文中,可以确定与块1包括在相同的合并估计区域中的空间相邻块B0和B3不可用作合并候选。因此,可以从除了空间相邻块B0和B3之外的空间相邻块B1、B2和B4中的至少一个来导出块1的合并候选。A merge candidate for block 1 may be derived based on a spatial neighboring block adjacent to block 1. The spatial neighboring blocks may include B0, B1, B2, B3, and B4. Herein, it may be determined that the spatial neighboring blocks B0 and B3 included in the same merge estimation region as block 1 are not available as merge candidates. Therefore, a merge candidate for block 1 may be derived from at least one of the spatial neighboring blocks B1, B2, and B4 other than the spatial neighboring blocks B0 and B3.
可以基于与块3邻近的空间相邻块来导出块3的合并候选。空间相邻块可以包括C0、C1、C2、C3和C4。在本文中,可以确定与块3包括在相同的合并估计区域中的空间相邻块C0不可用作为合并候选。因此,可以从除了空间相邻块C0之外的空间相邻块C1、C2、C3和C4中的至少一个来导出块3的合并候选。A merge candidate for block 3 may be derived based on a spatial neighboring block adjacent to block 3. The spatial neighboring blocks may include C0, C1, C2, C3, and C4. Herein, it may be determined that the spatial neighboring block C0 included in the same merge estimation region as block 3 is not available as a merge candidate. Therefore, a merge candidate for block 3 may be derived from at least one of the spatial neighboring blocks C1, C2, C3, and C4 other than the spatial neighboring block C0.
基于合并估计区域的位置、大小、宽度和高度之中的至少一个,可以导出合并估计区域中包括的块的合并候选。例如,可以从基于合并估计区域的位置、大小、宽度和高度之中的至少一个确定的空间相邻块和时间相邻块之中的至少一个来导出包括在合并估计区域中的多个块的合并候选。合并估计区域中包括的块可以共享相同的合并候选。Based on at least one of the position, size, width, and height of the merge estimation region, a merge candidate of a block included in the merge estimation region may be derived. For example, a merge candidate of a plurality of blocks included in the merge estimation region may be derived from at least one of a spatial neighboring block and a temporal neighboring block determined based on at least one of the position, size, width, and height of the merge estimation region. The blocks included in the merge estimation region may share the same merge candidate.
图24是示出了基于合并估计区域导出合并候选的示例的图。FIG. 24 is a diagram showing an example of deriving a merge candidate based on a merge estimation region.
当在合并估计区域中包括多个编码单元时,可以基于合并估计区域来导出多个编码单元的合并候选。也就是说,通过将合并估计区域用作编码单元,可以基于合并估计区域的位置、大小或宽度/高度来导出合并候选。When a plurality of coding units are included in a merge estimation region, merge candidates of the plurality of coding units may be derived based on the merge estimation region. That is, by using the merge estimation region as a coding unit, merge candidates may be derived based on the position, size, or width/height of the merge estimation region.
例如,可以基于合并估计区域来导出均处于(n/2)xN(在本文中,n是N/2)大小并且包括在处于(N/2)xN大小的合并估计区域中的编码单元0(CU0)和编码单元1(CU1)两者的合并候选。也就是说,可以根据与合并估计区域邻近的相邻块C0、C1、C2、C3和C4中的至少一个导出编码单元0和编码单元1的合并候选。For example, merge candidates of both coding unit 0 (CU0) and coding unit 1 (CU1), which are both in (n/2)xN (herein, n is N/2) size and included in the merge estimation region in the (N/2)xN size, may be derived based on the merge estimation region. That is, merge candidates of coding unit 0 and coding unit 1 may be derived based on at least one of neighboring blocks C0, C1, C2, C3, and C4 adjacent to the merge estimation region.
例如,可以基于合并估计区域来导出包括在处于NxN大小的合并估计区域中的处于nxn大小的编码单元2(CU2)、编码单元3(CU3)、编码单元4(CU4)和编码单元5(CU5)的合并候选。也就是说,可以根据与合并估计区域邻近的相邻块C0、C1、C2、C3和C4中的至少一个来导出编码单元2、编码单元3、编码单元4和编码单元5的合并候选。For example, merging candidates of coding unit 2 (CU2), coding unit 3 (CU3), coding unit 4 (CU4), and coding unit 5 (CU5) in an nxn size included in a merging estimation region in an NxN size may be derived based on the merging estimation region. That is, merging candidates of coding unit 2, coding unit 3, coding unit 4, and coding unit 5 may be derived based on at least one of neighboring blocks C0, C1, C2, C3, and C4 adjacent to the merging estimation region.
合并估计区域的形状可以是正方形形状或非正方形形状。例如,可以确定正方形形状的编码单元(或预测单元)或非正方形形状的编码单元(或预测单元)是合并估计区域。合并估计区域的宽度和高度之间的比可以被限制为不超过预定范围。例如,合并估计区域不能具有宽度和高度之间的比超过2的非正方形形状,或者宽度和高度之间的比小于1/2的非正方形形状。也就是说,非正方形合并估计区域可以处于2NxN或Nx2N的形状。可以通过比特流用信号发送关于对宽度和高度之间的比的限制的信息。替选地,可以在编码器和解码器中预定义对宽度和高度之间的比的限制。The shape of the merged estimation area may be a square shape or a non-square shape. For example, it may be determined that a square-shaped coding unit (or prediction unit) or a non-square-shaped coding unit (or prediction unit) is a merged estimation area. The ratio between the width and height of the merged estimation area may be limited to not exceed a predetermined range. For example, the merged estimation area cannot have a non-square shape with a ratio between width and height exceeding 2, or a non-square shape with a ratio between width and height less than 1/2. That is, the non-square merged estimation area may be in the shape of 2NxN or Nx2N. Information about the limitation on the ratio between width and height may be signaled via a bitstream. Alternatively, the limitation on the ratio between width and height may be predefined in the encoder and decoder.
可以通过比特流用信号发送指示合并估计区域的形状的信息以及指示合并估计区域的大小的信息之中的至少一个。例如,可以通过片头、图块组头、图片参数或序列参数用信号发送指示合并估计区域的形状的信息和指示合并估计区域的大小的信息之中的至少一个。At least one of information indicating the shape of the merged estimation region and information indicating the size of the merged estimation region may be signaled through the bitstream. For example, at least one of information indicating the shape of the merged estimation region and information indicating the size of the merged estimation region may be signaled through a slice header, a tile group header, a picture parameter, or a sequence parameter.
可以以每个序列为基础、以每个图片为基础、以每个切片为基础、以每个图块组为基础、以每个图块或每个块(CTU)为基础来更新合并估计区域的形状或合并估计区域的大小。当合并估计区域的形状或合并估计区域的大小与先前单元的形状或大小不同时,通过比特流用信号发送指示合并估计区域的新形状或合并估计区域的新大小的信息。The shape of the merged estimation area or the size of the merged estimation area may be updated on a per-sequence basis, on a per-picture basis, on a per-slice basis, on a per-tile group basis, on a per-tile basis, or on a per-block (CTU) basis. When the shape of the merged estimation area or the size of the merged estimation area is different from the shape or size of the previous unit, information indicating the new shape of the merged estimation area or the new size of the merged estimation area is signaled through the bitstream.
在合并估计区域中可以包括至少一个块。合并估计区域中包括的块可以处于正方形形状或非正方形形状。可以确定合并估计区域能够包括的块的最大数目或最小数目。例如,可以在合并估计区域中包括三个、四个或更多个CU。该确定可以基于通过比特流用信号发送的信息。替选地,可以在编码器和解码器中预定义合并估计区域能够包括的块的最大数目或最小数目。At least one block may be included in the merged estimation area. The blocks included in the merged estimation area may be in a square shape or a non-square shape. The maximum number or minimum number of blocks that the merged estimation area can include may be determined. For example, three, four or more CUs may be included in the merged estimation area. The determination may be based on information signaled by the bitstream. Alternatively, the maximum number or minimum number of blocks that the merged estimation area can include may be predefined in the encoder and the decoder.
在合并估计区域中包括的块的数目小于最大数目的情况以及该数目大于最小数目的情况之中的至少一种情况下,可以允许块的并行处理。例如,当在合并估计区域中包括的块的数目等于或小于最大数目时,或者当在合并估计区域中包括的块的数目等于或大于最小数目时,基于合并估计区域来导出块的合并候选。当合并估计区域中包括的块的数目大于最大数目时,或者当合并估计区域中包括的块的数目小于最小数目时,基于块中的每个块的大小、位置、宽度或高度导出块中的每个块的合并候选。In at least one of a case where the number of blocks included in the merge estimation region is less than the maximum number and a case where the number is greater than the minimum number, parallel processing of the blocks may be allowed. For example, when the number of blocks included in the merge estimation region is equal to or less than the maximum number, or when the number of blocks included in the merge estimation region is equal to or greater than the minimum number, a merge candidate of the block is derived based on the merge estimation region. When the number of blocks included in the merge estimation region is greater than the maximum number, or when the number of blocks included in the merge estimation region is less than the minimum number, a merge candidate of each block in the block is derived based on the size, position, width, or height of each block in the block.
指示合并估计区域的形状的信息可以包括1比特标志。例如,语法“isrectagular_mer_flag”可以指示正方形形状或非正方形形状的合并候选区域。isrectagular_mer_flag值为1可以指示非正方形形状的合并估计区域,而isrectagular_mer_flag值为0可以指示正方形形状的合并估计区域。The information indicating the shape of the merged estimation region may include a 1-bit flag. For example, the syntax "isrectagular_mer_flag" may indicate a square-shaped or non-square-shaped merged candidate region. An isrectagular_mer_flag value of 1 may indicate a non-square-shaped merged estimation region, while an isrectagular_mer_flag value of 0 may indicate a square-shaped merged estimation region.
当该信息指示非正方形形状的合并估计区域时,通过比特流用信号发送指示合并估计区域的宽度、高度以及宽度与高度之间的比之中的至少一个的信息。基于此,可以确定合并估计区域的大小和/或形状。When the information indicates a non-square shaped merged estimation region, information indicating at least one of a width, a height, and a ratio between the width and the height of the merged estimation region is signaled through the bitstream. Based on this, the size and/or shape of the merged estimation region can be determined.
接下来,根据本公开内容的实施方式,将详细地描述基于仿射运动模型的帧间预测方法。Next, according to an embodiment of the present disclosure, an inter-frame prediction method based on an affine motion model will be described in detail.
可以将对象的运动分类为平移运动、旋转运动和仿射运动。平移运动表示对象的线性移动。旋转运动表示对象的旋转移动。仿射运动表示对于对象的每个部分,移动、旋转或位移都不同。The motion of an object can be categorized into translational motion, rotational motion, and affine motion. Translational motion refers to the linear movement of an object. Rotational motion refers to the rotational movement of an object. Affine motion means that the movement, rotation, or displacement is different for each part of the object.
图25是示出了运动模型的图。FIG. 25 is a diagram showing a motion model.
图25(a)示出了平移运动模型。图25(b)示出了旋转运动模型。图25(c)示出了仿射运动模型。Figure 25(a) shows a translational motion model. Figure 25(b) shows a rotational motion model. Figure 25(c) shows an affine motion model.
在平移运动模型中,对象的线性运动可以用2D坐标和/或运动向量(MVx,MVy)表示。In the translational motion model, the linear motion of an object can be represented by 2D coordinates and/or motion vectors (MVx, MVy).
在旋转运动模型中,对象的运动可以用预定的旋转角度来表示。In the rotational motion model, the motion of an object can be represented by a predetermined rotation angle.
另一方面,在仿射运动模型中,由于对象的运动是非线性的,因此对于对象的每个部分,移动、旋转或位移中的至少一个可以不同。在仿射运动模型中,可以基于对象的每个部分的移动、旋转或位移的调整来表示对象的运动。例如,可以通过使用预定参数(a至f)来表示仿射运动模型,如在以下公式1中的。On the other hand, in the affine motion model, since the motion of the object is nonlinear, at least one of the movement, rotation or displacement may be different for each part of the object. In the affine motion model, the motion of the object may be represented based on the adjustment of the movement, rotation or displacement of each part of the object. For example, the affine motion model may be represented by using predetermined parameters (a to f), as in the following formula 1.
【公式1】[Formula 1]
x′=ax+by+ex′=ax+by+e
y′=cx+dy+fy′=cx+dy+f
在公式1中,x和y表示包括在当前块中的样本的位置,并且x'和y'表示包括在参考块中的样本的位置。可以如在公式2中表示作为当前块中的样本与参考块的样本之间的位置差的仿射运动向量(Vx,Vy)。In Formula 1, x and y represent positions of samples included in the current block, and x' and y' represent positions of samples included in the reference block. An affine motion vector ( Vx , Vy ) that is a position difference between samples in the current block and samples of the reference block may be represented as in Formula 2.
【公式2】[Formula 2]
Vx=x-x′Vx=x-x′
Vy=y-y′Vy=y-y′
可以如在以下公式3中通过使用公式1和公式2来导出仿射运动向量(Vx,Vy)。The affine motion vector (V x , V y ) may be derived by using Formula 1 and Formula 2 as in Formula 3 below.
【公式3】[Formula 3]
Vx=(1-a)x-by-eVx=(1-a)x-by-e
y=(1-d)y-cx-fy=(1-d)y-cx-f
可以通过仿射运动模型来表达对象的复杂运动。但是,与平移运动模型或旋转运动模型相比,在仿射运动模型中,编码/解码效率可能由于应当对更多参数进行编码以表达对象的运动而降低。为了解决该问题,当基于仿射运动模型执行运动预测和/或运动补偿时,可以使用当前块角的运动向量。具体地,在将当前块划分为多个子块之后,可以通过使用多个角运动向量来确定每个划分的子块的运动向量。在下文中,将详细地描述使用角运动向量的仿射帧间预测方法。The complex motion of an object can be expressed by an affine motion model. However, compared with a translation motion model or a rotation motion model, in an affine motion model, the encoding/decoding efficiency may be reduced because more parameters should be encoded to express the motion of an object. In order to solve this problem, when motion prediction and/or motion compensation are performed based on an affine motion model, a motion vector of a current block angle may be used. Specifically, after the current block is divided into a plurality of sub-blocks, a motion vector of each divided sub-block may be determined by using a plurality of angular motion vectors. Hereinafter, an affine inter-frame prediction method using an angular motion vector will be described in detail.
图26是示出了使用角运动向量的仿射运动模型的图。FIG. 26 is a diagram showing an affine motion model using angular motion vectors.
在仿射运动模型中,可以使用当前块的左上角、右上角、左下角或右下角中的至少一个的运动向量。在示例中,可以通过使用在当前块的左上角处的运动向量v0和在当前块的右上角处的运动向量v1来执行当前块的运动预测和/或运动补偿。替选地,可以通过使用在当前块的左上角处的运动向量v0、在当前块的右上角处的运动向量v1和在当前块的左下角处的运动向量v2来执行当前块的运动预测和/或运动补偿。In the affine motion model, a motion vector of at least one of the upper left corner, the upper right corner, the lower left corner, or the lower right corner of the current block may be used. In an example, motion prediction and/or motion compensation of the current block may be performed by using a motion vector v0 at the upper left corner of the current block and a motion vector v1 at the upper right corner of the current block. Alternatively, motion prediction and/or motion compensation of the current block may be performed by using a motion vector v0 at the upper left corner of the current block, a motion vector v1 at the upper right corner of the current block, and a motion vector v2 at the lower left corner of the current block.
当使用三个角运动向量时,可以表达将当前块改变为以下矩形,该矩形的两个边通过连接参考图片中的由当前块的三个角运动向量指示的像素而形成。换言之,可以估计矩形作为当前块的参考块,该矩阵的两个边通过连接参考图片中的由三个角运动向量指示的像素而形成。When three angular motion vectors are used, it can be expressed that the current block is changed into a rectangle whose two sides are formed by connecting pixels indicated by the three angular motion vectors of the current block in the reference picture. In other words, a rectangle whose two sides are formed by connecting pixels indicated by the three angular motion vectors in the reference picture can be estimated as the reference block of the current block.
当使用三个角运动向量时,可以基于以下公式4来确定当前块中的每个子块的运动向量。When three angular motion vectors are used, the motion vector of each subblock in the current block may be determined based on Formula 4 below.
【公式4】[Formula 4]
在公式4中,w和h分别表示当前块的宽度和高度。x和y表示子块的位置。子块的位置可以是子块中的预定义样本的位置。预定义样本可以是左上样本、左下样本、右上样本或中心样本。In Formula 4, w and h represent the width and height of the current block, respectively. x and y represent the position of the sub-block. The position of the sub-block may be the position of a predefined sample in the sub-block. The predefined sample may be an upper left sample, a lower left sample, an upper right sample, or a center sample.
当使用三个角运动向量时,基于总共6个运动向量参数来导出子块的运动向量。因此,使用三个角运动向量的仿射帧间预测可以被称为6参数模式。When three angular motion vectors are used, the motion vector of the subblock is derived based on a total of 6 motion vector parameters. Therefore, affine inter prediction using three angular motion vectors can be referred to as 6-parameter mode.
当使用两个角运动向量时,可以表达将当前块改变为矩形,该矩形的边通过连接参考图片中的由当前块的两个角运动向量指示的像素而形成。换言之,可以估计矩形作为当前块的参考块,该矩阵的边通过连接参考图片中的由两个角运动向量指示的像素而形成。When two angular motion vectors are used, it can be expressed that the current block is changed into a rectangle whose sides are formed by connecting pixels indicated by two angular motion vectors of the current block in the reference picture. In other words, a rectangle whose sides are formed by connecting pixels indicated by two angular motion vectors in the reference picture can be estimated as a reference block of the current block.
如在图26中所示的示例中的,在左下角的运动向量、左上角的运动向量和右上角的运动向量之间建立以下公式5的关系。As in the example shown in FIG. 26 , the relationship of the following Formula 5 is established among the motion vector of the lower left corner, the motion vector of the upper left corner, and the motion vector of the upper right corner.
【公式5】[Formula 5]
v2x=v0x+v0y-v1y v 2x = v 0x + v 0y - v 1y
v2y=-v0x+v0y+v1x v 2y = -v 0x +v 0y +v 1x
基于公式5,可以如以下公式6一样改变公式4。Based on Formula 5, Formula 4 may be changed as in the following Formula 6.
【公式6】[Formula 6]
当使用两个角运动向量时,可以基于公式6来确定当前块中的每个子块的运动向量。When two angular motion vectors are used, the motion vector of each subblock in the current block may be determined based on Formula 6.
当使用两个角运动向量时,基于总共4个运动向量参数来导出子块的运动向量。因此,使用两个角运动向量的仿射帧间预测可以被称为4参数模式。When two angular motion vectors are used, the motion vector of the sub-block is derived based on a total of 4 motion vector parameters. Therefore, affine inter prediction using two angular motion vectors can be called 4-parameter mode.
图27是示出了以子块为单位确定运动向量的示例的图。FIG. 27 is a diagram showing an example of determining a motion vector in units of sub-blocks.
可以将当前块划分为多个子块,并且可以基于角运动向量来获得每个子块的运动向量。基于子块的运动向量,可以执行子块的运动补偿。The current block may be divided into a plurality of sub-blocks, and a motion vector of each sub-block may be obtained based on the angular motion vector. Based on the motion vector of the sub-block, motion compensation of the sub-block may be performed.
可以基于当前块的大小和/或形状来确定当前块中的子块的数目。在这种情况下,当前块的大小可以用宽度、高度、宽度与高度的和或宽度与高度的积来表示。当前块的形状可以表示当前块是否为正方形、当前块是否为非正方形、宽度是否大于高度或宽度与高度的比中的至少一个。The number of sub-blocks in the current block may be determined based on the size and/or shape of the current block. In this case, the size of the current block may be represented by width, height, the sum of the width and the height, or the product of the width and the height. The shape of the current block may represent at least one of whether the current block is square, whether the current block is non-square, whether the width is greater than the height, or the ratio of the width to the height.
在示例中,在当前块的大小小于阈值时,可以将当前块划分为具有第一大小的子块。另一方面,在当前块的大小大于阈值时,可以将当前块划分具有第二大小的子块。在这种情况下,阈值可以是诸如8、16、32或64的整数。第一大小可以是4x4、8x8或16x16,并且第二大小可以是大于第一大小的值。对于详细的示例,在当前块的大小是16x16时,可以将当前块划分为四个具有8x8大小的子块。另一方面,在当前块的大小大于16x16(例如,32x32或64x64)时,可以将当前块划分为具有16x16大小的子块。In the example, when the size of the current block is less than a threshold value, the current block may be divided into sub-blocks having a first size. On the other hand, when the size of the current block is greater than a threshold value, the current block may be divided into sub-blocks having a second size. In this case, the threshold value may be an integer such as 8, 16, 32, or 64. The first size may be 4x4, 8x8, or 16x16, and the second size may be a value greater than the first size. For a detailed example, when the size of the current block is 16x16, the current block may be divided into four sub-blocks having a size of 8x8. On the other hand, when the size of the current block is greater than 16x16 (e.g., 32x32 or 64x64), the current block may be divided into sub-blocks having a size of 16x16.
替选地,可以使用固定大小的子块,而不管当前块的大小如何。在这种情况下,根据当前块的大小,当前块中包括的子块的数目可以不同。Alternatively, a sub-block of a fixed size may be used regardless of the size of the current block. In this case, the number of sub-blocks included in the current block may be different depending on the size of the current block.
替选地,可以以比特流用信号发送表示子块的大小的信息。该信息可以以图片级别、切片级别或块级别来用信号发送。Alternatively, information indicating the size of the sub-block may be signaled in the bitstream. This information may be signaled at a picture level, a slice level, or a block level.
可以以比特流用信号发送用于确定用于仿射帧间预测的角的位置或运动向量参数的数目中的至少一个的信息。在示例中,可以以比特流用信号发送表示运动向量参数的数目是4还是6的信息。当该信息表示运动向量参数的数目是4时,可以通过使用左上角的运动向量和右上角的运动向量来执行运动补偿。当该信息表示运动向量参数的数目是6时,可以通过使用左上角的运动向量、右上角的运动向量和左下角的运动向量来执行运动补偿。Information for determining at least one of the position of a corner or the number of motion vector parameters for affine inter prediction may be signaled in a bitstream. In an example, information indicating whether the number of motion vector parameters is 4 or 6 may be signaled in a bitstream. When the information indicates that the number of motion vector parameters is 4, motion compensation may be performed by using a motion vector of an upper left corner and a motion vector of an upper right corner. When the information indicates that the number of motion vector parameters is 6, motion compensation may be performed by using a motion vector of an upper left corner, a motion vector of an upper right corner, and a motion vector of a lower left corner.
替选地,可以以比特流用信号发送用于指定当前块的四个角之中的三个角的位置的信息或用于指定当前块的四个角之中的两个角的位置的信息。Alternatively, information for specifying the positions of three corners among the four corners of the current block or information for specifying the positions of two corners among the four corners of the current block may be signaled in a bitstream.
在另一示例中,基于当前块的大小、形状或帧间预测模式中的至少一个,可以确定运动向量参数的数目。在这种情况下,当前块的大小可以用宽度、高度、宽度与高度的和或宽度与高度的积来表示。当前块的形状可以表示当前块是否为正方形、当前块是否为非正方形、宽度是否大于高度或宽度与高度的比中的至少一个。帧间预测模式包括合并模式和/或AMVP模式。In another example, the number of motion vector parameters may be determined based on at least one of the size, shape, or inter prediction mode of the current block. In this case, the size of the current block may be represented by width, height, the sum of the width and the height, or the product of the width and the height. The shape of the current block may represent at least one of whether the current block is square, whether the current block is non-square, whether the width is greater than the height, or the ratio of the width to the height. The inter prediction mode includes a merge mode and/or an AMVP mode.
在示例中,根据当前块是否为正方形,可以不同地确定运动向量参数的数目。在示例中,在当前块是正方形(例如,NxN)时,可以通过使用三个角运动向量来执行仿射预测。在当前块是非正方形(例如,Nx2N或2NxN)时,可以通过使用两个角运动向量来执行仿射预测。In an example, the number of motion vector parameters may be determined differently depending on whether the current block is a square. In an example, when the current block is a square (e.g., NxN), affine prediction may be performed by using three angular motion vectors. When the current block is a non-square (e.g., Nx2N or 2NxN), affine prediction may be performed by using two angular motion vectors.
替选地,根据将当前块的大小与阈值进行比较的结果,可以确定运动向量参数的数目。在示例中,在当前块的大小大于阈值时,可以通过使用三个角运动向量来执行仿射预测。在当前块的大小小于阈值时,可以通过使用两个角运动向量来执行仿射预测。阈值可以是编码器/解码器中的预定义值。替选地,可以以比特流用信号发送表示阈值的信息。可以以序列级别、图片级别、切片级别或块级别来用信号发送该信息。Alternatively, the number of motion vector parameters may be determined based on the result of comparing the size of the current block with a threshold. In an example, when the size of the current block is greater than the threshold, affine prediction may be performed by using three angular motion vectors. When the size of the current block is less than the threshold, affine prediction may be performed by using two angular motion vectors. The threshold may be a predefined value in an encoder/decoder. Alternatively, information representing the threshold may be signaled in a bitstream. The information may be signaled at a sequence level, a picture level, a slice level, or a block level.
替选地,左上角的运动向量可以用作默认值,并且可以基于当前块的宽度和/或高度来确定是否使用右上角的运动向量和/或是否使用左下角的运动向量。在示例中,基于当前块的宽度是否等于或大于阈值,可以确定是否使用右上角的运动向量。另外,基于当前块的宽度是否等于或大于阈值,可以确定是否使用左下角的运动向量。Alternatively, the motion vector of the upper left corner may be used as a default value, and whether to use the motion vector of the upper right corner and/or whether to use the motion vector of the lower left corner may be determined based on the width and/or height of the current block. In an example, whether to use the motion vector of the upper right corner may be determined based on whether the width of the current block is equal to or greater than a threshold. In addition, whether to use the motion vector of the lower left corner may be determined based on whether the width of the current block is equal to or greater than a threshold.
在另一示例中,基于当前块的大小、形状或帧间预测模式中的至少一个,可以确定角的位置。In another example, the position of the corner may be determined based on at least one of the size, shape, or inter-prediction mode of the current block.
图28是示出了根据当前块的形状确定角的位置的示例的图。FIG. 28 is a diagram showing an example of determining the position of a corner according to the shape of a current block.
在当前块具有高度长于宽度的形状(Nx2N)时,可以通过使用左上角的运动向量和左下角的运动向量来执行仿射预测。(参照图28(a))When the current block has a shape (Nx2N) with a height longer than a width, affine prediction can be performed by using a motion vector of the upper left corner and a motion vector of the lower left corner. (Refer to FIG. 28(a))
在当前块具有宽度长于高度的形状(2NxN)时,可以通过使用左上角的运动向量和右上角的运动向量来执行仿射预测。(参照图28(b))When the current block has a shape (2NxN) with a width longer than a height, affine prediction can be performed by using a motion vector of the upper left corner and a motion vector of the upper right corner. (Refer to FIG. 28(b))
在后面提及的实施方式中,角运动向量被称为仿射向量。另外,可以通过将序数缀于仿射向量前来标识多个角处的每个仿射向量。在示例中,第一仿射向量表示第一角的仿射向量,第二仿射向量表示第二角的仿射向量,并且第三仿射向量表示第三角的仿射向量。另外,基于仿射向量导出的每个子块的运动向量被称为仿射运动向量。In the embodiments mentioned later, the angular motion vector is referred to as an affine vector. In addition, each affine vector at multiple angles can be identified by prefixing an ordinal number to the affine vector. In the example, the first affine vector represents the affine vector of the first angle, the second affine vector represents the affine vector of the second angle, and the third affine vector represents the affine vector of the third angle. In addition, the motion vector of each sub-block derived based on the affine vector is referred to as an affine motion vector.
当基于仿射运动向量执行当前块(例如,编码块或预测块)的运动补偿时,可以将其定义为仿射帧间模式。When motion compensation of a current block (eg, a coding block or a prediction block) is performed based on an affine motion vector, it may be defined as an affine inter mode.
基于当前块的大小和/或形状,可以确定是否允许仿射帧间模式。在示例中,在当前块的大小小于阈值时,仿射帧间模式可以不被允许。替选地,在当前块是非正方形时,仿射帧间模式可以不被允许。在详细的示例中,仅在当前块是正方形并且其大小等于或大于16x16时,才可以允许仿射帧间模式。Based on the size and/or shape of the current block, it may be determined whether the affine inter mode is allowed. In an example, the affine inter mode may not be allowed when the size of the current block is less than a threshold. Alternatively, the affine inter mode may not be allowed when the current block is non-square. In a detailed example, the affine inter mode may be allowed only when the current block is square and its size is equal to or greater than 16x16.
可以以比特流用信号发送指示是否将仿射帧间模式应用于当前块的信息。在当前块的编码模式被确定为帧间模式时,可以用信号发送该信息。当对于当前块不允许仿射帧间模式时,可以省略对该信息的编码。该信息可以是1比特标志。在示例中,当该标志为1时,表示仿射帧间模式被应用,而当该标志为0时,表示仿射帧间模式未被应用。替选地,该信息可以是指示多个运动模型中的任何一个的索引。Information indicating whether the affine inter mode is applied to the current block may be signaled in a bitstream. The information may be signaled when the coding mode of the current block is determined to be the inter mode. When the affine inter mode is not allowed for the current block, encoding of the information may be omitted. The information may be a 1-bit flag. In an example, when the flag is 1, it indicates that the affine inter mode is applied, and when the flag is 0, it indicates that the affine inter mode is not applied. Alternatively, the information may be an index indicating any one of a plurality of motion models.
在下文中,将详细地描述基于仿射帧间模式的运动补偿处理。Hereinafter, the motion compensation process based on the affine inter mode will be described in detail.
图29是示出了在仿射帧间模式下的运动补偿处理的流程图。FIG. 29 is a flowchart showing the motion compensation process in the affine inter mode.
可以确定用于仿射帧间模式的角的位置或角运动向量参数的数目中的至少一个S2910。可以以比特流用信号发送用于确定角的位置或角运动向量的数目中的至少一个的信息。替选地,基于当前块的大小、形状或帧间预测模式中的至少一个,可以确定角的位置或角运动向量的数目中的至少一个。At least one of the position of the corner or the number of angular motion vector parameters for the affine inter mode may be determined S2910. Information for determining at least one of the position of the corner or the number of angular motion vectors may be signaled in a bitstream. Alternatively, at least one of the position of the corner or the number of angular motion vectors may be determined based on at least one of the size, shape, or inter prediction mode of the current block.
基于相邻块的运动向量,可以导出在每个角处的仿射向量S2920。具体地,可以从相邻块的仿射向量或相邻块的平移运动向量导出每个角处的仿射向量。Based on the motion vector of the neighboring block, an affine vector at each corner may be derived S2920. Specifically, the affine vector at each corner may be derived from the affine vector of the neighboring block or the translation motion vector of the neighboring block.
图30和图31是示出基于相邻块的运动向量来导出当前块的仿射向量的示例的图。30 and 31 are diagrams showing examples of deriving an affine vector of a current block based on motion vectors of neighboring blocks.
图30示出了4参数模式,并且图31示出了6参数模式。图30(a)表示使用左上角的仿射向量和右上角的仿射向量的4参数模式,并且图30(b)表示使用左上角的仿射向量和左下角的仿射向量的4参数模式。Fig. 30 shows a 4-parameter mode, and Fig. 31 shows a 6-parameter mode. Fig. 30(a) shows a 4-parameter mode using an affine vector at the upper left corner and an affine vector at the upper right corner, and Fig. 30(b) shows a 4-parameter mode using an affine vector at the upper left corner and an affine vector at the lower left corner.
可以基于与角邻近的相邻块的运动向量来获得角的仿射向量。在这种情况下,相邻块可以包括与角的上侧邻近的相邻块、与角的左侧邻近的相邻块或与角的对角线方向邻近的相邻块中的至少一个。The affine vector of the corner can be obtained based on the motion vector of the neighboring block adjacent to the corner. In this case, the neighboring block may include at least one of the neighboring block adjacent to the upper side of the corner, the neighboring block adjacent to the left side of the corner, or the neighboring block adjacent to the diagonal direction of the corner.
在图30(a)、图30(b)和图31中所示的示例中,可以基于与左上角邻近的相邻块A、B或C中的至少一个来导出左上角的仿射向量。可以基于与右上角邻近的相邻块D或E中的至少一个来导出右上角的仿射向量。可以基于与左下角邻近的相邻块F或G中的至少一个来导出左下角的仿射向量。In the examples shown in FIG. 30( a), FIG. 30( b), and FIG. 31 , the affine vector of the upper left corner may be derived based on at least one of the neighboring blocks A, B, or C adjacent to the upper left corner. The affine vector of the upper right corner may be derived based on at least one of the neighboring blocks D or E adjacent to the upper right corner. The affine vector of the lower left corner may be derived based on at least one of the neighboring blocks F or G adjacent to the lower left corner.
在以预定义的顺序搜索相邻块之后,可以基于首先被确定为可用的相邻块的运动向量来导出角的仿射向量。在图30(a)、图30(b)和图31中所示的示例中,可以基于当顺序搜索与左上角邻近的相邻块A、B和C时首先被确定为可用的相邻块的运动向量来导出左上角的仿射向量。可以基于当顺序搜索与右上角邻近的相邻块D和E时首先被确定为可用的相邻块的运动向量来导出右上角的仿射向量。可以基于当顺序搜索与左下角邻近的相邻块F和G时首先被确定为可用的相邻块的运动向量来导出左下角的仿射向量。After searching the adjacent blocks in a predefined order, the affine vector of the corner can be derived based on the motion vector of the adjacent block that is first determined to be available. In the examples shown in Figures 30 (a), 30 (b) and 31, the affine vector of the upper left corner can be derived based on the motion vector of the adjacent block that is first determined to be available when the adjacent blocks A, B and C adjacent to the upper left corner are sequentially searched. The affine vector of the upper right corner can be derived based on the motion vector of the adjacent block that is first determined to be available when the adjacent blocks D and E adjacent to the upper right corner are sequentially searched. The affine vector of the lower left corner can be derived based on the motion vector of the adjacent block that is first determined to be available when the adjacent blocks F and G adjacent to the lower left corner are sequentially searched.
替选地,可以以比特流用信号发送用于指定接近每个角的相邻块中的任何一个的信息。在示例中,可以以比特流用信号发送用于标识与左上角邻近的相邻块之一的信息、用于标识与右上角邻近的相邻块之一的信息或用于标识与左下角邻近的相邻块之一的信息。可以基于由该信息指定的相邻块的运动向量来确定角的仿射向量。Alternatively, information for specifying any one of the neighboring blocks close to each corner may be signaled in the bitstream. In an example, information for identifying one of the neighboring blocks adjacent to the upper left corner, information for identifying one of the neighboring blocks adjacent to the upper right corner, or information for identifying one of the neighboring blocks adjacent to the lower left corner may be signaled in the bitstream. The affine vector of the corner may be determined based on the motion vector of the neighboring block specified by the information.
可以根据不与角邻近的非邻近块导出仿射向量。非邻近块可以包括与邻近角的块在同一条线上的块或与当前块邻近的块之中的不与角邻近的块中的至少一个。在示例中,在图30和图31中所示的示例中,可以基于除了相邻块A、B和C之外的块(例如,相邻块D、E、F或G)或与相邻块A、B或C在同一条线上的块来导出左上角的仿射向量。The affine vector may be derived based on a non-adjacent block that is not adjacent to the corner. The non-adjacent block may include at least one of a block that is on the same line as the block adjacent to the corner or a block that is not adjacent to the corner among blocks adjacent to the current block. In an example, in the examples shown in FIGS. 30 and 31 , the affine vector of the upper left corner may be derived based on a block other than adjacent blocks A, B, and C (e.g., adjacent blocks D, E, F, or G) or a block on the same line as adjacent blocks A, B, or C.
角的仿射向量可以被设置为与相邻块的运动向量相同。替选地,可以将相邻块的运动向量设置为运动向量预测值,并且可以通过将运动向量差值与运动向量预测值相加来导出角的仿射向量。可以以比特流用信号发送表示仿射向量与运动向量预测值之间的差的运动向量差值。The affine vector of the angle may be set to be the same as the motion vector of the neighboring block. Alternatively, the motion vector of the neighboring block may be set to a motion vector predictor, and the affine vector of the angle may be derived by adding a motion vector difference to the motion vector predictor. A motion vector difference representing the difference between the affine vector and the motion vector predictor may be signaled in a bitstream.
在另一示例中,基于第一仿射向量和第二仿射向量的差编码,可以导出第二仿射向量。为此,可以在比特流中对表示第二仿射向量与第一仿射向量之间的差的差向量进行编码。解码器可以通过将在比特流中解码的差向量与第一仿射向量相加来导出第二仿射向量。当使用三个角的仿射向量时,可以基于第三仿射向量与第一仿射向量之间的差编码或者第三仿射向量与第二仿射向量之间的差编码来导出第三仿射向量。In another example, the second affine vector can be derived based on the difference encoding of the first affine vector and the second affine vector. To this end, the difference vector representing the difference between the second affine vector and the first affine vector can be encoded in the bitstream. The decoder can derive the second affine vector by adding the difference vector decoded in the bitstream to the first affine vector. When using the affine vectors of three angles, the third affine vector can be derived based on the difference encoding between the third affine vector and the first affine vector or the difference encoding between the third affine vector and the second affine vector.
在另一示例中,当第一角的仿射向量的值与第二角的仿射向量的值相同时,或者当用于导出第一角的仿射向量和第二角的仿射向量的相邻块相同时,可以从不与第二角邻近的块导出第二角的仿射向量。在示例中,在图30(a)中所示的示例中,当左上角的仿射向量和右上角的仿射向量相同时,可以基于不与右上角邻近的块F或G的运动向量来导出右上角的仿射向量。In another example, when the value of the affine vector of the first corner is the same as the value of the affine vector of the second corner, or when the adjacent blocks used to derive the affine vector of the first corner and the affine vector of the second corner are the same, the affine vector of the second corner can be derived from a block that is not adjacent to the second corner. In the example shown in FIG. 30( a), when the affine vector of the upper left corner and the affine vector of the upper right corner are the same, the affine vector of the upper right corner can be derived based on the motion vector of the block F or G that is not adjacent to the upper right corner.
替选地,当第一角的仿射向量的值与第二角的仿射向量的值相同时,或者当用于导出第一角的仿射向量的相邻块和用于导出第二角的仿射向量的相邻块相同时,可以基于第一角的仿射向量导出第二角的仿射向量。具体地,可以通过给第一仿射向量加上偏移或者从第一仿射向量中减去偏移或者通过基于预定义的缩放因子缩放第一仿射向量来导出第二仿射向量。Alternatively, when the value of the affine vector of the first angle is the same as the value of the affine vector of the second angle, or when the adjacent block used to derive the affine vector of the first angle and the adjacent block used to derive the affine vector of the second angle are the same, the affine vector of the second angle can be derived based on the affine vector of the first angle. Specifically, the second affine vector can be derived by adding an offset to the first affine vector or subtracting an offset from the first affine vector or by scaling the first affine vector based on a predefined scaling factor.
可以以比特流用信号发送指示仿射向量是否相同的信息。该信息可以包括指示是否存在彼此相同的仿射向量的标志或用于标识仿射向量彼此相同的角的位置的索引中的至少一个。Information indicating whether the affine vectors are identical may be signaled in a bitstream. The information may include at least one of a flag indicating whether there are identical affine vectors or an index for identifying a position of an angle at which the affine vectors are identical to each other.
根据当前块的形状,用于导出仿射向量的候选相邻块的数目和/或位置可以不同。在示例中,根据预测单元的形状(其是正方形形状还是非正方形形状),可以不同地构造用于导出角仿射向量的候选块。在示例中,当如在图30(a)中所示的示例中的,在当前块是正方形时,可以基于相邻块A、B或C中的任意一个来导出左上角的仿射向量。另一方面,当如在图30(b)中所示的示例中的,在当前块是非正方形时,可以基于相邻块A、B或F中的任意一个来导出左上角的仿射向量。Depending on the shape of the current block, the number and/or position of the candidate adjacent blocks for deriving the affine vector may be different. In the example, depending on the shape of the prediction unit (whether it is a square shape or a non-square shape), the candidate blocks for deriving the angular affine vector may be constructed differently. In the example, when the current block is a square as in the example shown in FIG. 30 (a), the affine vector of the upper left corner may be derived based on any one of the adjacent blocks A, B or C. On the other hand, when the current block is a non-square as in the example shown in FIG. 30 (b), the affine vector of the upper left corner may be derived based on any one of the adjacent blocks A, B or F.
根据本公开内容的实施方式,可以定义用于导出当前块的仿射向量的仿射合并模式。仿射合并模式表示一种导出合并候选的运动信息作为当前块的运动信息的方法。在这种情况下,运动信息可以包括运动向量、参考图片索引、参考图片列表或预测方向中的至少一个。合并候选可以包括空间合并候选或时间合并候选中的至少一个。空间合并候选表示根据与当前块包括在相同的图片中的块导出的合并候选,并且时间合并候选表示根据与当前块包括在不同的图片中的块导出的合并候选。According to an embodiment of the present disclosure, an affine merge mode for deriving an affine vector of a current block may be defined. The affine merge mode represents a method of deriving motion information of a merge candidate as motion information of the current block. In this case, the motion information may include at least one of a motion vector, a reference picture index, a reference picture list, or a prediction direction. The merge candidate may include at least one of a spatial merge candidate or a temporal merge candidate. The spatial merge candidate represents a merge candidate derived from a block included in the same picture as the current block, and the temporal merge candidate represents a merge candidate derived from a block included in a different picture from the current block.
图32是示出了用于导出空间合并候选的候选块的图。FIG. 32 is a diagram showing candidate blocks for deriving spatial merging candidates.
可以根据与当前块邻近的相邻块或与该相邻块在同一条线上的块中的至少一个导出空间合并候选。与相邻块在同一条线上的块可以包括与邻近当前块的相邻块在同一水平线上的块、在同一垂直线上的块或在同一对角线上的块中的至少一个。The spatial merging candidate may be derived based on at least one of a neighboring block adjacent to the current block or a block on the same line as the neighboring block. The block on the same line as the neighboring block may include at least one of a block on the same horizontal line, a block on the same vertical line, or a block on the same diagonal line as the neighboring block adjacent to the current block.
根据具有仿射运动信息的块导出的合并候选可以被称为继承合并候选。继承合并候选可以根据当前块的空间相邻块或时间相邻块导出,并且所导出的继承合并候选可以被添加至合并候选列表。替选地,可以将仅在当前块的左侧相邻块之中以预定顺序首先搜索的继承合并候选和仅在当前块的上侧相邻块之中以预定顺序首先搜索的继承合并候选添加至合并候选列表。在这种情况下,左侧相邻块可以包括A0和A3,而上侧相邻块可以包括A1、A2和A4。A merge candidate derived from a block with affine motion information may be referred to as an inheritance merge candidate. The inheritance merge candidate may be derived from a spatial neighboring block or a temporal neighboring block of the current block, and the derived inheritance merge candidate may be added to the merge candidate list. Alternatively, an inheritance merge candidate that is first searched in a predetermined order only among the left neighboring blocks of the current block and an inheritance merge candidate that is first searched in a predetermined order only among the upper neighboring blocks of the current block may be added to the merge candidate list. In this case, the left neighboring blocks may include A0 and A3, and the upper neighboring blocks may include A1, A2, and A4.
可以基于候选块的运动信息来获得继承合并候选的运动信息。在示例中,可以将继承合并候选的预测方向和参考图片索引设置为与候选块相同。可以基于候选块的仿射向量来导出继承合并候选的仿射向量。在这种情况下,根据参数的数目,继承合并候选的仿射向量可以包括左上角的仿射向量、右上角的仿射向量或左下角的仿射向量中的至少一个。在这种情况下,根据候选块是否邻接CTU的边界,用于导出继承合并候选的仿射向量的候选块的角仿射向量可以不同。在示例中,在当前块和候选块属于相同的CTU时,可以基于候选块的左上角的仿射向量和候选块的右上角的仿射向量来导出合并候选的仿射向量。另一方面,在当前块和候选块属于不同的CTU时,可以基于候选块的左下角的仿射向量和候选块的右下角的仿射向量来导出合并候选的仿射向量。The motion information of the inherited merge candidate can be obtained based on the motion information of the candidate block. In the example, the prediction direction and reference picture index of the inherited merge candidate can be set to be the same as the candidate block. The affine vector of the inherited merge candidate can be derived based on the affine vector of the candidate block. In this case, according to the number of parameters, the affine vector of the inherited merge candidate may include at least one of the affine vector of the upper left corner, the affine vector of the upper right corner, or the affine vector of the lower left corner. In this case, the angular affine vector of the candidate block used to derive the affine vector of the inherited merge candidate may be different depending on whether the candidate block is adjacent to the boundary of the CTU. In the example, when the current block and the candidate block belong to the same CTU, the affine vector of the merge candidate can be derived based on the affine vector of the upper left corner of the candidate block and the affine vector of the upper right corner of the candidate block. On the other hand, when the current block and the candidate block belong to different CTUs, the affine vector of the merge candidate can be derived based on the affine vector of the lower left corner of the candidate block and the affine vector of the lower right corner of the candidate block.
接下来,可以将构造的合并候选添加至合并候选列表。可以通过组合多个块的平移运动信息来生成构造的合并候选。在示例中,可以通过组合图32中所示的候选块中的两个或更多个候选块来生成构造的合并候选。当构造的合并候选被构造时,可以组合候选块,使得基于与角邻近的相邻块的平移运动向量来导出角的仿射向量。在示例中,在6参数模式的情况下,可以通过组合与当前块的左上角邻近的块、与当前块的右上角邻近的块和与当前块的左下角邻近的块来生成构造的合并候选。Next, the constructed merge candidate can be added to the merge candidate list. The constructed merge candidate can be generated by combining the translation motion information of multiple blocks. In the example, the constructed merge candidate can be generated by combining two or more candidate blocks among the candidate blocks shown in Figure 32. When the constructed merge candidate is constructed, the candidate blocks can be combined so that the affine vector of the corner is derived based on the translation motion vector of the adjacent block adjacent to the corner. In the example, in the case of 6-parameter mode, the constructed merge candidate can be generated by combining a block adjacent to the upper left corner of the current block, a block adjacent to the upper right corner of the current block, and a block adjacent to the lower left corner of the current block.
可以在编码器和解码器中预定义生成构造的合并候选的组合优先级。可以通过根据组合优先级对多个块进行组合来生成构造的合并候选。在这种情况下,参考图片不相同的块的组合可以被确定为不可用作构造的合并候选。The combination priority for generating the constructed merge candidate may be predefined in the encoder and the decoder. The constructed merge candidate may be generated by combining a plurality of blocks according to the combination priority. In this case, a combination of blocks with different reference pictures may be determined to be unusable as the constructed merge candidate.
当构造的合并候选被选择时,构造所构造的合并候选的每个块的平移运动向量可以被设置为与其邻近的角的仿射向量。When a constructed merge candidate is selected, a translation motion vector of each block constructing the constructed merge candidate may be set to an affine vector of a corner adjacent thereto.
另一方面,可以通过使用属于与当前图片不同的图片的一个或更多个时间相邻块来导出仿射合并候选。具体地,当通过仿射帧间预测对时间相邻块进行编码时,可以根据时间相邻块导出继承合并候选。On the other hand, an affine merge candidate may be derived by using one or more temporal neighboring blocks belonging to a picture different from the current picture. Specifically, when temporal neighboring blocks are encoded by affine inter prediction, an inheritance merge candidate may be derived from the temporal neighboring blocks.
基于与当前块邻近的相邻块,可以构造第一合并候选列表,并且当包括在第一合并候选列表中的合并候选的数目小于最大数目时,可以将包括在第二合并候选列表中的合并候选添加至第一合并候选列表。具体地,可以将包括在第二合并候选列表中的合并候选中的不包括在第一合并候选列表中的合并候选添加至第一合并候选列表。Based on the neighboring blocks adjacent to the current block, a first merge candidate list may be constructed, and when the number of merge candidates included in the first merge candidate list is less than the maximum number, merge candidates included in the second merge candidate list may be added to the first merge candidate list. Specifically, merge candidates included in the second merge candidate list that are not included in the first merge candidate list may be added to the first merge candidate list.
在这种情况下,第一合并候选列表可以包括根据与当前块邻近的相邻块导出的构造的合并候选和/或继承合并候选。第二合并候选列表可以包括根据不与当前块邻近的块导出的构造的合并候选和/或继承合并候选。替选地,第二合并候选列表可以包括基于在当前块之前的通过仿射帧间预测而编码/解码的块的仿射运动信息而导出的合并候选。构造第二合并候选列表并将第二合并候选列表中包括的合并候选添加至第一合并候选列表可以遵循上述实施方式。In this case, the first merge candidate list may include constructed merge candidates and/or inherited merge candidates derived from neighboring blocks adjacent to the current block. The second merge candidate list may include constructed merge candidates and/or inherited merge candidates derived from blocks not adjacent to the current block. Alternatively, the second merge candidate list may include merge candidates derived based on affine motion information of a block encoded/decoded by affine inter-frame prediction before the current block. Constructing the second merge candidate list and adding the merge candidates included in the second merge candidate list to the first merge candidate list may follow the above-mentioned embodiment.
编码器在包括在合并候选列表中的合并候选(例如,空间合并候选和时间合并候选)之中选择具有最高编码效率的合并候选,并用信号发送指定所选择的合并候选的信息。解码器可以基于以比特流用信号发送的信息来选择合并候选,并且可以基于所选择的合并候选的运动信息来获得当前块的运动信息。具体地,可以将当前块的运动信息设置为与合并候选的运动信息相同。The encoder selects a merge candidate with the highest coding efficiency among the merge candidates (e.g., spatial merge candidates and temporal merge candidates) included in the merge candidate list, and signals information specifying the selected merge candidate. The decoder may select the merge candidate based on the information signaled in the bitstream, and may obtain the motion information of the current block based on the motion information of the selected merge candidate. Specifically, the motion information of the current block may be set to be the same as the motion information of the merge candidate.
图33示出了根据候选块的仿射向量导出当前块的仿射向量的示例。FIG. 33 shows an example of deriving an affine vector of a current block from affine vectors of candidate blocks.
如上所述,可以基于通过仿射帧间预测编码的块的仿射向量来导出合并候选的仿射向量。因此,可以相应地考虑选择合并候选以根据候选块的仿射向量导出当前块的仿射向量。As described above, the affine vector of the merge candidate can be derived based on the affine vector of the block encoded by affine inter-frame prediction. Therefore, the affine vector of the current block can be derived from the affine vector of the candidate block according to the affine vector of the candidate block.
在图33中所示的示例中,当在仿射合并模式中使用A4时,可以理解,基于与A4相对应的块的仿射向量v0、v1或v2中的至少一个导出当前块的仿射向量v'0、v'1或v'2中的至少一个。In the example shown in FIG. 33 , when A4 is used in the affine merge mode, it can be understood that at least one of the affine vectors v'0, v'1 or v'2 of the current block is derived based on at least one of the affine vectors v0, v1 or v2 of the block corresponding to A4.
替选地,可以理解,基于与A4相对应的部分区域的仿射向量v0、v1或v2中的至少一个导出当前块的仿射向量v'0、v'1或v'2中的至少一个。在这种情况下,部分区域可以是包括A4的位置(例如,(-1,-1))的切片、图块、CTB、CTB列、CU或PU中的任意一个。Alternatively, it can be understood that at least one of the affine vectors v'0, v'1, or v'2 of the current block is derived based on at least one of the affine vectors v0, v1, or v2 of the partial area corresponding to A4. In this case, the partial area may be any one of a slice, a tile, a CTB, a CTB column, a CU, or a PU including the position of A4 (e.g., (-1, -1)).
根据当前块的大小和/或形状,可以确定是否允许仿射合并模式。在示例中,仅在当前块的大小大于阈值时才可以允许仿射合并模式。阈值可以是在编码器和解码器中预设的固定值。替选地,可以以比特流用信号发送用于确定阈值的信息。Depending on the size and/or shape of the current block, it may be determined whether the affine merge mode is allowed. In an example, the affine merge mode may be allowed only when the size of the current block is greater than a threshold. The threshold may be a fixed value preset in the encoder and decoder. Alternatively, information for determining the threshold may be signaled in a bitstream.
可以基于指示是否使用仿射合并模式的标志来确定是否将仿射合并模式用于当前块。可以基于当前块的大小、形状、划分深度、划分类型或成分类型中的至少一个来导出标志。替选地,标志可以被编码并且以比特流用信号发送。Whether to use the affine merge mode for the current block may be determined based on a flag indicating whether the affine merge mode is used. The flag may be derived based on at least one of the size, shape, partition depth, partition type, or component type of the current block. Alternatively, the flag may be encoded and signaled in a bitstream.
当标志指示不使用仿射合并模式时,可以通过将仿射向量差值与仿射向量预测值相加来导出当前块的仿射向量。When the flag indicates that the affine merge mode is not used, the affine vector of the current block can be derived by adding the affine vector difference value to the affine vector prediction value.
仿射向量预测值可以被设置为与运动向量候选的仿射向量相同。可以根据通过仿射帧间预测编码的非邻近块或相邻块中的至少一个导出运动向量候选。在示例中,可以根据通过仿射帧间预测编码的块导出运动向量候选,该块在以预定顺序搜索当前块的左侧相邻块时首先被搜索。另外,可以根据通过仿射帧间预测编码的块导出运动向量候选,该块在以预定顺序搜索当前块的上侧相邻块时首先被搜索。在这种情况下,左侧相邻块可以包括A0和A3,而上侧相邻块可以包括A1、A2和A4。The affine vector prediction value may be set to be the same as the affine vector of the motion vector candidate. The motion vector candidate may be derived from at least one of the non-adjacent blocks or adjacent blocks encoded by affine inter-frame prediction. In an example, the motion vector candidate may be derived from a block encoded by affine inter-frame prediction, which is searched first when searching the left adjacent blocks of the current block in a predetermined order. In addition, the motion vector candidate may be derived from a block encoded by affine inter-frame prediction, which is searched first when searching the upper adjacent blocks of the current block in a predetermined order. In this case, the left adjacent blocks may include A0 and A3, and the upper adjacent blocks may include A1, A2, and A4.
可以基于候选块的仿射向量来导出运动向量候选的仿射向量。在这种情况下,根据参数的数目,运动向量候选的仿射向量可以包括左上角的仿射向量、右上角的仿射向量或左下角的仿射向量中的至少一个。可以根据候选块是否邻接CTU的边界来不同地确定用于导出运动向量候选的仿射向量的候选块的角仿射向量。在示例中,在当前块和候选块属于相同的CTU时,可以基于候选块的左上角的仿射向量和候选块的右上角的仿射向量来导出运动向量候选的仿射向量。另一方面,在当前块和候选块属于不同的CTU时,可以基于候选块的左下角的仿射向量和候选块的右下角的仿射向量来导出运动向量候选的仿射向量。The affine vector of the motion vector candidate can be derived based on the affine vector of the candidate block. In this case, according to the number of parameters, the affine vector of the motion vector candidate may include at least one of the affine vector of the upper left corner, the affine vector of the upper right corner, or the affine vector of the lower left corner. The angular affine vector of the candidate block used to derive the affine vector of the motion vector candidate can be determined differently depending on whether the candidate block is adjacent to the boundary of the CTU. In the example, when the current block and the candidate block belong to the same CTU, the affine vector of the motion vector candidate can be derived based on the affine vector of the upper left corner of the candidate block and the affine vector of the upper right corner of the candidate block. On the other hand, when the current block and the candidate block belong to different CTUs, the affine vector of the motion vector candidate can be derived based on the affine vector of the lower left corner of the candidate block and the affine vector of the lower right corner of the candidate block.
可以以比特流用信号发送用于指定多个运动向量候选中的任何一个的信息。当通过该信息选择运动向量候选时,可以将所选择的运动向量候选的仿射向量设置为仿射向量预测值。可以通过将在比特流中解码的仿射向量差值与仿射向量预测值相加来导出当前块的仿射向量。Information for specifying any one of a plurality of motion vector candidates may be signaled in a bitstream. When a motion vector candidate is selected by the information, an affine vector of the selected motion vector candidate may be set as an affine vector prediction value. The affine vector of the current block may be derived by adding an affine vector difference value decoded in the bitstream to the affine vector prediction value.
当导出当前块的仿射向量时,可以基于仿射向量来导出子块的仿射运动向量S2930。基于获得的仿射运动向量,可以执行每个子块的运动补偿S2940。When the affine vector of the current block is derived, the affine motion vector of the sub-block may be derived based on the affine vector S2930. Based on the obtained affine motion vector, motion compensation of each sub-block may be performed S2940.
以上提及的示例描述了仿射合并模式与常规合并模式是分开的。根据本公开内容的实施方式,可以通过将常规合并模式和仿射合并模式结合来使用常规合并模式和仿射合并模式。在示例中,可以根据邻近当前块的相邻块或非邻近块中的至少一个导出合并候选,并且可以生成包括合并候选的组合的合并候选列表。在这种情况下,当候选块通过平移运动模型编码时,根据候选块导出的合并候选可以包括平移运动信息。另外,当候选块通过仿射运动模型编码时,根据候选块导出的合并候选可以包括仿射运动信息。The above-mentioned examples describe that the affine merge mode is separate from the regular merge mode. According to an embodiment of the present disclosure, the regular merge mode and the affine merge mode can be used by combining the regular merge mode and the affine merge mode. In the example, a merge candidate can be derived based on at least one of the adjacent blocks or non-adjacent blocks adjacent to the current block, and a merge candidate list including a combination of merge candidates can be generated. In this case, when the candidate block is encoded by a translational motion model, the merge candidate derived from the candidate block may include translational motion information. In addition, when the candidate block is encoded by an affine motion model, the merge candidate derived from the candidate block may include affine motion information.
根据从合并候选列表中选择的合并候选,可以确定当前块的运动模型。在示例中,当根据通过仿射模式编码/解码的块导出选择的合并候选时,可以针对当前块执行仿射帧间预测。According to the merge candidate selected from the merge candidate list, the motion model of the current block may be determined. In an example, when the selected merge candidate is derived from a block encoded/decoded by an affine mode, affine inter prediction may be performed on the current block.
替选地,当与选择的合并候选相对应的相邻块的预测模式不同于当前块的预测模式时,可以通过使用选择的合并候选的运动信息的至少仅一部分来导出当前块的运动信息。在这种情况下,预测模式可以包括仿射合并模式、仿射帧间模式、合并模式、AMVP模式或在编码器和解码器中预定义的模式中的至少一种。Alternatively, when the prediction mode of the neighboring block corresponding to the selected merge candidate is different from the prediction mode of the current block, the motion information of the current block may be derived by using at least only a portion of the motion information of the selected merge candidate. In this case, the prediction mode may include an affine merge mode, an affine inter mode, a merge mode, an AMVP mode, or at least one of a mode predefined in an encoder and a decoder.
在示例中,当通过仿射帧间模式对与所选择的合并候选相对应的相邻块进行编码并且通过常规合并模式对当前块进行编码时,可以通过使用相邻块的仿射向量的全部(例如,v0、v1和v2)或部分(例如,v0和v1)来导出当前块的运动向量。In an example, when a neighboring block corresponding to a selected merge candidate is encoded by an affine inter mode and the current block is encoded by a normal merge mode, a motion vector of the current block can be derived by using all (e.g., v0, v1, and v2) or part (e.g., v0 and v1) of the affine vectors of the neighboring blocks.
替选地,当通过第一预测模式对与所选择的合并候选相对应的相邻块进行编码并且通过第二预测模式对当前块进行编码时,可以参考合并候选的运动信息中的运动向量,但是参考图片索引可能无法被参考。Alternatively, when a neighboring block corresponding to a selected merge candidate is encoded by a first prediction mode and a current block is encoded by a second prediction mode, a motion vector in motion information of the merge candidate may be referenced, but a reference picture index may not be referenced.
将着重于解码处理或编码处理描述的实施方式应用于编码处理或解码处理包括在本发明的范围内。将以预定顺序描述的实施方式改变为不同顺序也包括在本发明的范围内。It is within the scope of the present invention to apply the embodiments described with emphasis on the decoding process or the encoding process to the encoding process or the decoding process. It is also within the scope of the present invention to change the embodiments described in a predetermined order to a different order.
尽管已经基于一系列步骤或流程图描述了上述实施方式,但是上述实施方式并不旨在限制本发明的时间序列顺序,并且可以同时或以不同的顺序执行。另外,组成上述实施方式中的框图的部件(例如,单元、模块等)中的每个可以被实现为硬件装置或软件,并且多个部件可以组合成一个硬件装置或软件。上述实施方式可以以程序指令的形式实现,所述程序指令可以通过各种计算机部件执行并且被记录在计算机可读记录介质中。计算机可读存储介质可以单独地或以其组合包括程序指令、数据文件、数据结构等。计算机可读存储介质的示例包括:磁记录介质例如硬盘、软盘和磁带;光学数据存储介质例如CD-ROM或DVD-ROM;磁光介质例如光盘;以及硬件装置例如只读存储器(ROM)、随机存取存储器(RAM)和闪存,这些计算机可读存储介质被特别地结构化以存储和实现程序指令。硬件装置可以被配置成由一个或更多个软件模块操作或者软件模块可以被配置成由一个或更多个硬件装置操作,以进行根据本发明的处理。Although the above embodiments have been described based on a series of steps or flow charts, the above embodiments are not intended to limit the time series order of the present invention, and can be executed simultaneously or in different orders. In addition, each of the components (e.g., units, modules, etc.) constituting the block diagram in the above embodiments can be implemented as a hardware device or software, and multiple components can be combined into one hardware device or software. The above embodiments can be implemented in the form of program instructions, which can be executed by various computer components and recorded in a computer-readable recording medium. Computer-readable storage media can include program instructions, data files, data structures, etc., alone or in combination. Examples of computer-readable storage media include: magnetic recording media such as hard disks, floppy disks, and tapes; optical data storage media such as CD-ROMs or DVD-ROMs; magneto-optical media such as optical disks; and hardware devices such as read-only memories (ROMs), random access memories (RAMs), and flash memories, which are particularly structured to store and implement program instructions. Hardware devices can be configured to be operated by one or more software modules or software modules can be configured to be operated by one or more hardware devices to perform processing according to the present invention.
工业实用性Industrial Applicability
本发明可以应用于能够对图像进行编码/解码的电子装置。The present invention can be applied to electronic devices capable of encoding/decoding images.
本发明的方案还包括:The solution of the present invention also includes:
(1).一种对视频进行解码的方法,所述方法包括:(1) A method for decoding a video, the method comprising:
根据候选块导出合并候选;Deriving merge candidates according to the candidate blocks;
生成包括所述合并候选的第一合并候选列表;generating a first merge candidate list including the merge candidate;
指定包括在所述第一合并候选列表中的多个合并候选之一;specifying one of the plurality of merge candidates included in the first merge candidate list;
基于指定的合并候选的运动信息导出当前块的仿射向量;deriving an affine vector of the current block based on motion information of the specified merge candidate;
基于所述仿射向量导出所述当前块中的子块的运动向量;以及deriving a motion vector of a sub-block in the current block based on the affine vector; and
基于所述运动向量执行所述子块的运动补偿。Motion compensation of the sub-block is performed based on the motion vector.
(2).根据(1)所述的方法,其中,当通过仿射帧间预测对所述候选块进行编码时,基于所述候选块的仿射向量导出所述合并候选的仿射向量。(2) The method according to (1), wherein, when the candidate block is encoded by affine inter-frame prediction, the affine vector of the merge candidate is derived based on the affine vector of the candidate block.
(3).根据(2)所述的方法,其中,基于所述当前块和所述候选块是否包括在相同的CTU(编码树单元)中,所述候选块的仿射向量的位置不同。(3) The method according to (2), wherein a position of the affine vector of the candidate block is different based on whether the current block and the candidate block are included in the same CTU (coding tree unit).
(4).根据(1)所述的方法,其中,通过组合多个候选块的平移运动向量来导出所述合并候选的仿射向量。(4) The method according to (1), wherein the affine vector of the merge candidate is derived by combining translation motion vectors of multiple candidate blocks.
(5).根据(1)所述的方法,其中,当包括在所述第一合并候选列表中的合并候选的数目小于最大数目时,将包括在第二合并候选列表中的合并候选添加至所述第一合并候选列表。(5) The method according to (1), wherein, when the number of merge candidates included in the first merge candidate list is less than a maximum number, the merge candidates included in the second merge candidate list are added to the first merge candidate list.
(6).根据(1)所述的方法,其中,所述方法还包括确定所述当前块的仿射参数的数目,以及(6) The method according to (1), wherein the method further comprises determining the number of affine parameters of the current block, and
其中,基于所述当前块的大小或形状中的至少一个来确定所述仿射参数的数目。The number of the affine parameters is determined based on at least one of a size or a shape of the current block.
(7).根据(1)所述的方法,其中,所述候选块包括所述当前块的相邻块和与所述相邻块在同一条线上的非相邻块中的至少一个。(7) The method according to (1), wherein the candidate block includes at least one of a neighboring block of the current block and a non-neighboring block on the same line as the neighboring block.
(8).一种对视频进行编码的方法,所述方法包括:(8) A method for encoding a video, the method comprising:
根据候选块导出合并候选;Deriving merge candidates according to the candidate blocks;
生成包括所述合并候选的第一合并候选列表;generating a first merge candidate list including the merge candidate;
指定包括在所述第一合并候选列表中的多个合并候选之一;specifying one of the plurality of merge candidates included in the first merge candidate list;
基于指定的合并候选的运动信息导出当前块的仿射向量;deriving an affine vector of the current block based on motion information of the specified merge candidate;
基于所述仿射向量导出所述当前块中的子块的运动向量;以及deriving a motion vector of a sub-block in the current block based on the affine vector; and
基于所述运动向量执行所述子块的运动补偿。Motion compensation of the sub-block is performed based on the motion vector.
(9).根据(8)所述的方法,其中,当通过仿射帧间预测对所述候选块进行编码时,基于所述候选块的仿射向量导出所述合并候选的仿射向量。(9) The method according to (8), wherein, when the candidate block is encoded by affine inter-frame prediction, the affine vector of the merge candidate is derived based on the affine vector of the candidate block.
(10).根据(9)所述的方法,其中,基于所述当前块和所述候选块是否包括在相同的CTU(编码树单元)中,所述候选块的仿射向量的位置不同。(10) The method according to (9), wherein a position of the affine vector of the candidate block is different based on whether the current block and the candidate block are included in the same CTU (coding tree unit).
(11).根据(8)所述的方法,其中,通过组合多个候选块的平移运动向量来导出所述合并候选的仿射向量。(11). The method according to (8), wherein the affine vector of the merge candidate is derived by combining translation motion vectors of multiple candidate blocks.
(12).根据(8)所述的方法,其中,当包括在所述第一合并候选列表中的合并候选的数目小于最大数目时,将包括在第二合并候选列表中的合并候选添加至所述第一合并候选列表。(12) The method according to (8), wherein, when the number of merge candidates included in the first merge candidate list is less than a maximum number, the merge candidates included in the second merge candidate list are added to the first merge candidate list.
(13).根据(8)所述的方法,所述方法还包括确定所述当前块的仿射参数的数目,以及(13) The method according to (8), further comprising determining the number of affine parameters of the current block, and
其中,基于所述当前块的大小或形状中的至少一个来确定所述仿射参数的数目。The number of the affine parameters is determined based on at least one of a size or a shape of the current block.
(14).根据(8)所述的方法,其中,所述候选块包括所述当前块的相邻块和与所述相邻块在同一条线上的非相邻块中的至少一个。(14) The method according to (8), wherein the candidate block includes at least one of a neighboring block of the current block and a non-neighboring block on the same line as the neighboring block.
(15).一种用于对视频进行解码的装置,所述装置包括:(15) A device for decoding a video, the device comprising:
帧间预测单元,用于进行如下操作:The inter-frame prediction unit is used to perform the following operations:
根据候选块导出合并候选;Deriving merge candidates according to the candidate blocks;
生成包括所述合并候选的第一合并候选列表;generating a first merge candidate list including the merge candidate;
指定包括在所述第一合并候选列表中的多个合并候选之一;specifying one of the plurality of merge candidates included in the first merge candidate list;
基于指定的合并候选的运动信息导出当前块的仿射向量;deriving an affine vector of the current block based on motion information of the specified merge candidate;
基于所述仿射向量导出所述当前块中的子块的运动向量;以及deriving a motion vector of a sub-block in the current block based on the affine vector; and
基于所述运动向量执行所述子块的运动补偿。Motion compensation of the sub-block is performed based on the motion vector.
Claims (7)
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR10-2018-0059286 | 2018-05-24 | ||
| KR20180059286 | 2018-05-24 | ||
| CN201980035029.4A CN112189342B (en) | 2018-05-24 | 2019-05-23 | Method and apparatus for processing a video signal |
| PCT/KR2019/006221 WO2019225994A1 (en) | 2018-05-24 | 2019-05-23 | Method and apparatus for processing video signal |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201980035029.4A Division CN112189342B (en) | 2018-05-24 | 2019-05-23 | Method and apparatus for processing a video signal |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118921468A true CN118921468A (en) | 2024-11-08 |
Family
ID=68617331
Family Applications (5)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411263905.8A Pending CN118921468A (en) | 2018-05-24 | 2019-05-23 | Method of decoding and encoding video and apparatus for transmitting compressed video data |
| CN201980035029.4A Active CN112189342B (en) | 2018-05-24 | 2019-05-23 | Method and apparatus for processing a video signal |
| CN202411263965.XA Pending CN118972591A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
| CN202411264061.9A Pending CN118900330A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
| CN202411264020.XA Pending CN118869995A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
Family Applications After (4)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201980035029.4A Active CN112189342B (en) | 2018-05-24 | 2019-05-23 | Method and apparatus for processing a video signal |
| CN202411263965.XA Pending CN118972591A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
| CN202411264061.9A Pending CN118900330A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
| CN202411264020.XA Pending CN118869995A (en) | 2018-05-24 | 2019-05-23 | Method for decoding and encoding video and device for transmitting compressed video data |
Country Status (7)
| Country | Link |
|---|---|
| US (5) | US11259015B2 (en) |
| KR (1) | KR20190134521A (en) |
| CN (5) | CN118921468A (en) |
| CA (1) | CA3100970A1 (en) |
| GB (1) | GB2593020B (en) |
| MX (2) | MX2020012547A (en) |
| WO (1) | WO2019225994A1 (en) |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112166612B (en) | 2018-05-23 | 2025-04-29 | 株式会社Kt | Method and apparatus for processing a video signal |
| CN118921468A (en) * | 2018-05-24 | 2024-11-08 | 株式会社Kt | Method of decoding and encoding video and apparatus for transmitting compressed video data |
| US10587885B2 (en) * | 2018-06-04 | 2020-03-10 | Tencent America LLC | Method and apparatus for merge mode with additional middle candidates in video coding |
| WO2020058955A1 (en) * | 2018-09-23 | 2020-03-26 | Beijing Bytedance Network Technology Co., Ltd. | Multiple-hypothesis affine mode |
| CN111083487B (en) | 2018-10-22 | 2024-05-14 | 北京字节跳动网络技术有限公司 | Storage of affine mode motion information |
| EP4429246A3 (en) * | 2018-12-29 | 2024-11-20 | SZ DJI Technology Co., Ltd. | Video processing method and device |
| CN120151519A (en) * | 2020-01-12 | 2025-06-13 | Lg电子株式会社 | Image encoding/decoding method and method for sending bit stream |
| WO2023114362A1 (en) * | 2021-12-16 | 2023-06-22 | Beijing Dajia Internet Information Technology Co., Ltd. | Methods and devices for candidate derivation for affine merge mode in video coding |
| KR20240117573A (en) * | 2022-01-04 | 2024-08-01 | 엘지전자 주식회사 | Video encoding/decoding method and device, and recording medium storing bitstream |
| CN116456110A (en) * | 2022-01-14 | 2023-07-18 | 联发科技股份有限公司 | Video encoding and decoding method and device |
Family Cites Families (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP2755389B1 (en) | 2011-09-09 | 2019-01-02 | LG Electronics Inc. | Inter prediction method and apparatus therefor |
| KR20130050406A (en) | 2011-11-07 | 2013-05-16 | 오수미 | Method for generating prediction block in inter prediction mode |
| EP4009640A1 (en) | 2011-11-08 | 2022-06-08 | Electronics and Telecommunications Research Institute | Method and device for sharing a candidate list |
| CN107566835B (en) | 2011-12-23 | 2020-02-28 | 韩国电子通信研究院 | Image decoding method, image encoding method, and recording medium |
| HUE056708T2 (en) | 2012-04-12 | 2022-03-28 | Jvckenwood Corp | Moving picture coding device, moving picture coding method, moving picture coding program, and moving picture decoding device, moving picture decoding method, moving picture decoding program |
| US11477477B2 (en) * | 2015-01-26 | 2022-10-18 | Qualcomm Incorporated | Sub-prediction unit based advanced temporal motion vector prediction |
| CN108432250A (en) | 2016-01-07 | 2018-08-21 | 联发科技股份有限公司 | Affine inter-frame prediction method and device for video coding and decoding |
| WO2017147765A1 (en) | 2016-03-01 | 2017-09-08 | Mediatek Inc. | Methods for affine motion compensation |
| CN108781284B (en) * | 2016-03-15 | 2021-09-07 | 联发科技股份有限公司 | Method and apparatus for video coding and decoding with affine motion compensation |
| WO2017156705A1 (en) * | 2016-03-15 | 2017-09-21 | Mediatek Inc. | Affine prediction for video coding |
| JP7026049B2 (en) * | 2016-09-27 | 2022-02-25 | シャープ株式会社 | Affine motion vector derivation device, predictive image generator, motion image decoding device, and motion image coding device |
| US10448010B2 (en) * | 2016-10-05 | 2019-10-15 | Qualcomm Incorporated | Motion vector prediction for affine motion models in video coding |
| CN118921468A (en) * | 2018-05-24 | 2024-11-08 | 株式会社Kt | Method of decoding and encoding video and apparatus for transmitting compressed video data |
| JP7449279B2 (en) * | 2018-09-21 | 2024-03-13 | オッポ広東移動通信有限公司 | Video signal encoding/decoding method and equipment therefor |
| WO2020058956A1 (en) * | 2018-09-23 | 2020-03-26 | Beijing Bytedance Network Technology Co., Ltd. | Non-affine blocks predicted from affine motion |
| US11202089B2 (en) * | 2019-01-28 | 2021-12-14 | Tencent America LLC | Method and apparatus for determining an inherited affine parameter from an affine model |
-
2019
- 2019-05-23 CN CN202411263905.8A patent/CN118921468A/en active Pending
- 2019-05-23 CA CA3100970A patent/CA3100970A1/en active Pending
- 2019-05-23 GB GB2018072.5A patent/GB2593020B/en active Active
- 2019-05-23 KR KR1020190060732A patent/KR20190134521A/en active Pending
- 2019-05-23 MX MX2020012547A patent/MX2020012547A/en unknown
- 2019-05-23 US US17/056,923 patent/US11259015B2/en active Active
- 2019-05-23 CN CN201980035029.4A patent/CN112189342B/en active Active
- 2019-05-23 CN CN202411263965.XA patent/CN118972591A/en active Pending
- 2019-05-23 CN CN202411264061.9A patent/CN118900330A/en active Pending
- 2019-05-23 WO PCT/KR2019/006221 patent/WO2019225994A1/en not_active Ceased
- 2019-05-23 CN CN202411264020.XA patent/CN118869995A/en active Pending
-
2020
- 2020-11-20 MX MX2024004178A patent/MX2024004178A/en unknown
-
2022
- 2022-01-11 US US17/572,983 patent/US11671590B2/en active Active
-
2023
- 2023-04-25 US US18/139,005 patent/US11889064B2/en active Active
- 2023-12-11 US US18/535,262 patent/US12219131B2/en active Active
-
2024
- 2024-12-20 US US18/990,826 patent/US20250119534A1/en active Pending
Also Published As
| Publication number | Publication date |
|---|---|
| US11671590B2 (en) | 2023-06-06 |
| US20210211646A1 (en) | 2021-07-08 |
| CA3100970A1 (en) | 2019-11-28 |
| US11259015B2 (en) | 2022-02-22 |
| US11889064B2 (en) | 2024-01-30 |
| MX2020012547A (en) | 2021-02-18 |
| CN118900330A (en) | 2024-11-05 |
| WO2019225994A1 (en) | 2019-11-28 |
| CN112189342A (en) | 2021-01-05 |
| MX2024004178A (en) | 2024-07-10 |
| US20240137494A1 (en) | 2024-04-25 |
| US20220141452A1 (en) | 2022-05-05 |
| CN112189342B (en) | 2024-10-01 |
| US20230269369A1 (en) | 2023-08-24 |
| GB202018072D0 (en) | 2020-12-30 |
| US20250119534A1 (en) | 2025-04-10 |
| GB2593020B (en) | 2022-12-28 |
| KR20190134521A (en) | 2019-12-04 |
| CN118869995A (en) | 2024-10-29 |
| CN118972591A (en) | 2024-11-15 |
| GB2593020A (en) | 2021-09-15 |
| US12219131B2 (en) | 2025-02-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112106359B (en) | Method and apparatus for processing video signal | |
| EP4407990B1 (en) | Video signal processing method and device | |
| US20220337817A1 (en) | Method and apparatus for processing video signal | |
| CN112189342B (en) | Method and apparatus for processing a video signal | |
| CN116634138B (en) | Video decoding method, video encoding method, and video data transmission method | |
| CN112204966B (en) | Method for decoding and encoding an image and device for transmitting a bit stream | |
| EP3509307A1 (en) | Method and device for processing video signal | |
| CN112166610B (en) | Method and apparatus for processing a video signal | |
| CN112204982B (en) | Method and apparatus for processing a video signal | |
| CA3065914A1 (en) | Video signal processing method and device | |
| GB2614685A (en) | Method and apparatus for processing a video signal |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |