CN105025300A - Method and device for encoding/decoding images - Google Patents
Method and device for encoding/decoding images Download PDFInfo
- Publication number
- CN105025300A CN105025300A CN201510446031.4A CN201510446031A CN105025300A CN 105025300 A CN105025300 A CN 105025300A CN 201510446031 A CN201510446031 A CN 201510446031A CN 105025300 A CN105025300 A CN 105025300A
- Authority
- CN
- China
- Prior art keywords
- motion vector
- prediction
- current block
- block
- coding unit
- 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.)
- Granted
Links
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
一种对图像进行编码/解码的方法和设备:基于在当前块被编码/解码之前编码/解码的至少一个块的运动矢量确定当前块的运动矢量,根据确定的运动矢量,基于第一方向预测、第二方向预测和双向预测之一对当前块进行预测编码/解码。
A method and device for encoding/decoding an image: determining a motion vector of a current block based on a motion vector of at least one block encoded/decoded before the current block is encoded/decoded, and predicting based on a first direction according to the determined motion vector , performing predictive encoding/decoding on the current block by one of second direction prediction and bidirectional prediction.
Description
本申请是向中国知识产权局提交的申请日为2011年1月19日、申请号为201180014824.9、发明名称为“使用先前块的运动矢量作为当前块的运动矢量来对图像进行编码/解码的方法和设备”的申请的分案申请。This application was submitted to the China Intellectual Property Office with an application date of January 19, 2011, an application number of 201180014824.9, and an invention title of "Method for encoding/decoding images using the motion vector of the previous block as the motion vector of the current block" and equipment" application.
技术领域technical field
本发明涉及一种用于对图像进行编码/解码的方法和设备,更具体地说,涉及一种用于基于帧间预测对图像进行编码/解码的方法和设备。The present invention relates to a method and device for encoding/decoding images, and more particularly, to a method and device for encoding/decoding images based on inter-frame prediction.
背景技术Background technique
根据视频压缩标准(诸如MPEG-1、MPEG-2和MPEG-4H.264/MPEG-4AVC(先进视频编码)),通过将图像划分为预定大小的块来对图像进行编码。接下来,通过使用帧间预测或帧内预测来对每个预定大小的块进行预测编码。According to video compression standards such as MPEG-1, MPEG-2, and MPEG-4 H.264/MPEG-4 AVC (Advanced Video Coding), images are encoded by dividing them into blocks of a predetermined size. Next, each block of a predetermined size is predictively encoded by using inter prediction or intra prediction.
对于帧间预测,通过搜索与当前块相同或相似的块的至少一个参考帧来执行运动估计,通过执行运动估计而产生的运动矢量与像素值一起被编码,编码的结果被随后插入比特流。For inter prediction, motion estimation is performed by searching for at least one reference frame of a block that is the same as or similar to a current block, a motion vector generated by performing motion estimation is encoded together with pixel values, and the encoded result is then inserted into a bitstream.
发明内容Contents of the invention
技术方案Technical solutions
本发明的一个或多个方面提供了一种图像编码方法和设备以及图像解码方法和设备,以及记录有用于执行所述图像编码方法和/或所述图像解码方法的程序的计算机可读记录介质,其中,在所述图像编码方法和设备以及图像解码方法和设备中,基于至少一个先前块的运动矢量来确定当前块的运动矢量,并基于确定的运动矢量来对图像进行编码/解码。One or more aspects of the present invention provide an image encoding method and device, an image decoding method and device, and a computer-readable recording medium recorded with a program for executing the image encoding method and/or the image decoding method , wherein, in the image encoding method and device and the image decoding method and device, the motion vector of the current block is determined based on the motion vector of at least one previous block, and the image is encoded/decoded based on the determined motion vector.
有益效果Beneficial effect
根据本发明,使用至少一个先前块的运动矢量作为当前块的运动矢量来执行编码,从而增加编码模式的命中率以及预测的精度。因此,可使用更高的压缩率来对图像进行编码和解码。According to the present invention, encoding is performed using a motion vector of at least one previous block as a motion vector of a current block, thereby increasing the hit ratio of encoding modes and the accuracy of prediction. Therefore, images can be encoded and decoded with a higher compression rate.
附图说明Description of drawings
图1是根据本发明的实施例的图像编码设备的框图。FIG. 1 is a block diagram of an image encoding device according to an embodiment of the present invention.
图2是根据本发明的实施例的图像解码设备的框图。FIG. 2 is a block diagram of an image decoding device according to an embodiment of the present invention.
图3示出根据本发明的实施例的分层编码单元。FIG. 3 illustrates a layered coding unit according to an embodiment of the present invention.
图4是根据本发明的实施例的基于编码单元的图像编码器的框图。FIG. 4 is a block diagram of a coding unit-based image encoder according to an embodiment of the present invention.
图5是根据本发明的实施例的基于编码单元的图像解码器的框图。FIG. 5 is a block diagram of a coding unit based image decoder according to an embodiment of the present invention.
图6示出根据本发明的实施例的最大编码单元、子编码单元和预测单元。FIG. 6 illustrates a maximum coding unit, a sub coding unit, and a prediction unit according to an embodiment of the present invention.
图7示出根据本发明的实施例的编码单元和变换单元。FIG. 7 illustrates coding units and transformation units according to an embodiment of the present invention.
图8a和图8b示出根据本发明的实施例的编码单元、预测单元和变换单元的划分形状。8a and 8b illustrate split shapes of coding units, prediction units, and transformation units according to an embodiment of the present invention.
图9是根据本发明的另一实施例的图像编码设备的框图。FIG. 9 is a block diagram of an image encoding device according to another embodiment of the present invention.
图10是示出根据本发明的实施例的对包括在双向预测图像中的块进行预测的方法的示图。FIG. 10 is a diagram illustrating a method of predicting a block included in a bidirectional predictive image according to an embodiment of the present invention.
图11a和图11b是示出根据本发明的实施例的基于先前编码块的运动矢量来确定当前块的运动矢量的方法的示图。11a and 11b are diagrams illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
图12a和图12b是示出根据本发明的实施例的基于先前编码块的运动矢量来确定当前块的运动矢量的方法的示图。12a and 12b are diagrams illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
图13a和图13b是示出根据本发明的实施例的基于先前编码块的运动矢量来确定当前块的运动矢量的方法的示图。13a and 13b are diagrams illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
图14是根据本发明的另一实施例的图像解码设备的框图。FIG. 14 is a block diagram of an image decoding device according to another embodiment of the present invention.
图15是示出根据本发明的实施例的图像编码方法的流程图。FIG. 15 is a flowchart illustrating an image encoding method according to an embodiment of the present invention.
图16是示出根据本发明的实施例的图像解码方法的流程图。FIG. 16 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.
最佳模式best mode
根据本发明的一方面,提供了一种基于在当前块被解码之前解码的至少一个块的运动矢量来确定当前块的运动矢量并基于确定的运动矢量来对当前块进行解码的图像解码方法,所述方法包括:对关于在第一方向、第二方向和双向中将被用于对当前块进行解码的预测方向的信息以及关于当前块的像素值的信息进行解码;基于对关于预测方向的信息进行解码的结果,确定当前块将被预测的预测方向,确定用于按照确定的预测方向对当前块进行预测的至少一个运动矢量;基于所述至少一个运动矢量和对关于像素值的信息进行解码的结果,恢复当前块。第一方向是从当前图像到先前图像的方向,第二方向是从当前图像到后续图像的方向。According to an aspect of the present invention, there is provided an image decoding method of determining a motion vector of a current block based on a motion vector of at least one block decoded before the current block is decoded and decoding the current block based on the determined motion vector, The method includes: decoding information on a prediction direction to be used for decoding the current block in a first direction, a second direction, and bidirectionally, and information on pixel values of the current block; As a result of decoding the information, determine the prediction direction in which the current block will be predicted, and determine at least one motion vector used to predict the current block according to the determined prediction direction; based on the at least one motion vector and the information about the pixel value. As a result of decoding, restore the current block. The first direction is the direction from the current image to the previous image, and the second direction is the direction from the current image to the subsequent image.
根据本发明的另一方面,提供了一种基于在当前块被编码之前编码的至少一个块的运动矢量来确定当前块的运动矢量并基于确定的运动矢量来对当前块进行编码的图像编码方法,所述方法包括:基于所述至少一个块的运动矢量确定当前块的第一方向运动矢量和第二方向运动矢量;基于第一方向运动矢量和第二方向运动矢量,从第一方向预测、第二方向预测和双向预测中确定将被用于对当前块进行编码的预测方法;对关于在确定的预测方法中使用的预测方向的信息以及关于基于所述预测方法产生的当前块的像素值的信息进行编码。第一方向是从当前图像到先前图像的方向,第二方向是从当前图像到后续图像的方向。According to another aspect of the present invention, there is provided an image encoding method of determining a motion vector of a current block based on a motion vector of at least one block encoded before the current block is encoded and encoding the current block based on the determined motion vector , the method includes: determining a first direction motion vector and a second direction motion vector of the current block based on the motion vector of the at least one block; based on the first direction motion vector and the second direction motion vector, predicting from the first direction, Determining a prediction method to be used for encoding the current block in the second direction prediction and bidirectional prediction; information about the prediction direction used in the determined prediction method and about pixel values of the current block generated based on the prediction method information is encoded. The first direction is the direction from the current image to the previous image, and the second direction is the direction from the current image to the subsequent image.
根据本发明的另一方面,提供了一种基于在当前块被解码之前解码的至少一个块的运动矢量来确定当前块的运动矢量并基于确定的运动矢量来对当前块进行解码的图像解码设备,所述设备包括:解码器,对关于在第一方向、第二方向和双向中将被用于对当前块进行解码的预测方向的信息以及关于当前块的像素值的信息进行解码;运动矢量确定器,基于对关于预测方向的信息进行解码的结果,确定当前块将被预测的预测方向,确定用于按照确定的预测方向对当前块进行预测的至少一个运动矢量;恢复单元,基于所述至少一个运动矢量和对关于像素值的信息进行解码的结果,恢复当前块。第一方向是从当前图像到先前图像的方向,第二方向是从当前图像到后续图像的方向。According to another aspect of the present invention, there is provided an image decoding apparatus that determines a motion vector of a current block based on a motion vector of at least one block decoded before the current block is decoded and decodes the current block based on the determined motion vector , the apparatus comprising: a decoder for decoding information about a prediction direction to be used for decoding a current block in a first direction, a second direction, and in both directions and information about pixel values of the current block; a motion vector A determiner, based on a result of decoding the information about the prediction direction, determines a prediction direction in which the current block will be predicted, and determines at least one motion vector for predicting the current block in accordance with the determined prediction direction; the restoration unit, based on the At least one motion vector and a result of decoding information about pixel values, recover the current block. The first direction is the direction from the current image to the previous image, and the second direction is the direction from the current image to the subsequent image.
根据本发明的另一方面,提供了一种基于在当前块被编码之前编码的至少一个块的运动矢量来确定当前块的运动矢量并基于确定的运动矢量来对当前块进行编码的图像编码设备,所述设备包括:运动矢量确定器,基于所述至少一个块的运动矢量确定当前块的第一方向运动矢量和第二方向运动矢量;编码器,基于第一方向运动矢量和第二方向运动矢量,从第一方向预测、第二方向预测和双向预测中确定将被用于对当前块进行编码的预测方法,对关于在确定的预测方法中使用的预测方向的信息以及关于基于所述预测方法产生的当前块的像素值的信息进行编码。第一方向是从当前图像到先前图像的方向,第二方向是从当前图像到后续图像的方向。According to another aspect of the present invention, there is provided an image encoding apparatus for determining a motion vector of a current block based on a motion vector of at least one block encoded before the current block is encoded and encoding the current block based on the determined motion vector , the device includes: a motion vector determiner, based on the motion vector of the at least one block, determines a first direction motion vector and a second direction motion vector of the current block; an encoder, based on the first direction motion vector and the second direction motion Vector, determining the prediction method to be used to encode the current block from among the first direction prediction, the second direction prediction and the bidirectional prediction, the information on the prediction direction used in the determined prediction method and the information on the prediction based on the method to encode information about the pixel values of the current block. The first direction is the direction from the current image to the previous image, and the second direction is the direction from the current image to the subsequent image.
根据本发明的另一方面,提供了一种记录有用于执行所述图像编码方法和/或所述图像解码方法的程序的计算机可读记录介质。According to another aspect of the present invention, there is provided a computer-readable recording medium recorded with a program for executing the image encoding method and/or the image decoding method.
具体实施方式Detailed ways
以下,将参照附图更详细地描述本发明的示例性实施例。Hereinafter, exemplary embodiments of the present invention will be described in more detail with reference to the accompanying drawings.
图1是根据本发明的实施例的图像编码设备100的框图。FIG. 1 is a block diagram of an image encoding device 100 according to an embodiment of the present invention.
参照图1,图像编码设备100包括最大编码单元划分器110、编码深度确定器120、图像数据编码器130和编码信息编码器140。Referring to FIG. 1 , an image encoding apparatus 100 includes a maximum coding unit divider 110 , a coded depth determiner 120 , an image data encoder 130 , and an encoding information encoder 140 .
最大编码单元划分器110可基于作为具有最大大小的编码单元的最大编码单元来对当前帧或像条进行划分。也就是说,最大编码单元划分器110可将当前帧或像条划分为至少一个最大编码单元。The maximum coding unit splitter 110 may split a current frame or a slice based on a maximum coding unit that is a coding unit having a maximum size. That is, the maximum coding unit divider 110 may divide the current frame or slice into at least one maximum coding unit.
根据本发明的实施例,可使用最大编码单元和深度来表示编码单元。如上所述,最大编码单元指示当前帧的多个编码单元中具有最大大小的编码单元,深度指示编码单元分层减小的程度。随着深度增加,编码单元从最大编码单元减小到最小编码单元,其中,最大编码单元的深度被定义为最小深度,最小编码单元的深度被定义为最大深度。由于随着深度增加,编码单元的大小从最大编码单元开始减小,第k深度的子编码单元可包括多个第k+n深度的子编码单元(k和n是等于或大小1的整数)。According to an embodiment of the present invention, a coding unit may be represented using a maximum coding unit and a depth. As described above, the maximum coding unit indicates the coding unit having the largest size among the coding units of the current frame, and the depth indicates the degree to which the coding unit is hierarchically reduced. As the depth increases, the coding unit decreases from a maximum coding unit to a minimum coding unit, where the depth of the maximum coding unit is defined as the minimum depth and the depth of the minimum coding unit is defined as the maximum depth. Since the size of a CU decreases from the largest CU as the depth increases, a sub-coding unit of the k-th depth may include multiple sub-coding units of the k+n-th depth (k and n are integers equal to or larger than 1) .
根据将被编码的帧的大小的增加,按照较大的编码单元对图像进行编码可导致较高的图像压缩率。然而,如果较大的编码单元被固定,则可能无法通过反映连续变化的图像特征来对图像进行有效地编码。Encoding an image in a larger coding unit may result in a higher image compression rate according to an increase in the size of a frame to be encoded. However, if a larger coding unit is fixed, it may not be possible to efficiently encode an image by reflecting continuously changing image characteristics.
例如,当平滑区域(诸如海洋或天空)被编码时,编码单元越大,压缩率可提高得越大。然而,当复杂的区域(诸如人或建筑物)被编码时,编码单元越小,压缩率可提高得越大。For example, when a smooth area such as the sea or sky is encoded, the larger the coding unit is, the more the compression ratio can be improved. However, when a complex area such as a person or a building is encoded, the smaller the coding unit, the more the compression rate can be improved.
因此,根据本发明的实施例,针对每个帧或像条设置不同最大图像编码单元和不同最大深度。由于最大深度表示编码单元可减小的最大次数,因此,包括在最大图像编码单元中的每个最小编码单元的大小可根据最大深度被不同地设置。Therefore, according to the embodiments of the present invention, different maximum image coding units and different maximum depths are set for each frame or slice. Since the maximum depth represents the maximum number of times the coding unit may be reduced, the size of each minimum coding unit included in the maximum image coding unit may be variously set according to the maximum depth.
编码深度确定器120确定最大深度。可基于率失真(RD)代价的计算来确定最大深度。可针对每个帧或像条或者针对每个最大编码单元不同地确定最大深度。确定的最大深度被提供给编码信息编码器140,根据最大编码单元的图像数据被提供给图像数据编码器130。The coded depth determiner 120 determines a maximum depth. The maximum depth may be determined based on a calculation of a rate-distortion (RD) penalty. The maximum depth may be determined differently for each frame or slice or for each maximum coding unit. The determined maximum depth is provided to the encoding information encoder 140 , and the image data according to the maximum coding unit is provided to the image data encoder 130 .
最大深度表示可包括在最大编码单元中的具有最小大小的编码单元(即,最小编码单元)。换句话说,最大编码单元可根据不同深度被划分为具有不同大小的子编码单元(具体参见图8a和图8b)。包括在最大编码单元中的具有不同大小的子编码单元可基于具有不同大小的处理单元被预测或变换。变换可以是离散余弦变换(DCT)或Karhunen Loever变换(KLT),在所述变换中,空间域的像素值被变换为频域系数。The maximum depth represents a coding unit having a minimum size (ie, a minimum coding unit) that may be included in the maximum coding unit. In other words, the maximum coding unit may be divided into sub-coding units having different sizes according to different depths (see FIGS. 8a and 8b for details). Sub coding units having different sizes included in the maximum coding unit may be predicted or transformed based on processing units having different sizes. The transform may be a discrete cosine transform (DCT) or a Karhunen Loever transform (KLT), in which pixel values in the spatial domain are transformed into frequency domain coefficients.
换句话说,图像编码设备100可基于具有各种大小和各种形状的处理单元来执行用于图像编码的多个处理操作。为了对图像数据进行编码,多个处理操作(诸如预测、变换和熵编码)被执行,其中,针对每个操作可使用具有相同大小或不同大小的处理单元。In other words, the image encoding apparatus 100 may perform a plurality of processing operations for image encoding based on processing units having various sizes and various shapes. To encode image data, multiple processing operations are performed, such as prediction, transform, and entropy coding, wherein processing units of the same size or different sizes may be used for each operation.
例如,图像编码设备100可选择与编码单元不同的处理单元来对所述编码单元进行预测。For example, the image encoding apparatus 100 may select a processing unit different from a coding unit to predict the coding unit.
当编码单元的大小是2N×2N(其中,N是正整数)时,用于预测的处理单元可以是2N×2N、2N×N、N×2N和N×N。换句话说,可基于具有将编码单元的高度和宽度中的至少一个二等分的形状的处理单元来执行运动预测。以下,作为预测的基础的处理单元被定义为“预测单元”。When the size of the coding unit is 2Nx2N (where N is a positive integer), the processing unit for prediction may be 2Nx2N, 2NxN, Nx2N, and NxN. In other words, motion prediction may be performed based on a processing unit having a shape that bisects at least one of a height and a width of a coding unit. Hereinafter, a processing unit serving as a basis for prediction is defined as a "prediction unit".
预测模式可以是帧内模式、帧间模式和跳过模式中的至少一个,可仅对具有特定大小或特定形状的预测单元执行特定预测模式。例如,可仅对具有正方形形状的大小为2N×2N和N×N的预测单元执行帧内模式。此外,可仅对大小为2N×2N的预测单元执行跳过模式。如果多个预测单元存在于编码单元中,则在对每个预测单元执行预测之后,可选择具有最小编码误差的预测模式。The prediction mode may be at least one of an intra mode, an inter mode, and a skip mode, and a specific prediction mode may be performed only on a prediction unit having a specific size or a specific shape. For example, intra mode may be performed only on prediction units of sizes 2Nx2N and NxN having a square shape. Also, skip mode may be performed only on prediction units of size 2Nx2N. If a plurality of prediction units exists in a coding unit, after prediction is performed on each prediction unit, a prediction mode having the smallest encoding error may be selected.
可选择地,图像编码设备100可基于具有与编码单元不同大小的处理单元对图像数据执行变换。对于编码单元中的变换,可基于具有与编码单元相同的大小或小于编码单元的大小的处理单元来执行变换。以下,作为变换的基础的处理单元被定义为“变换单元”。Alternatively, the image encoding apparatus 100 may perform transformation on image data based on a processing unit having a different size from a coding unit. For transformation in a coding unit, transformation may be performed based on a processing unit having the same size as the coding unit or smaller than the coding unit. Hereinafter, a processing unit serving as a basis for transformation is defined as a "transformation unit".
编码深度确定器120可通过使用基于拉格朗日乘子的RD优化来确定包括在最大编码单元中的子编码单元。换句话说,编码深度确定器120可确定从最大编码单元划分的多个子编码单元具有何种形状,其中,所述多个子编码单元根据所述多个子编码单元的深度而具有不同大小。图像数据编码器130通过基于由编码深度确定器120确定的划分形状对最大编码单元进行编码来输出比特流。The coded depth determiner 120 may determine sub coding units included in the maximum coding unit by using Lagrange multiplier-based RD optimization. In other words, the coded depth determiner 120 may determine what shape a plurality of sub coding units split from the maximum coding unit having different sizes according to depths of the plurality of sub coding units have. The image data encoder 130 outputs a bitstream by encoding the maximum coding unit based on the split shape determined by the coded depth determiner 120 .
编码信息编码器140对关于由编码深度确定器120确定的最大编码单元的编码模式的信息进行编码。换句话说,编码信息编码器140通过对以下信息进行编码来输出比特流:关于最大编码单元的划分形状的信息、关于最大深度的信息和关于每个深度的子编码单元的编码模式的信息。关于子编码单元的编码模式的信息可包括关于子编码单元的预测单元的信息、关于每个预测单元的预测模式的信息和关于子编码单元的变换单元的信息。The encoding information encoder 140 encodes information about an encoding mode of the maximum coding unit determined by the coded depth determiner 120 . In other words, the encoding information encoder 140 outputs a bitstream by encoding information about a split shape of a maximum coding unit, information about a maximum depth, and information about an encoding mode of a sub coding unit of each depth. The information about the encoding mode of the sub-coding unit may include information about a prediction unit of the sub-coding unit, information about a prediction mode of each prediction unit, and information about a transformation unit of the sub-coding unit.
关于最大编码单元的划分形状的信息可以是指示每个编码单元是否被划分的信息,例如,标志信息。例如,当最大编码单元被划分并被编码时,指示最大编码单元是否被划分的信息被编码。另外,当从最大编码单元划分的子编码单元被划分并被编码时,指示子编码单元是否被划分的信息被编码。The information on the split shape of the maximum coding unit may be information indicating whether each coding unit is split, for example, flag information. For example, when the maximum coding unit is split and encoded, information indicating whether the maximum coding unit is split is encoded. Also, when a sub coding unit split from the maximum coding unit is split and encoded, information indicating whether the sub coding unit is split is encoded.
由于在每个最大编码单元中存在具有不同大小的子编码单元并且针对每个子编码单元确定关于编码模式的信息,故可针对一个最大编码单元确定关于至少一个编码模式的信息。Since sub coding units having different sizes exist in each maximum coding unit and information on encoding modes is determined for each sub coding unit, information on at least one encoding mode may be determined for one maximum coding unit.
图像编码设备100可根据深度的增加通过将最大编码单元的高度和宽度二等分来产生子编码单元。也就是说,当第k深度的编码单元的大小是2N×2N时,第(k+1)深度的编码单元的大小是N×N。The image encoding apparatus 100 may generate sub coding units by halving the height and width of the maximum coding unit according to an increase in depth. That is, when the size of the coding unit of the k-th depth is 2N×2N, the size of the coding unit of the (k+1)-th depth is N×N.
因此,图像编码设备100可考虑图像特征,基于最大编码单元的大小和最大深度,针对每个最大编码单元确定最优划分形状。通过考虑图像特征可变地调整最大编码单元的大小并通过将最大编码单元划分为不同深度的子编码单元而对图像进行编码,具有不同分辨率的图像可被更有效地编码。Accordingly, the image encoding apparatus 100 may determine an optimal split shape for each maximum coding unit based on the size and maximum depth of the maximum coding unit in consideration of image characteristics. By variably adjusting the size of the maximum coding unit in consideration of image characteristics and encoding the image by dividing the maximum coding unit into sub-coding units of different depths, images having different resolutions may be more efficiently encoded.
图2是根据实施例的图像解码设备200的框图。FIG. 2 is a block diagram of an image decoding device 200 according to an embodiment.
参照图2,图像解码设备200包括图像数据获取单元210、编码信息提取器220和图像数据解码器230。Referring to FIG. 2 , an image decoding device 200 includes an image data acquisition unit 210 , an encoding information extractor 220 and an image data decoder 230 .
图像数据获取单元210通过对由图像解码设备200接收的比特流进行解析来获取根据最大编码单元的图像数据,并将图像数据输出到图像数据解码器230。图像数据获取单元210可从当前帧或像条的头提取关于当前帧或像条的最大编码单元的信息。换句话说,图像数据获取单元210划分最大编码单元,从而图像数据解码器230可根据最大编码单元对图像数据进行解码。The image data acquiring unit 210 acquires image data according to the maximum coding unit by parsing the bitstream received by the image decoding apparatus 200 and outputs the image data to the image data decoder 230 . The image data obtaining unit 210 may extract information about a maximum coding unit of a current frame or slice from a header of the current frame or slice. In other words, the image data obtaining unit 210 divides the maximum coding unit so that the image data decoder 230 can decode the image data according to the maximum coding unit.
编码信息提取器220通过对由图像解码设备200接收的比特流进行解析来从当前帧的头提取关于最大编码单元、最大深度、最大编码单元的划分形状和子编码单元的编码模式的信息。关于最大编码单元的划分形状的信息和关于编码模式的信息被提供给图像数据解码器230。The encoding information extractor 220 extracts information about a maximum coding unit, a maximum depth, a split shape of a maximum coding unit, and an encoding mode of a sub coding unit from a header of a current frame by parsing a bitstream received by the image decoding apparatus 200 . Information about the split shape of the maximum coding unit and information about the encoding mode are provided to the image data decoder 230 .
关于最大编码单元的划分形状的信息可包括关于根据深度具有不同大小并包括在最大编码单元中的子编码单元的信息。如上所述,关于划分形状的信息可以是指示每个编码单元是否被划分的信息,例如,标志信息。关于编码模式的信息可包括关于根据子编码单元的预测单元的信息、关于预测模式的信息以及关于变换单元的信息。The information about the split shape of the maximum coding unit may include information about sub coding units having different sizes according to depths and included in the maximum coding unit. As described above, the information on the split shape may be information indicating whether each coding unit is split, for example, flag information. The information about encoding modes may include information about prediction units according to sub coding units, information about prediction modes, and information about transformation units.
图像数据解码器230通过基于由编码信息提取器220提取的信息对每个最大编码单元的图像数据进行解码来恢复当前帧。The image data decoder 230 restores the current frame by decoding the image data of each maximum coding unit based on the information extracted by the encoding information extractor 220 .
图像数据解码器230可基于关于最大编码单元的划分形状的信息对包括在最大编码单元中的子编码单元进行解码。解码处理可包括预测处理和逆变换处理,预测处理包括帧内预测和运动补偿。The image data decoder 230 may decode sub coding units included in the maximum coding unit based on the information about the split shape of the maximum coding unit. The decoding process may include prediction processing including intra prediction and motion compensation, and inverse transform processing.
图像数据解码器230可基于关于每个子编码单元的预测单元的信息和关于预测模式的信息执行帧内预测或帧间预测,从而对每个子编码单元进行预测。图像数据解码器230还可基于关于子编码单元的变换单元的信息对每个子编码单元执行逆变换。The image data decoder 230 may perform intra prediction or inter prediction based on the information about the prediction unit of each sub coding unit and the information about the prediction mode, thereby predicting each sub coding unit. The image data decoder 230 may also perform inverse transformation on each sub-coding unit based on information about transformation units of the sub-coding unit.
图3示出根据本发明的实施例的分层编码单元。FIG. 3 illustrates a layered coding unit according to an embodiment of the present invention.
参照图3,分层编码单元可包括宽度×高度是64×64、32×32、16×16、8×8和4×4的编码单元。除了这些具有完全正方形形状的编码单元之外,还可存在宽度×高度是64×32、32×64、32×16、16×32、16×8、8×16、8×4和4×8的编码单元。Referring to FIG. 3 , hierarchical coding units may include coding units whose width×height is 64×64, 32×32, 16×16, 8×8, and 4×4. In addition to these coding units with a perfectly square shape, there may also be coding unit.
参照图3,对于分辨率是1920×1080的图像数据310,最大编码单元的大小被设置为64×64,最大深度被设置为2。Referring to FIG. 3 , for image data 310 whose resolution is 1920×1080, the size of the maximum coding unit is set to 64×64, and the maximum depth is set to 2.
对于分辨率是1920×1080的图像数据320,最大编码单元的大小被设置为64×64,最大深度被设置为3。对于分辨率是352×288的图像数据330,最大编码单元的大小被设置为16×16,最大深度被设置为2。For the image data 320 whose resolution is 1920×1080, the size of the maximum coding unit is set to 64×64, and the maximum depth is set to 3. For the image data 330 whose resolution is 352×288, the size of the maximum coding unit is set to 16×16, and the maximum depth is set to 2.
当分辨率高或者数据量大时,编码单元的最大大小可以相对大以提高压缩率并精确地反映图像特征。因此,对于具有比图像数据330更高的分辨率的图像数据310和320,可选择64×64作为最大编码单元的大小。When the resolution is high or the amount of data is large, the maximum size of the coding unit may be relatively large to improve the compression ratio and accurately reflect image characteristics. Accordingly, for the image data 310 and 320 having a higher resolution than the image data 330 , 64×64 may be selected as the size of the maximum coding unit.
最大深度指示分层编码单元中的层的总数量。由于图像数据310的最大深度是2,故图像数据310的编码单元315可根据深度的增加而包括长轴大小是64的最大编码单元和长轴大小是32和16的子编码单元。The maximum depth indicates the total number of layers in the hierarchical coding unit. Since the maximum depth of the image data 310 is 2, the coding unit 315 of the image data 310 may include a maximum coding unit having a major axis size of 64 and sub coding units having a major axis size of 32 and 16 according to an increase in depth.
另一方面,由于图像数据330的最大深度是1,故图像数据330的编码单元335可根据深度的增加而包括长轴大小是16的最大编码单元以及长轴大小是8和4的编码单元。On the other hand, since the maximum depth of the image data 330 is 1, the coding unit 335 of the image data 330 may include a maximum coding unit with a major axis size of 16 and coding units with major axis sizes of 8 and 4 according to an increase in depth.
然而,由于图像数据320的最大深度是3,故图像数据320的编码单元325可根据深度的增加而包括长轴大小是64的最大编码单元以及长轴大小是32、16、8和4的子编码单元。由于基于随着深度增加的更小的子编码单元对图像进行编码,实施例可适用于对包括更多精细场景的图像进行编码。However, since the maximum depth of the image data 320 is 3, the coding unit 325 of the image data 320 may include a maximum coding unit with a major axis size of 64 and subcodes with a major axis size of 32, 16, 8, and 4 according to an increase in depth. coding unit. Since an image is encoded based on smaller sub-coding units with increasing depth, the embodiment may be applicable to encoding an image including more fine scenes.
图4是根据本发明的实施例的基于编码单元的图像编码器400的框图。FIG. 4 is a block diagram of a coding unit-based image encoder 400 according to an embodiment of the present invention.
帧内预测单元410对当前帧405中的帧内模式的预测单元执行帧内预测,运动估计器420和运动补偿器425使用当前帧405和参考帧495对帧间模式的预测单元执行帧间预测和运动补偿。The intra prediction unit 410 performs intra prediction on the prediction unit of the intra mode in the current frame 405, and the motion estimator 420 and the motion compensator 425 perform inter prediction on the prediction unit of the inter mode using the current frame 405 and the reference frame 495 and motion compensation.
基于从帧内预测单元410、运动估计器420和运动补偿器425输出的预测单元产生残差值,产生的残差值通过变换器430和量化器440而被输出为量化的变换系数。A residual value is generated based on the prediction unit output from the intra prediction unit 410 , the motion estimator 420 , and the motion compensator 425 , and the generated residual value is output as a quantized transform coefficient through the transformer 430 and the quantizer 440 .
量化的变换系数通过反量化器460和逆变换器470而被恢复为残差值,并且恢复的残差值通过去块单元480和环路滤波单元490被后处理,并被输出为参考帧495。量化的变换系数可通过熵编码器450而被输出为比特流455。The quantized transform coefficients are restored to residual values by an inverse quantizer 460 and an inverse transformer 470, and the restored residual values are post-processed by a deblocking unit 480 and a loop filtering unit 490, and output as a reference frame 495 . The quantized transform coefficients may be output as a bitstream 455 by an entropy encoder 450 .
为了基于根据本发明的实施例的图像编码方法执行编码,图像编码器400的组件(即,帧内预测单元410、运动估计器420、运动补偿器425、变换器430、量化器440、熵编码器450、反量化器460、逆变换器470、去块单元480和环路滤波单元490)基于最大编码单元、根据深度的子编码单元、预测单元和变换单元来执行图像编码处理。In order to perform encoding based on the image encoding method according to an embodiment of the present invention, the components of the image encoder 400 (ie, intra prediction unit 410, motion estimator 420, motion compensator 425, transformer 430, quantizer 440, entropy encoding 450, dequantizer 460, inverse transformer 470, deblocking unit 480, and loop filtering unit 490) perform an image encoding process based on a maximum coding unit, sub coding units according to depths, prediction units, and transformation units.
图5是根据本发明的实施例的基于编码单元的图像解码器500的框图。FIG. 5 is a block diagram of a coding unit-based image decoder 500 according to an embodiment of the present invention.
参照图5,比特流505经过解析器510,从而将被解码的编码图像数据以及解码所必需的编码信息被解析。编码图像数据通过熵解码器520和反量化器530而被输出为反量化的数据,并通过逆变换器540而被恢复为残差值。通过根据编码单元将残差值与帧内预测单元550的帧内预测结果或运动补偿器560的运动补偿结果相加来恢复残差值。恢复的编码单元通过去块单元570和环路滤波单元580而被用于下一编码单元或下一帧的预测。Referring to FIG. 5, a bit stream 505 passes through a parser 510, whereby coded image data to be decoded and coded information necessary for decoding are parsed. The encoded image data is output as dequantized data through the entropy decoder 520 and the dequantizer 530 , and restored as a residual value through the inverse transformer 540 . The residual value is restored by adding the residual value to an intra prediction result of the intra prediction unit 550 or a motion compensation result of the motion compensator 560 according to coding units. The restored coding unit is used for prediction of a next coding unit or a next frame through the deblocking unit 570 and the loop filtering unit 580 .
为了基于根据本发明的实施例的图像解码方法执行解码,图像解码器500的组件(即,解析器510、熵解码器520、反量化器530、逆变换器540、帧内预测单元550、运动补偿器560、去块单元570和环路滤波单元580)基于最大编码单元、根据深度的子编码单元、预测单元和变换单元来执行图像解码处理。In order to perform decoding based on the image decoding method according to the embodiment of the present invention, the components of the image decoder 500 (i.e., parser 510, entropy decoder 520, inverse quantizer 530, inverse transformer 540, intra prediction unit 550, motion The compensator 560, the deblocking unit 570, and the loop filtering unit 580) perform an image decoding process based on a maximum coding unit, sub coding units according to depths, prediction units, and transformation units.
特别地,帧内预测单元550和运动补偿器560通过考虑最大编码单元和深度来按照子编码单元确定预测单元和预测模式,逆变换器540通过考虑变换单元的大小来执行逆变换。In particular, the intra prediction unit 550 and the motion compensator 560 determine a prediction unit and a prediction mode by sub-coding units by considering a maximum coding unit and a depth, and the inverse transformer 540 performs inverse transformation by considering a size of a transformation unit.
图6示出根据本发明的实施例的最大编码单元、子编码单元和预测单元。FIG. 6 illustrates a maximum coding unit, a sub coding unit, and a prediction unit according to an embodiment of the present invention.
图1中示出的图像编码设备100和图2中示出的图像解码设备200通过考虑图像特征使用分层编码单元以执行编码和解码。最大编码单元和最大深度可根据图像特征而被自适应地设置,或根据用户的需要而被不同地设置。The image encoding device 100 shown in FIG. 1 and the image decoding device 200 shown in FIG. 2 use hierarchical coding units to perform encoding and decoding by considering image characteristics. The maximum coding unit and the maximum depth may be adaptively set according to image characteristics, or differently set according to user's needs.
在图6中,分层编码单元结构600具有高度和宽度是64并且最大深度是4的最大编码单元610。深度沿着分层编码单元结构600的垂直轴增加,并且随着深度增加,子编码单元620到650的高度和宽度减小。最大编码单元610和子编码单元620到650的预测单元沿着分层编码单元结构600的水平轴被显示。In FIG. 6 , the hierarchical coding unit structure 600 has a maximum coding unit 610 whose height and width are 64 and a maximum depth is 4. Referring to FIG. The depth increases along the vertical axis of the hierarchical coding unit structure 600, and as the depth increases, the height and width of the sub coding units 620 to 650 decrease. A maximum coding unit 610 and prediction units of sub coding units 620 to 650 are displayed along a horizontal axis of the hierarchical coding unit structure 600 .
最大编码单元610的深度为0,编码单元大小(即,高度和宽度)是64×64。深度沿着垂直轴增加,并且存在大小是32×32且深度是1的子编码单元620,大小是16×16且深度是2的子编码单元630,大小是8×8且深度是3的子编码单元640,以及大小是4×4且深度是4的子编码单元650。大小是4×4且深度是4的子编码单元650是最小编码单元。The depth of the maximum coding unit 610 is 0, and the coding unit size (ie, height and width) is 64×64. The depth increases along the vertical axis, and there is a sub-coding unit 620 with a size of 32×32 and a depth of 1, a sub-coding unit 630 with a size of 16×16 and a depth of 2, and a sub-coding unit with a size of 8×8 and a depth of 3. A coding unit 640, and a sub-coding unit 650 having a size of 4×4 and a depth of 4. The sub coding unit 650 whose size is 4×4 and whose depth is 4 is a minimum coding unit.
参照图6,预测单元的示例根据每个深度沿着水平轴而被示出。也就是说,深度是0的最大编码单元610的预测单元可以是大小等于编码单元610(即,64×64)的预测单元,或者具有小于大小是64×64的编码单元610的大小的大小是64×32的预测单元612、大小是32×64的预测单元614或大小是32×32的预测单元616。Referring to FIG. 6 , examples of prediction units are shown along the horizontal axis according to each depth. That is, the prediction unit of the maximum coding unit 610 whose depth is 0 may be a prediction unit having a size equal to that of the coding unit 610 (ie, 64×64), or having a size smaller than the size of the coding unit 610 whose size is 64×64. The prediction unit 612 is 64×32, the prediction unit 614 is 32×64 in size, or the prediction unit 616 is 32×32 in size.
深度是1且大小是32×32的编码单元620的预测单元可以是大小等于编码单元620(即,32×32)的预测单元,或者具有小于大小是32×32的编码单元620的大小的大小是32×16的预测单元622、大小是16×32的预测单元624或大小是16×16的预测单元626。A prediction unit of a coding unit 620 having a depth of 1 and a size of 32×32 may be a prediction unit having a size equal to that of the coding unit 620 (ie, 32×32), or having a size smaller than the size of the coding unit 620 having a size of 32×32. A prediction unit 622 is 32×16, a prediction unit 624 is 16×32 in size, or a prediction unit 626 is 16×16 in size.
深度是2且大小是16×16的编码单元630的预测单元可以是大小等于编码单元630(即,16×16)的预测单元,或者具有小于大小是16×16的编码单元630的大小的大小是16×8的预测单元632、大小是8×16的预测单元634或大小是8×8的预测单元636。The prediction unit of the coding unit 630 whose depth is 2 and whose size is 16×16 may be a prediction unit having a size equal to that of the coding unit 630 (that is, 16×16), or having a size smaller than the size of the coding unit 630 whose size is 16×16. It is a 16×8 prediction unit 632 , a prediction unit 634 with a size of 8×16 or a prediction unit 636 with a size of 8×8.
深度是3且大小是8×8的编码单元640的预测单元可以是大小等于编码单元640(即,8×8)的预测单元,或者具有小于大小是8×8的编码单元640的大小的大小是8×4的预测单元642、大小是4×8的预测单元644或大小是4×4的预测单元646。A prediction unit of a coding unit 640 whose depth is 3 and whose size is 8×8 may be a prediction unit having a size equal to that of the coding unit 640 (that is, 8×8), or having a size smaller than the size of the coding unit 640 whose size is 8×8. is an 8×4 prediction unit 642 , a 4×8 prediction unit 644 , or a 4×4 prediction unit 646 .
最后,深度是4且大小是4×4的编码单元650是最大深度的编码单元。编码单元650的预测单元可以是大小等于预测单元650的大小的预测单元。然而,即使编码单元具有最大深度,编码单元的大小也不需要总是等于该编码单元的预测单元的大小。与编码单元610到640类似,也可通过将编码单元650划分为作为预测单元的子编码单元来对编码单元650进行预测。Finally, a coding unit 650 having a depth of 4 and a size of 4×4 is a coding unit of a maximum depth. The prediction unit of the coding unit 650 may be a prediction unit having a size equal to that of the prediction unit 650 . However, even if a coding unit has the maximum depth, the size of the coding unit does not always need to be equal to the size of a prediction unit of the coding unit. Similar to the coding units 610 to 640 , the coding unit 650 may also be predicted by dividing the coding unit 650 into sub-coding units that are prediction units.
图7示出根据本发明的实施例的编码单元和变换单元。FIG. 7 illustrates coding units and transformation units according to an embodiment of the present invention.
图1中示出的图像编码设备100和图2中示出的图像解码设备200对最大编码单元本身或者通过分别将最大编码单元划分为大小等于或小于最大编码单元的大小的至少一个子编码单元来执行编码和解码。在编码和解码处理中,可以以这样的方式来选择变换单元的大小:不管编码单元和预测单元而最大化压缩率。例如,参照图7,当当前编码单元710的大小是64×64时,可使用大小是32×32的变换单元720执行变换。The image encoding device 100 shown in FIG. 1 and the image decoding device 200 shown in FIG. 2 perform a maximum coding unit by itself or by dividing the maximum coding unit into at least one sub-coding unit whose size is equal to or smaller than the size of the maximum coding unit. to perform encoding and decoding. In the encoding and decoding process, the size of the transformation unit may be selected in such a manner as to maximize the compression rate regardless of the coding unit and the prediction unit. For example, referring to FIG. 7 , when a size of a current coding unit 710 is 64×64, transformation may be performed using a transformation unit 720 having a size of 32×32.
图8a和图8b示出根据本发明的实施例的编码单元、预测单元和变换单元的划分形状。8a and 8b illustrate split shapes of coding units, prediction units, and transformation units according to an embodiment of the present invention.
在图8a中,左示图示出由图1中示出的图像编码设备100选择的用于对最大编码单元810进行编码的划分形状。图像编码设备100将最大编码单元810划分为各种形状,执行编码,并通过基于R-D代价将各种划分形状的编码结果彼此进行比较来选择最优划分形状。当照其原样对最大编码单元810进行编码最优时,如图8a和图8b所示,可对最大编码单元810进行编码而不划分最大编码单元810。In FIG. 8A , the left diagram illustrates a split shape selected by the image encoding apparatus 100 shown in FIG. 1 for encoding a maximum coding unit 810 . The image encoding apparatus 100 divides the maximum coding unit 810 into various shapes, performs encoding, and selects an optimal split shape by comparing encoding results of various split shapes with each other based on an R-D cost. When it is optimal to encode the maximum coding unit 810 as it is, as shown in FIGS. 8a and 8b , the maximum coding unit 810 may be encoded without dividing the maximum coding unit 810 .
在图8a的左示图中,通过将深度是0的最大编码单元810划分为深度等于或大于1的子编码单元来对最大编码单元810进行编码。也就是说,最大编码单元810被划分为4个深度是1的子编码单元,所有或一些深度是1的子编码单元被划分为深度是2的子编码单元。In the left diagram of FIG. 8A , the maximum coding unit 810 is encoded by splitting the maximum coding unit 810 whose depth is 0 into sub-coding units whose depth is equal to or greater than 1. Referring to FIG. That is, the maximum coding unit 810 is divided into four depth-1 sub-coding units, and all or some depth-1 sub-coding units are divided into depth-2 sub-coding units.
深度是1的子编码单元中位于右上侧的子编码单元和位于左下侧的子编码单元被划分为深度等于或大于2的子编码单元。一些深度等于或大于2的子编码单元可被划分为深度等于或大于3的子编码单元。A sub-coding unit located at an upper right side and a sub-coding unit located at a lower left side among sub-coding units having a depth of 1 are divided into sub-coding units having a depth equal to or greater than 2. Some sub-coding units having a depth equal to or greater than 2 may be divided into sub-coding units having a depth equal to or greater than 3.
在图8a中,右示图示出最大编码单元810的预测单元的划分形状。In FIG. 8A , the right diagram illustrates split shapes of prediction units of a maximum coding unit 810 .
在图8a中的右示图中,用于最大编码单元810的预测单元860可从最大编码单元810被不同地划分。换句话说,用于每个子编码单元的预测单元可小于相应的子编码单元。In the right diagram in FIG. 8A , the prediction unit 860 for the maximum coding unit 810 may be split differently from the maximum coding unit 810 . In other words, the prediction unit for each sub-coding unit may be smaller than the corresponding sub-coding unit.
例如,用于深度是1的子编码单元中位于右下侧的子编码单元854的预测单元可小于子编码单元854。此外,用于深度是2的子编码单元814、816、818、828、850和852中的一些子编码单元814、816、850和852的预测单元可分别小于子编码单元814、816、850和852。For example, a prediction unit for a sub coding unit 854 located on a lower right side among sub coding units whose depth is 1 may be smaller than the sub coding unit 854 . Also, prediction units for some of the sub-coding units 814, 816, 850, and 852 of the sub-coding units 814, 816, 818, 828, 850, and 852 whose depth is 2 may be smaller than those of the sub-coding units 814, 816, 850, and 852, respectively. 852.
此外,用于深度是3的子编码单元822、832和848的预测单元可分别小于子编码单元822、832和848。预测单元可具有各个子编码单元按照高度或宽度的方向被二等分的形状或具有各个子编码单元按照高度或宽度的方向被四等分的形状。Also, prediction units for the sub coding units 822, 832, and 848 whose depth is 3 may be smaller than the sub coding units 822, 832, and 848, respectively. The prediction unit may have a shape in which each sub coding unit is bisected in a height or width direction or a shape in which each sub coding unit is quartered in a height or width direction.
图8b示出根据本发明的实施例的预测单元和变换单元。Fig. 8b shows prediction units and transform units according to an embodiment of the present invention.
在图8b中,左示图示出用于图8a中示出的最大编码单元810的预测单元的划分形状,右示图示出最大编码单元810的变换单元的划分形状。In FIG. 8B , a left diagram illustrates split shapes of prediction units for the maximum coding unit 810 shown in FIG. 8A , and a right diagram illustrates split shapes of transformation units of the largest coding unit 810 .
在图8b的右示图中,变换单元870的划分形状可与预测单元860不同地被设置。In the right diagram of FIG. 8B , the split shape of the transformation unit 870 may be set differently from the prediction unit 860 .
例如,即使以深度是1的编码单元854的高度被二等分的形状来选择用于编码单元854的预测单元,也可以以与编码单元854相同的大小来选择变换单元。相似地,即使以深度是2的编码单元814和850中的每一个的高度被二等分的形状来选择用于编码单元814和850的预测单元,也可以以与编码单元814和850中的每一个的原始大小相同的大小来选择变换单元。For example, even if a prediction unit for the coding unit 854 is selected in a shape in which the height of the coding unit 854 whose depth is 1 is halved, a transformation unit may be selected in the same size as the coding unit 854 . Similarly, even if the prediction units for the coding units 814 and 850 are selected in a shape in which the height of each of the coding units 814 and 850 whose depth is 2 is bisected, it is possible to use Each of the original sizes is the same size as the selected transform unit.
可以以小于预测单元的大小来选择变换单元。例如,当以深度是2的编码单元852的宽度被二等分的形状来选择用于编码单元852的预测单元时,可以以编码单元852按照高度和宽度的方向被四等分的形状来选择变换单元。A transformation unit may be selected with a smaller size than a prediction unit. For example, when the prediction unit for the coding unit 852 is selected in a shape in which the width of the coding unit 852 having a depth of 2 is bisected, it may be selected in a shape in which the coding unit 852 is quartered in the direction of height and width. transform unit.
图9是根据本发明的另一实施例的图像编码设备900的框图。参照图9,图像编码设备900可被包括在图1的图像编码设备100或图4的图像编码器400中以基于帧间预测对当前块进行编码。FIG. 9 is a block diagram of an image encoding device 900 according to another embodiment of the present invention. Referring to FIG. 9 , an image encoding apparatus 900 may be included in the image encoding apparatus 100 of FIG. 1 or the image encoder 400 of FIG. 4 to encode a current block based on inter prediction.
参照图9,图像编码设备900包括运动矢量确定器910和编码器920。Referring to FIG. 9 , an image encoding apparatus 900 includes a motion vector determiner 910 and an encoder 920 .
在一些编码模式中,基于已被先前编码的至少一个块的运动矢量来确定当前块的运动矢量,基于确定的运动矢量来对当前块进行编码。这些编码模式的示例是直接预测模式和跳过模式。在直接预测模式和跳过模式中,基于已被先前编码的信息来确定当前块的运动矢量,当前块的运动矢量被另外编码为关于当前块的信息。In some encoding modes, the motion vector of the current block is determined based on the motion vector of at least one block that has been previously encoded, and the current block is encoded based on the determined motion vector. Examples of these coding modes are direct prediction mode and skip mode. In the direct prediction mode and the skip mode, the motion vector of the current block is determined based on information that has been previously encoded, and the motion vector of the current block is additionally encoded as information on the current block.
然而,在直接预测模式中,通过从当前块减去使用运动矢量产生的预测块而产生的残差块被编码为关于像素值的信息,然而,在跳过模式中,预测块被视为与当前块相同,只有指示在跳过模式下执行编码的标志信息被编码为关于像素值的信息。However, in direct prediction mode, a residual block generated by subtracting a prediction block generated using a motion vector from the current block is encoded as information on pixel values, however, in skip mode, the prediction block is regarded as the same as The current block is the same, and only flag information indicating that encoding is performed in skip mode is encoded as information on pixel values.
虽然直接预测模式和跳过模式都是基于帧间预测的编码模式,但是由于运动矢量不被另外编码,因此压缩率高。然而,在直接预测模式和跳过模式中,由于通过仅按照特定方向对当前块进行预测来对当前块进行编码,因此这些模式中的每个模式的命中率和预测的精度可能会低。因此,当根据直接预测模式或跳过模式对包括在双向预测图像中的当前块进行编码时,图像编码设备900通过按照各种方向执行预测来对当前块进行编码,这在以下将详细描述。Although both the direct prediction mode and the skip mode are encoding modes based on inter prediction, since motion vectors are not separately encoded, the compression rate is high. However, in the direct prediction mode and the skip mode, since the current block is encoded by predicting the current block only in a specific direction, the hit rate and prediction accuracy of each of these modes may be low. Accordingly, when encoding a current block included in a bidirectionally predicted image according to a direct prediction mode or a skip mode, the image encoding apparatus 900 encodes the current block by performing prediction in various directions, which will be described in detail below.
图10是示出根据本发明的实施例的对包括在双向预测图像中的块进行预测的方法的示图。FIG. 10 is a diagram illustrating a method of predicting a block included in a bidirectional predictive image according to an embodiment of the present invention.
参照图10,通过参照在当前图像1000之前的先前图像和在当前图像1000之后的后续图像1030中的至少一个,对包括在作为双向预测图像的当前图像1000中的当前块1010进行预测编码。从先前图像1020和后续图像1030中的至少一个检测与当前块1010相应的至少一个块(例如,先前块1022和后续块1032),随后基于检测的块1022或1032来对当前块1010进行预测编码。Referring to FIG. 10 , a current block 1010 included in a current image 1000 as a bidirectional predictive image is predictively encoded by referring to at least one of a previous image before the current image 1000 and a subsequent image 1030 after the current image 1000 . Detect at least one block corresponding to the current block 1010 (for example, the previous block 1022 and the subsequent block 1032) from at least one of the previous image 1020 and the subsequent image 1030, and then predictively encode the current block 1010 based on the detected block 1022 or 1032 .
换句话说,如果从当前图像1000到先前图像1020的方向是第一方向(L0方向),则可按照第一方向基于从先前图像1020检测的先前块1022来对当前块1010进行预测(以下,称为“第一方向预测”)。同样,如果从当前图像1000到后续图像1030的方向是第二方向(L1方向),则可按照第二方向基于从后续图像1030检测的后续块1032来对当前块1010进行预测(以下,称为“第二方向预测”)。此外,可对当前块1010执行第一方向预测和第二方向预测两者,即,当前块1010可被双向预测。In other words, if the direction from the current image 1000 to the previous image 1020 is the first direction (L0 direction), the current block 1010 may be predicted based on the previous block 1022 detected from the previous image 1020 in the first direction (hereinafter, called "first-direction prediction"). Likewise, if the direction from the current image 1000 to the subsequent image 1030 is the second direction (L1 direction), the current block 1010 may be predicted based on the subsequent block 1032 detected from the subsequent image 1030 according to the second direction (hereinafter referred to as "Second Direction Forecast"). Also, both first-direction prediction and second-direction prediction may be performed on the current block 1010, that is, the current block 1010 may be bi-directionally predicted.
然而,仅当当前块1010被双向预测时,可执行根据现有技术的直接预测模式。换句话说,当基于第一方向预测或第二方向预测对当前块1010进行预测编码时,当前块1010不能在所述直接预测模式下被编码。同样,仅当当前块1010被双向预测时,可执行根据现有技术的跳过模式。在根据现有技术的跳过模式下,基于与当前块1010邻近的先前块的运动矢量确定的当前块1010的运动矢量是第一方向上的运动矢量mv_L0,根据第一方向预测产生的预测块被视为与当前块1010相同,指示根据跳过模式执行编码的标志信息被编码。However, only when the current block 1010 is bi-predicted, the direct prediction mode according to the related art may be performed. In other words, when the current block 1010 is predictively encoded based on the first-direction prediction or the second-direction prediction, the current block 1010 cannot be encoded in the direct prediction mode. Also, only when the current block 1010 is bi-predicted, the skip mode according to the related art may be performed. In the skip mode according to the prior art, the motion vector of the current block 1010 determined based on the motion vectors of the previous blocks adjacent to the current block 1010 is the motion vector mv_L0 in the first direction, and the prediction block generated according to the first direction prediction Regarded as the same as the current block 1010, flag information indicating that encoding is performed according to a skip mode is encoded.
也就是说,根据现有技术,虽然可对包括在双向预测图像中的块执行第一方向预测、第二方向预测和双向预测,但是仅当按特定方向执行预测时,才可使用直接预测模式和跳过模式。因此,导致压缩率提高的直接预测模式和跳过模式的使用受到限制。That is, according to the prior art, although first-direction prediction, second-direction prediction, and bidirectional prediction can be performed on a block included in a bidirectional predictive image, the direct prediction mode can be used only when prediction is performed in a specific direction and skip mode. Therefore, the use of the direct prediction mode and the skip mode, which lead to an improvement in the compression ratio, is limited.
为了解决这个问题,根据当前实施例的图像编码设备900根据这样的图像编码方法执行编码:基于先前编码信息确定当前块1010的运动矢量,可按照各种方法执行预测而不必对运动矢量进行编码。To solve this problem, the image encoding apparatus 900 according to the current embodiment performs encoding according to an image encoding method in which a motion vector of the current block 1010 is determined based on previous encoding information, prediction may be performed in various methods without encoding the motion vector.
运动矢量确定器910确定当前块1010的第一方向运动矢量和第二方向运动矢量以执行第一方向预测、第二方向预测和双向预测。基于在当前块1010被编码之前已先前编码的至少一个块的运动矢量来确定第一方向运动矢量和第二方向运动矢量。The motion vector determiner 910 determines a first direction motion vector and a second direction motion vector of the current block 1010 to perform first direction prediction, second direction prediction and bidirectional prediction. The first direction motion vector and the second direction motion vector are determined based on the motion vector of at least one block that has been previously coded before the current block 1010 is coded.
可使用根据现有技术确定运动矢量的方法来确定第一方向运动矢量和第二方向运动矢量。例如,如果基于直接预测模式对当前块1010进行编码,则可使用根据基于H.264/AVC的直接预测模式确定运动矢量的方法来确定运动矢量,其中,在直接预测模式下,关于当前块1010的运动矢量的信息不被编码,而关于残差块的信息被编码。如果基于跳过模式对当前块1010进行编码,则可使用根据基于H.264/AVC的跳过模式确定运动矢量的方法来确定运动矢量,其中,在跳过模式下,关于运动矢量的信息和关于残差块的信息被编码。The first direction motion vector and the second direction motion vector may be determined using a method of determining motion vectors according to the prior art. For example, if the current block 1010 is encoded based on the direct prediction mode, the motion vector can be determined using the method of determining the motion vector according to the direct prediction mode based on H.264/AVC, wherein, in the direct prediction mode, the current block 1010 The information about the motion vector is not encoded, but the information about the residual block is encoded. If the current block 1010 is encoded based on the skip mode, the motion vector can be determined using the method of determining the motion vector according to the skip mode based on H.264/AVC, wherein, in the skip mode, the information on the motion vector and Information about the residual block is encoded.
基于H.264/AVC的直接预测模式可被分为时间直接预测模式和空间直接预测模式。因此,运动矢量确定器910可通过使用在基于H.264/AVC的时间直接预测模式下确定运动矢量的方法或通过使用在基于H.264/AVC的空间直接预测模式下确定运动矢量的方法来确定第一方向运动矢量和第二方向运动矢量。现在将参照图11a和图11b详细描述这些方法。Direct prediction modes based on H.264/AVC can be classified into temporal direct prediction modes and spatial direct prediction modes. Therefore, the motion vector determiner 910 may determine the motion vector by using the method of determining the motion vector in the H.264/AVC-based temporal direct prediction mode or by using the method of determining the motion vector in the H.264/AVC-based spatial direct prediction mode. A first directional motion vector and a second directional motion vector are determined. These methods will now be described in detail with reference to Figures 11a and 11b.
图11a是示出根据本发明的实施例的基于先前编码块的运动矢量确定当前块的运动矢量的方法的示图。11a is a diagram illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
参照图11a,当基于时间直接预测模式对包括在当前图像1110中的当前块1010进行编码时,可使用后续块1120的运动矢量mv_colA来产生当前块1010的运动矢量,其中,后续块1120被包括在当前图像1110之后的后续图像1114中,并与当前块1010并置。Referring to FIG. 11a, when encoding a current block 1010 included in a current image 1110 based on a temporal direct prediction mode, a motion vector mv_colA of a subsequent block 1120 may be used to generate a motion vector of the current block 1010, wherein the subsequent block 1120 is included in In a subsequent image 1114 after the current image 1110 and juxtaposed with the current block 1010 .
换句话说,如果后续图像1114是锚(anchor)图像,则可使用包括在锚图像1114中的后续块1120的运动矢量mv_colA来确定当前块1010的第一方向运动矢量mv_L0A和第二方向运动矢量mv_L1A。可通过基于当前图像1110与在当前图像1110之前的先前图像1112之间的时间距离以及锚图像1114与先前图像1112之间的时间距离对后续块1120的运动矢量mv_colA进行缩放(scale),来确定当前块1010的第一方向运动矢量mv_L0A和第二方向运动矢量mv_L1A。In other words, if the subsequent image 1114 is an anchor image, the first direction motion vector mv_LOA and the second direction motion vector mv_LOA of the current block 1010 may be determined using the motion vector mv_colA of the subsequent block 1120 included in the anchor image 1114 mv_L1A. can be determined by scaling the motion vector mv_colA of the subsequent block 1120 based on the temporal distance between the current image 1110 and the previous image 1112 preceding the current image 1110 and the temporal distance between the anchor image 1114 and the previous image 1112 The first direction motion vector mv_L0A and the second direction motion vector mv_L1A of the current block 1010 .
例如,如果后续块1120的运动矢量mv_colA针对从先前图像1112检测的块1122被产生,则可使用以下等式来产生当前块1110的第一方向运动矢量mv_L0A和第二方向运动矢量mv_L1A:For example, if the motion vector mv_colA of the subsequent block 1120 is generated for the block 1122 detected from the previous image 1112, the following equation may be used to generate the first direction motion vector mv_L0A and the second direction motion vector mv_L1A of the current block 1110:
mv_L0A=(t1/t2)×mv_colAmv_LOA=(t1/t2)×mv_colA
mv_L1A=mv_L0A-mv_colA,mv_L1A=mv_L0A-mv_colA,
其中,“mv_L0A”和“mv_L1A”分别表示当前块1010的第一方向运动矢量和第二方向运动矢量。Wherein, "mv_LOA" and "mv_L1A" represent the first-direction motion vector and the second-direction motion vector of the current block 1010, respectively.
图11b是示出根据本发明的另一实施例的基于先前编码块的运动矢量确定当前块的运动矢量的方法的示图。11b is a diagram illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to another embodiment of the present invention.
参照图11b,可基于与当前块1100邻近的块1130、1132和1134的运动矢量mv_A、mv_B和mv_C来确定当前块1010的第一方向运动矢量和第二方向运动矢量。可基于位于当前块1010的左侧、上侧和最右上侧的块的运动矢量来确定当前块1010的第一方向运动矢量和第二方向运动矢量。Referring to FIG. 11b , the first and second direction motion vectors of the current block 1010 may be determined based on motion vectors mv_A, mv_B, and mv_C of blocks 1130 , 1132 , and 1134 adjacent to the current block 1100 . A first-direction motion vector and a second-direction motion vector of the current block 1010 may be determined based on motion vectors of blocks located to the left, upper, and uppermost right of the current block 1010 .
当根据空间直接预测模式对当前块1010进行编码时,运动矢量mv_A、mv_B和mv_C中的至少一个第一方向运动矢量之间的中值被确定为当前块1010的第一方向运动矢量,运动矢量mv_A、mv_B和mv_C中的至少一个第二方向运动矢量之间的中值被确定为当前块1010的第二方向运动矢量。通过将所述至少一个第二方向运动矢量设置为“0”来计算所述至少一个第一方向运动矢量之间的中值,来确定第一方向运动矢量,通过将所述至少一个第一方向运动矢量设置为“0”来计算至少一个第二方向运动矢量之间的中值,来确定第二方向运动矢量。When the current block 1010 is encoded according to the spatial direct prediction mode, the median value among at least one first-direction motion vector among the motion vectors mv_A, mv_B, and mv_C is determined as the first-direction motion vector of the current block 1010, the motion vector A median value among at least one second-direction motion vector among mv_A, mv_B, and mv_C is determined as the second-direction motion vector of the current block 1010 . The first direction motion vector is determined by calculating the median value between the at least one first direction motion vector by setting the at least one second direction motion vector to "0", by setting the at least one first direction motion vector The motion vector is set to "0" to calculate a median value between at least one motion vector in the second direction to determine the motion vector in the second direction.
在由运动矢量mv_A、mv_B和mv_C确定的参考图像中与最小第一方向参考索引相应的图像被确定为第一方向参考图像,在由运动矢量mv_A、mv_B和mv_C确定的参考图像中与最小第二方向参考索引相应的图像被确定为第二方向参考图像。Among the reference pictures determined by the motion vectors mv_A, mv_B and mv_C, the picture corresponding to the smallest first-direction reference index is determined as the first-direction reference picture, and among the reference pictures determined by the motion vectors mv_A, mv_B and mv_C, the picture corresponding to the smallest first-direction reference index is determined as the first-direction reference picture. The picture corresponding to the two-direction reference index is determined as the second-direction reference picture.
当根据跳过模式对当前块1010进行编码时,如图11b所示,与当前块1010邻近的块1130、1132和1134的运动矢量mv_A、mv_B和mv_C中的至少一个第一方向运动矢量之间的中值可被确定为当前块1010的运动矢量。When the current block 1010 is encoded according to the skip mode, as shown in FIG. The median value of can be determined as the motion vector of the current block 1010 .
如果图9的图像编码设备900如以上参照图11a或图11b所述确定当前块的运动矢量并对当前块进行编码,则解码端如以上参照图11a或图11b所述确定当前块的运动矢量并恢复当前图像。换句话说,图像编码端和图像解码端可隐含地共享相同的确定运动矢量的方法,并根据共享的方法来确定当前块的运动矢量。If the image coding apparatus 900 of FIG. 9 determines the motion vector of the current block as described above with reference to FIG. 11a or 11b and encodes the current block, the decoding end determines the motion vector of the current block as described above with reference to FIG. 11a or 11b and restore the current image. In other words, the image encoding end and the image decoding end may implicitly share the same method for determining the motion vector, and determine the motion vector of the current block according to the shared method.
然而,根据本发明的另一实施例,图像编码端可基于在当前块被编码之前编码的多个先前块的运动矢量来产生多个运动矢量候选,对指定所述多个运动矢量候选中的当前块的运动矢量的信息进行明确地编码,并将编码的结果插入比特流。在这种情况下,图像解码端可基于插入比特流的编码的结果来确定当前块的运动矢量。现将参照图12a和图12b来描述这样的方法。However, according to another embodiment of the present invention, the image encoding end may generate a plurality of motion vector candidates based on motion vectors of a plurality of previous blocks encoded before the current block is encoded, specifying a motion vector among the plurality of motion vector candidates The information of the motion vector of the current block is encoded explicitly, and the encoded result is inserted into the bitstream. In this case, the image decoding end may determine the motion vector of the current block based on the result of the encoding inserted into the bitstream. Such a method will now be described with reference to Figures 12a and 12b.
图12a和图12b是示出根据本发明的实施例的基于先前编码块的运动矢量确定当前块的运动矢量的方法的示图。12a and 12b are diagrams illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
参照图12a,图9的运动矢量确定器910可基于与当前块邻近的先前编码块的运动矢量来产生多个运动矢量候选。所述多个运动矢量候选可以是与当前块的上侧邻近的块中的最左侧块a0的运动矢量、与当前块的左侧邻近的最上侧块b0的运动矢量、与当前块的右上侧邻近的块c的运动矢量、与当前块的左上侧邻近的块d的运动矢量以及与当前块的右下侧邻近的块e的运动矢量。Referring to FIG. 12a, the motion vector determiner 910 of FIG. 9 may generate a plurality of motion vector candidates based on motion vectors of previously encoded blocks adjacent to the current block. The plurality of motion vector candidates may be the motion vector of the leftmost block a0 among the blocks adjacent to the upper side of the current block, the motion vector of the uppermost block b0 adjacent to the left side of the current block, and the motion vector of the uppermost block b0 adjacent to the left side of the current block, The motion vector of block c adjacent to the upper right side of , the motion vector of block d adjacent to the upper left side of the current block, and the motion vector of block e adjacent to the lower right side of the current block.
最左侧块a0、最上侧块b0、块c和块d的运动矢量中的第一方向运动矢量之一可被确定为当前块的第一方向运动矢量。最左侧块a0、最上侧块b0、块c和块d的运动矢量中的第二方向运动矢量之一可被确定为当前块的第二方向运动矢量。例如,如果最左侧块a0、最上侧块b0、块c和块d中的最左侧块a0和最上侧块b0的运动矢量是第一方向运动矢量,则最左侧块a0和最上侧块b0的运动矢量之一可被确定为当前块的第一方向运动矢量,块c和块d的运动矢量之一可被确定为当前块的第二方向运动矢量。One of the first direction motion vectors among the motion vectors of the leftmost block a 0 , the uppermost block b 0 , the block c, and the block d may be determined as the first direction motion vector of the current block. One of the second direction motion vectors among the motion vectors of the leftmost block a 0 , the uppermost block b 0 , the block c, and the block d may be determined as the second direction motion vector of the current block. For example, if the motion vectors of the leftmost block a 0 and the uppermost block b 0 among the leftmost block a 0 , uppermost block b 0 , block c, and block d are the first direction motion vector, then the leftmost block One of the motion vectors of a 0 and the uppermost block b 0 may be determined as the first direction motion vector of the current block, and one of the motion vectors of the blocks c and d may be determined as the second direction motion vector of the current block.
各种方法可被用于将所述多个运动矢量候选之一确定为当前块的运动矢量,但是,通常可按照这样的方法来选择当前块的运动矢量:当前块可基于运动矢量被更精确地预测。如果当在用为第一方向运动矢量的最左侧块a0和最上侧块b0的运动矢量中使用最左侧块a0的运动矢量时当前块被更精确地预测,则最左侧块a0的运动矢量可被确定为当前块的第一方向运动矢量。可从当前块减去通过分别使用所述多个运动矢量候选的运动矢量来预测当前块而获得的预测块以产生残差块,所述残差块中的每一个的绝对值和(SAD)可被计算,然后,在所述多个运动矢量候选中具有最小SAD的运动矢量可被确定为当前块的运动矢量。Various methods can be used to determine one of the plurality of motion vector candidates as the motion vector of the current block, however, the motion vector of the current block can generally be selected in such a way that the current block can be more precisely selected based on the motion vector predicted. If the current block is more accurately predicted when the motion vector of the leftmost block a 0 is used among the motion vectors of the leftmost block a 0 and the uppermost block b 0 used as the first direction motion vector, the leftmost The motion vector of block a0 may be determined as the first direction motion vector of the current block. Predicted blocks obtained by predicting the current block using motion vectors of the plurality of motion vector candidates, respectively, may be subtracted from the current block to generate residual blocks, each of which has a sum of absolute values (SAD) may be calculated, and then, a motion vector having the smallest SAD among the plurality of motion vector candidates may be determined as the motion vector of the current block.
参照图12b,与当前块邻近的所有块的运动矢量可被用作多个运动矢量候选。换句话说,不仅与当前块的上侧邻近的块(包括最左侧块a0)的运动矢量,而且与当前块的左侧邻近的块(包括最上侧块b0)的运动矢量都可被用作所述多个运动矢量候选。Referring to FIG. 12b, motion vectors of all blocks adjacent to a current block may be used as a plurality of motion vector candidates. In other words, not only motion vectors of blocks adjacent to the upper side of the current block (including the leftmost block a 0 ) but also motion vectors of blocks adjacent to the left side of the current block (including the uppermost block b 0 ) can be are used as the plurality of motion vector candidates.
如以上参照图12b所述,与当前块邻近的所有块的多个运动矢量候选中的第一方向运动矢量之一和第二方向运动矢量之一可分别被确定为当前块的第一方向运动矢量和第二方向运动矢量。As described above with reference to FIG. 12b, one of the first-direction motion vectors and one of the second-direction motion vectors among the plurality of motion vector candidates of all blocks adjacent to the current block can be determined as the first-direction motion of the current block, respectively. vector and the motion vector in the second direction.
因此,参照图11a、图11b、图12a和图12b,运动矢量确定器910可通过使用以下等式来将多个运动矢量候选之一确定为当前块的运动矢量:Therefore, referring to FIGS. 11a, 11b, 12a, and 12b, the motion vector determiner 910 may determine one of a plurality of motion vector candidates as the motion vector of the current block by using the following equation:
C={median(mv_a0,mv_b0,mv_c),mv_a0,mv_a1...,mv_aN,mv_b0,mv_b1,...,mv_bN,mv_c,mv_d,mv_e,mv_L0A,mv_L1A},C={median(mv_a0,mv_b0,mv_c),mv_a0,mv_a1...,mv_aN,mv_b0,mv_b1,...,mv_bN,mv_c,mv_d,mv_e,mv_L0A,mv_L1A},
其中,“mv_L0A”和“mv_L1A”可表示根据图11a的方法而获得的运动矢量,“median(mv_a0,mv_b0,mv_c)”可表示根据图11b的方法获得的运动矢量。如以上参照图12a和图12b描述了其它运动矢量。Wherein, "mv_LOA" and "mv_L1A" may represent motion vectors obtained according to the method in Fig. 11a, and "median(mv_a0, mv_b0, mv_c)" may represent motion vectors obtained according to the method in Fig. 11b. Other motion vectors are described above with reference to Figures 12a and 12b.
可从包括在以上描述的C集中的第一方向运动矢量确定当前块的第一方向运动矢量,可从包括在C集中的第二方向运动矢量确定当前块的第二方向运动矢量。The first directional motion vector of the current block may be determined from the first directional motion vector included in the C set described above, and the second directional motion vector of the current block may be determined from the second directional motion vector included in the C set.
根据本发明的另一实施例,运动矢量候选的总数量可被确定为小,并且当前块的运动矢量可基于以下等式从运动矢量候选中被确定:According to another embodiment of the present invention, the total number of motion vector candidates may be determined to be small, and the motion vector of the current block may be determined from the motion vector candidates based on the following equation:
C={median(mv_a',mv_b',mv_c'),mv_a',mv_b',mv_c',mv_L0A,mv_L1A},C={median(mv_a',mv_b',mv_c'),mv_a',mv_b',mv_c',mv_L0A,mv_L1A},
其中,“mv_x”表示块x的运动矢量,“median()”表示中值,“mv_a”表示运动矢量mv_a0、mv_a1、…、mv_aN中的第一有效运动矢量。例如,如果使用帧间预测对块a0进行编码,则块a0的运动矢量mv_a0无效,因此mv_a'=mv_a1。如果块a1的运动矢量mv_a1也无效,则mv_a'=mv_a2。Among them, "mv_x" indicates the motion vector of block x, "median()" indicates the median value, and "mv_a" indicates the first valid motion vector among the motion vectors mv_a0, mv_a1, . . . , mv_aN. For example, if block a0 is coded using inter prediction, the motion vector mv_a0 of block a0 is invalid, so mv_a'=mv_a1. If the motion vector mv_a1 of block a1 is also invalid, then mv_a'=mv_a2.
同样,“mv_b”表示运动矢量mv_b0、mv_b1、…、mv_bN中的第一有效运动矢量,“mv_c”表示运动矢量mv_c、mv_d、…、mv_e中的第一有效运动矢量。Likewise, "mv_b" indicates the first effective motion vector among the motion vectors mv_b0, mv_b1, ..., mv_bN, and "mv_c" indicates the first effective motion vector among the motion vectors mv_c, mv_d, ..., mv_e.
“mv_L0A”和“mv_L1A”可表示根据图11a的方法获得的运动矢量。根据本发明的另一实施例,取代于运动矢量mv_L0A和mv_L1A,使用邻近图像之间的时间距离产生的运动矢量可被用作运动矢量候选。将参照图13a和图13b详细描述该实施例。"mv_LOA" and "mv_L1A" may represent motion vectors obtained according to the method of FIG. 11a. According to another embodiment of the present invention, instead of motion vectors mv_L0A and mv_L1A, motion vectors generated using temporal distances between adjacent images may be used as motion vector candidates. This embodiment will be described in detail with reference to Figures 13a and 13b.
图13a和图13b是示出根据本发明的实施例的基于先前编码块的运动矢量确定当前块的运动矢量的方法的示图。13a and 13b are diagrams illustrating a method of determining a motion vector of a current block based on a motion vector of a previously encoded block according to an embodiment of the present invention.
参照图13a,基于时间距离的运动矢量候选可与根据现有技术的时间直接预测模式不同地被确定。Referring to FIG. 13a, temporal distance-based motion vector candidates may be determined differently from the temporal direct prediction mode according to the related art.
包括在当前图像1110中的当前块1010的运动矢量候选可从块1320的运动矢量产生,其中,块1320包括在当前图像1110之前的先前图像1112中并与当前块1010并置。例如,如果与当前块1010并置的块1320的运动矢量mv_colB针对从后续图像1114检测的块1322被产生,则可使用以下等式来产生当前块1010的运动矢量候选mv_L0B和mv_L1B:A motion vector candidate of the current block 1010 included in the current image 1110 may be generated from a motion vector of a block 1320 included in the previous image 1112 preceding the current image 1110 and collocated with the current block 1010 . For example, if the motion vector mv_colB of the block 1320 collocated with the current block 1010 is generated for the block 1322 detected from the subsequent image 1114, the following equations may be used to generate the motion vector candidates mv_LOB and mv_L1B of the current block 1010:
mv_L1B=(t3/t4)×mv_colBmv_L1B=(t3/t4)×mv_colB
mv_L0B=mv_L1B-mv_colB,mv_L0B=mv_L1B-mv_colB,
其中,“mv_L0B”表示当前块1010的第一方向运动矢量候选,“mv_L1B”表示当前块1010的第二方向运动矢量候选。Wherein, “mv_LOB” represents a first-direction motion vector candidate of the current block 1010 , and “mv_L1B” represents a second-direction motion vector candidate of the current block 1010 .
参照图13b,可使用块1330的运动矢量mv_colC来确定包括在当前图像1110中的当前块1010的运动矢量候选mv_L0C,其中,块1330包括在先前图像1112中,并与当前块1010并置。例如,当与当前块1010并置的块1330的运动矢量mv_colC针对从另一先前图像1116检测的块1332被产生时,可使用以下等式来产生当前块1010的运动矢量候选mv_L0C:Referring to FIG. 13b , a motion vector candidate mv_LOC of a current block 1010 included in a current image 1110 may be determined using a motion vector mv_colC of a block 1330 included in a previous image 1112 and collocated with the current block 1010 . For example, when the motion vector mv_colC of the block 1330 collocated with the current block 1010 is generated for the block 1332 detected from another previous image 1116, the following equation may be used to generate the motion vector candidate mv_LOC of the current block 1010:
mv_L0C=(t6/t5)×mv_colC。mv_LOC=(t6/t5)×mv_colC.
以上参照图13a和图13b描述的运动矢量候选mv_L0B和mv_L1B可被包括在上述的当前块1010的运动矢量候选的上述C集中。也就是说,取代于运动矢量候选mv_L0A和mv_L1A,运动矢量候选mv_L0B和mv_L1B可被包括在C集中,或者运动矢量候选mv_L0B和mv_L1B可被附加地包括在C集中。The motion vector candidates mv_L0B and mv_L1B described above with reference to FIGS. 13a and 13b may be included in the above-mentioned C set of motion vector candidates of the current block 1010 described above. That is, motion vector candidates mv_LOB and mv_L1B may be included in C-set instead of motion vector candidates mv_LOA and mv_L1A, or motion vector candidates mv_LOB and mv_L1B may be additionally included in C-set.
返回参照图9,如果运动矢量确定器910基于先前编码块的运动矢量确定当前块的运动矢量,则编码器920对关于当前块的信息进行编码。Referring back to FIG. 9 , if the motion vector determiner 910 determines a motion vector of a current block based on a motion vector of a previously encoded block, the encoder 920 encodes information on the current block.
如果当前块的第一方向运动矢量和第二方向运动矢量被确定,则编码器920基于第一方向运动矢量和第二方向运动矢量来执行第一方向预测、第二方向预测和双向预测。随后,当前块可被最精确地预测的预测方向被确定。通过执行第一方向预测、第二方向预测和双向预测而获得的预测块可与当前块进行比较,可产生具有最小SAD的残差块的方向可被确定为预测方向。否则,可通过执行第一方向预测、第二方向预测和双向预测,对执行的结果进行编码并基于RD代价对编码的结果互相比较,来确定预测方向。If the first direction motion vector and the second direction motion vector of the current block are determined, the encoder 920 performs first direction prediction, second direction prediction and bidirectional prediction based on the first direction motion vector and the second direction motion vector. Then, a prediction direction in which the current block can be most accurately predicted is determined. A predicted block obtained by performing first-direction prediction, second-direction prediction, and bidirectional prediction may be compared with a current block, and a direction that may generate a residual block having the smallest SAD may be determined as a prediction direction. Otherwise, the prediction direction may be determined by performing first-direction prediction, second-direction prediction, and bidirectional prediction, encoding the performed results, and comparing the encoded results with each other based on the RD cost.
在预测方向被确定之后,关于预测方向的信息和关于像素值的信息被编码。关于预测方向的信息可被编码为序列参数、像条参数或块参数。预定二进制数可被分配给第一方向、第二方向和双向,与当前块被编码的预测方向相应的二进制数可被熵编码,随后熵编码的结果可被插入比特流。After the prediction direction is determined, information on the prediction direction and information on pixel values are encoded. Information about the prediction direction can be encoded as sequence parameters, slice parameters or block parameters. Predetermined bins may be allocated to the first direction, the second direction, and the bidirectional, bins corresponding to a prediction direction in which the current block is encoded may be entropy encoded, and then a result of the entropy encoding may be inserted into a bitstream.
与关于像素值的信息一样,关于残差块的信息(例如,直接预测模式)可被附加地编码。可通过从当前块减去通过按照确定的预测方向执行预测而产生的预测块来获得残差块,可通过对残差块执行变换来产生频域系数,随后,频域系数可被量化和熵编码。所述变换可以是DCT变换或KLT变换。Information on the residual block (eg, direct prediction mode) may be additionally encoded as information on pixel values. A residual block may be obtained by subtracting a prediction block generated by performing prediction in a determined prediction direction from a current block, frequency domain coefficients may be generated by performing transformation on the residual block, and then the frequency domain coefficients may be quantized and entropy coding. The transform may be a DCT transform or a KLT transform.
此外,与关于像素值的信息一样,仅根据现有技术的跳过模式以及指示预测块和当前块相同的标志信息可被编码。也就是说,由于通过按照确定的预测方向执行预测而获得的预测块被视为与当前块相同,因此可仅对跳过模式和标志信息进行编码。Also, as with information on pixel values, only a skip mode according to the related art and flag information indicating that a predicted block and a current block are identical may be encoded. That is, since a prediction block obtained by performing prediction in a determined prediction direction is considered to be the same as a current block, only skip mode and flag information may be encoded.
可基于先前编码块的参考索引来推断用于预测当前块的参考图像。如上参照图11b所述,可基于先前编码块的参考索引来确定当前块的参考索引和与当前块相应的参照图像。此外,与由运动矢量确定器910确定的运动矢量相应的参考图像可被确定为当前块的参考图像。例如,如以上参照图11a所述,如果运动矢量mv_L0A被确定为当前块的第一方向运动矢量,则根据运动矢量mv_L0A的先前图像1112可被自动确定为当前块的参考图像。A reference image for predicting a current block may be inferred based on a reference index of a previously coded block. As described above with reference to FIG. 11b , a reference index of a current block and a reference image corresponding to the current block may be determined based on reference indices of previously encoded blocks. Also, a reference image corresponding to the motion vector determined by the motion vector determiner 910 may be determined as a reference image of the current block. For example, as described above with reference to FIG. 11a, if the motion vector mv_LOA is determined as the first direction motion vector of the current block, the previous image 1112 according to the motion vector mv_LOA may be automatically determined as the reference image of the current block.
如果运动矢量确定器910如以上参照图12a、图12b、图13a和图13b所述在多个运动矢量候选中明确地确定第一方向运动矢量和第二方向运动矢量,则编码器920可对指示第一方向运动矢量和第二方向运动矢量中的至少一个的信息进行编码。If the motion vector determiner 910 explicitly determines the first direction motion vector and the second direction motion vector among multiple motion vector candidates as described above with reference to FIGS. 12a, 12b, 13a and 13b, the encoder 920 can Information indicating at least one of the motion vector in the first direction and the motion vector in the second direction is encoded.
如果预测方向被确定为第一方向,则指示所述多个运动矢量候选中的仅第一方向运动矢量的信息被编码。如果预测方向被确定为第二方向,则仅指示第二方向运动矢量的信息可被编码。然而,如果预测方向被确定为双向执行,则指示所述多个运动矢量候选中的第一方向运动矢量和第二方向运动矢量的信息可被编码。If the prediction direction is determined to be the first direction, information indicating only the first direction motion vector among the plurality of motion vector candidates is encoded. If the prediction direction is determined to be the second direction, only information indicating the second direction motion vector may be encoded. However, if the prediction direction is determined to be bidirectionally performed, information indicating a first-direction motion vector and a second-direction motion vector among the plurality of motion vector candidates may be encoded.
二进制数可被分别分配给包括在上述的C集中的所有运动矢量,分配给被确定为当前块的运动矢量的第一方向运动矢量和/或第二方向运动矢量的二进制数可被编码。然而,由于如上所述C集中的第一方向运动矢量之一被确定为当前块的第一方向运动矢量,因此分配给C集中的第一方向运动矢量的二进制数中的分配给当前块的第一方向运动矢量的二进制数可被编码为指示第一方向运动矢量的信息。同样,分配给C集中的第二方向运动矢量的二进制数中的分配给当前块的第二方向运动矢量的二进制数可被编码为指示第二方向运动矢量的信息。Binary numbers may be assigned to all motion vectors included in the above-mentioned set C, respectively, and binary numbers assigned to a first-direction motion vector and/or a second-direction motion vector determined to be a motion vector of a current block may be encoded. However, since one of the first directional motion vectors in the C set is determined as the first directional motion vector of the current block as described above, the first directional motion vector assigned to the current block among the binary numbers assigned to the first directional motion vectors in the C set A binary number of a motion vector in one direction may be encoded as information indicating a motion vector in a first direction. Also, the binary number assigned to the second-direction motion vector of the current block among the binary numbers assigned to the second-direction motion vector in the C set may be encoded as information indicating the second-direction motion vector.
图14是根据本发明的另一实施例的图像解码设备1400的框图。图像解码设备1400可被包括在图2的图像解码设备200或图5的图像解码设备500中,并可通过执行帧间预测来对当前块进行解码。FIG. 14 is a block diagram of an image decoding device 1400 according to another embodiment of the present invention. The image decoding apparatus 1400 may be included in the image decoding apparatus 200 of FIG. 2 or the image decoding apparatus 500 of FIG. 5 , and may decode a current block by performing inter prediction.
参照图14,图像解码设备1400包括解码器1410、运动矢量确定器1420和恢复单元1430.Referring to FIG. 14 , an image decoding device 1400 includes a decoder 1410, a motion vector determiner 1420, and a restoration unit 1430.
解码器1410接收包含关于当前块的数据的比特流,并对关于当前块被预测的预测方向的信息进行解码。图像解码设备1400基于在当前块被解码之前已被先前解码的至少一个块的运动矢量来确定当前块的运动矢量,并在用于恢复当前块的解码模式下基于确定的运动矢量来对当前块进行解码。因此,在当前块的运动矢量被确定之前对关于预测方向的信息进行解码。关于预测方向的信息可以是例如包括在比特流中的序列参数、像条参数或块参数。The decoder 1410 receives a bitstream including data on a current block, and decodes information on a prediction direction in which the current block is predicted. The image decoding apparatus 1400 determines a motion vector of a current block based on a motion vector of at least one block that has been previously decoded before the current block is decoded, and performs an operation on the current block based on the determined motion vector in a decoding mode for restoring the current block. to decode. Therefore, the information on the prediction direction is decoded before the motion vector of the current block is determined. The information on the prediction direction may be, for example, sequence parameters, slice parameters or block parameters included in the bitstream.
在基于先前编码/解码块的运动矢量确定当前块的运动矢量的编码/解码模式(例如,直接预测模式或跳过模式)下,仅基于按照特定方向执行的预测来对当前块进行编码/解码。然而,在根据本发明的实施例的编码/解码方向中,可基于按照第一方向、第二方向和双向执行预测的结果,在直接预测模式或跳过模式下对当前块进行编码/解码。为此,图9的图像编码设备900对关于预测方向的信息进行编码,将编码的结果插入比特流。解码器1410对通过使用图像编码设备900被插入比特流的关于预测方向的信息进行解码。In an encoding/decoding mode (for example, direct prediction mode or skip mode) in which a motion vector of a current block is determined based on a motion vector of a previously encoded/decoded block, the current block is encoded/decoded based only on prediction performed in a specific direction . However, in an encoding/decoding direction according to an embodiment of the present invention, a current block may be encoded/decoded in a direct prediction mode or a skip mode based on a result of performing prediction in a first direction, a second direction, and a bidirectional direction. For this, the image encoding apparatus 900 of FIG. 9 encodes information on a prediction direction, and inserts the encoded result into a bitstream. The decoder 1410 decodes information on a prediction direction inserted into a bitstream by using the image encoding device 900 .
解码器1410可对指示多个运动矢量候选中的当前块的运动矢量的信息以及关于预测方向的信息一起进行解码。如果如上所述基于在编码端和解码端之间共享的确定运动矢量的方法隐式地确定当前块的运动矢量,则根据共享的方法和指示当前块的运动矢量不需要被解码的信息确定当前块的一个运动矢量的总数。然而,当如上所述基于多个先前编码块的运动矢量产生多个运动矢量候选并且从所述多个运动矢量候选中确定当前块的运动矢量时,指示所述多个运动矢量候选中的当前块的运动矢量的信息可被解码。The decoder 1410 may decode information indicating a motion vector of a current block among a plurality of motion vector candidates together with information about a prediction direction. If the motion vector of the current block is implicitly determined based on the method of determining the motion vector shared between the encoding side and the decoding side as described above, the current block is determined based on the shared method and information indicating that the motion vector of the current block does not need to be decoded The total number of one motion vector for the block. However, when a plurality of motion vector candidates are generated based on motion vectors of a plurality of previously encoded blocks as described above and a motion vector of a current block is determined from the plurality of motion vector candidates, the current one of the plurality of motion vector candidates is indicated. The information of the motion vector of the block can be decoded.
此外,解码器1410对关于当前块的像素值的信息进行解码。在这种情况下,关于当前块的残差块的信息或指示当前块与预测块相同的标志信息被解码。解码器1410可通过对关于残差块的信息进行熵解码、反量化或逆变换来恢复残差块。Also, the decoder 1410 decodes information on pixel values of the current block. In this case, information about the residual block of the current block or flag information indicating that the current block is the same as the prediction block is decoded. The decoder 1410 may restore the residual block by performing entropy decoding, inverse quantization, or inverse transformation on information about the residual block.
运动矢量确定器1420基于通过使用解码器1410对关于预测方向的信息进行解码的结果来确定当前块的运动矢量,从而按照预定方向预测当前块。如果基于解码的结果确定按照第一方向执行预测,则第一方向运动矢量被确定为当前块的运动矢量。如果基于解码的结果确定按照第二方向执行预测,则第二方向运动矢量被确定为当前块的运动矢量。如果基于解码的结果确定双向执行预测,则第一方向运动矢量和第二方向运动矢量被确定为当前块的运动矢量。The motion vector determiner 1420 determines the motion vector of the current block based on the result of decoding the information on the prediction direction by using the decoder 1410, thereby predicting the current block in a predetermined direction. If it is determined to perform prediction in the first direction based on the result of the decoding, the first direction motion vector is determined as the motion vector of the current block. If it is determined to perform prediction in the second direction based on the result of the decoding, the second direction motion vector is determined as the motion vector of the current block. If it is determined that prediction is bidirectionally performed based on a result of the decoding, a first-direction motion vector and a second-direction motion vector are determined as motion vectors of the current block.
当将根据编码端和解码端之间共享的确定运动矢量的方法隐式地确定当前块的运动矢量时,根据共享的方法确定当前块的运动矢量。以上参照图11a和图11b描述了该方法。When the motion vector of the current block is to be implicitly determined according to the method of determining the motion vector shared between the encoding side and the decoding side, the motion vector of the current block is determined according to the shared method. This method is described above with reference to Figures 11a and 11b.
然而,当将从多个运动矢量候选中确定当前块的运动矢量时,基于指示所述多个运动矢量候选中的由解码器1410解码的当前块的运动矢量的信息来确定当前块的运动矢量。使用在当前块被解码之前已解码的至少一个块的运动矢量来产生所述多个运动矢量候选,并从所述多个运动矢量候选中确定当前块的运动矢量。However, when the motion vector of the current block is to be determined from a plurality of motion vector candidates, the motion vector of the current block is determined based on information indicating the motion vector of the current block decoded by the decoder 1410 among the plurality of motion vector candidates . The plurality of motion vector candidates is generated using a motion vector of at least one block that has been decoded before the current block is decoded, and the motion vector of the current block is determined from the plurality of motion vector candidates.
如果仅按照第一方向预测当前块,则基于使用解码器1410解码的指示第一方向运动矢量的信息,从所述多个运动矢量候选确定第一方向运动矢量。如果仅按照第二方向预测当前块,则基于使用解码器1410解码的指示第二方向运动矢量的信息,从所述多个运动矢量候选确定第二方向运动矢量。如果当前块被双向预测,则基于使用解码器1410解码的指示第一方向运动矢量的信息和指示第二方向运动矢量的信息,从而所述多个运动矢量候选确定第一方向运动矢量和第二方向运动矢量。If the current block is predicted only in the first direction, the first direction motion vector is determined from the plurality of motion vector candidates based on the information indicating the first direction motion vector decoded using the decoder 1410 . If the current block is predicted only in the second direction, the second direction motion vector is determined from the plurality of motion vector candidates based on the information indicating the second direction motion vector decoded using the decoder 1410 . If the current block is bidirectionally predicted, based on information indicating a motion vector in the first direction and information indicating a motion vector in the second direction decoded using the decoder 1410, the plurality of motion vector candidates determine a motion vector in the first direction and a motion vector in the second direction. Direction motion vector.
恢复单元1430基于使用解码器1410解码的关于像素值的信息以及使用运动矢量确定器1420确定的当前块的运动矢量来恢复当前块。The restoration unit 1430 restores the current block based on the information on the pixel value decoded using the decoder 1410 and the motion vector of the current block determined using the motion vector determiner 1420 .
通过根据使用运动矢量确定器1420确定的运动矢量按照第一方向、第二方向或双向预测当前块来产生预测块。如果通过使用解码器1410对关于像素值的信息进行解码来恢复残差块,则恢复的残差块与预测块组合以恢复当前块。如果解码器1410对指示预测块与当前块相同的标志信息进行解码,则预测块可被直接用作恢复的当前块。A prediction block is generated by predicting a current block in a first direction, a second direction, or bidirectionally according to a motion vector determined using the motion vector determiner 1420 . If a residual block is restored by decoding information on pixel values using the decoder 1410, the restored residual block is combined with a prediction block to restore a current block. If the decoder 1410 decodes the flag information indicating that the predicted block is the same as the current block, the predicted block may be directly used as the restored current block.
可基于先前解码块的参考索引来参考用于预测当前块的参考图像。如上参照图11b所述,可基于先前解码块的参考索引来确定当前块的参考索引和与当前块相应的参考图像。此外,与通过运动矢量确定器1420确定的运动矢量相应的参考图像可被确定为当前块的参考图像。例如,如以上参考图11a所述,如果运动矢量mv_L0A被确定为当前块的第一方向运动矢量,则根据运动矢量mv_L0A的先前图像1112可被自动确定为当前块的参考图像。A reference image for predicting a current block may be referenced based on a reference index of a previously decoded block. As described above with reference to FIG. 11b , a reference index of a current block and a reference image corresponding to the current block may be determined based on reference indices of previously decoded blocks. Also, a reference image corresponding to the motion vector determined by the motion vector determiner 1420 may be determined as a reference image of the current block. For example, as described above with reference to FIG. 11a, if the motion vector mv_LOA is determined as the first direction motion vector of the current block, the previous image 1112 according to the motion vector mv_LOA may be automatically determined as the reference image of the current block.
图15是示出根据本发明的实施例的图像编码方法的流程图。FIG. 15 is a flowchart illustrating an image encoding method according to an embodiment of the present invention.
参照图15,在操作1510,图像编码设备确定当前块的运动矢量。例如,在操作1510,包括在当前画面的被双向预测的当前块的第一方向运动矢量和第二方向运动矢量被确定。如以上参照图11a和图11b所述,可根据在编码端和解码端之间共享的确定运动矢量的方法来隐式地确定当前块的运动矢量。另外,如以上参照图12a、图12b、图13a和图13b所述,产生多个运动矢量候选,并可从所述多个运动矢量候选中确定第一方向运动矢量和第二方向运动矢量。Referring to FIG. 15 , in operation 1510, the image encoding apparatus determines a motion vector of a current block. For example, in operation 1510, a first direction motion vector and a second direction motion vector of a bidirectionally predicted current block included in a current picture are determined. As described above with reference to FIGS. 11 a and 11 b , a motion vector of a current block may be implicitly determined according to a method of determining a motion vector shared between an encoding end and a decoding end. In addition, as described above with reference to FIGS. 12a, 12b, 13a, and 13b, a plurality of motion vector candidates are generated, and the first direction motion vector and the second direction motion vector may be determined from the plurality of motion vector candidates.
在操作1520,图像编码设备从第一方向预测、第二方向预测和双向预测中确定预测方法以对当前块进行编码。从使用第一方向运动矢量的第一方向预测、使用第二方向运动矢量的第二方向预测以及使用第一方向运动矢量和第二方向运动矢量两者的双向预测来确定预测方法以对当前块进行编码。In operation 1520, the image encoding apparatus determines a prediction method from among the first direction prediction, the second direction prediction, and the bidirectional prediction to encode the current block. The prediction method is determined from the first direction prediction using the first direction motion vector, the second direction prediction using the second direction motion vector, and the bidirectional prediction using both the first direction motion vector and the second direction motion vector to predict the current block to encode.
第一方向预测、第二方向预测和双向预测中更精确地预测当前块的预测方法可被用于对当前块进行编码。如上所述,获得预测块和当前块之间的最小SAD的预测方法可被用于对当前块进行编码。A prediction method that more accurately predicts a current block among first-direction prediction, second-direction prediction, and bidirectional prediction may be used to encode the current block. As described above, a prediction method that obtains the minimum SAD between a prediction block and a current block may be used to encode the current block.
在操作1530,图像编码设备对关于在操作1520确定的预测方法中使用的预测方向的信息进行编码。二进制数可被分别分配给第一方向、第二方向和双向,分配给用于对当前块进行编码的预测方向的二进制数可被编码。可根据预定熵编码方法对编码的二进制数进行熵编码。关于预测方向的信息可被编码为序列参数、像条参数或块参数。In operation 1530, the image encoding apparatus encodes information about a prediction direction used in the prediction method determined in operation 1520. Bins may be assigned to the first direction, the second direction, and bidirectional, respectively, and bins assigned to a prediction direction for encoding a current block may be encoded. The encoded binary numbers may be entropy encoded according to a predetermined entropy encoding method. Information about the prediction direction can be encoded as sequence parameters, slice parameters or block parameters.
还对关于当前块的像素值的信息进行编码。在这种情况下,可对关于通过从当前块减去预测块而获得的残差块的残差值的信息进行编码。残差块可被变换、量化和熵编码。此外,如上所述,可仅对指示预测块与当前块相同的标志信息进行编码。Information about the pixel values of the current block is also encoded. In this case, information on a residual value of a residual block obtained by subtracting a prediction block from a current block may be encoded. The residual block can be transformed, quantized and entropy coded. Also, as described above, only flag information indicating that the predicted block is the same as the current block may be encoded.
还可对定义多个运动矢量候选中用于对当前块进行编码的运动矢量的信息进行编码。如果基于在当前块被编码之前编码的至少一个块的运动矢量来产生所述多个运动矢量候选,并且所述多个运动矢量候选之一被选择并被用作当前块的运动矢量,则指示选择的运动矢量的信息可被编码。如果在操作1520第一方向预测被确定为预测方法,则可仅对关于第一方向运动矢量的信息进行编码。如果在操作1520第二方向预测被确定为预测方法,则可仅对关于第二方向运动矢量的信息进行编码。如果在操作1520双向预测被确定为预测方法,则仅对关于第一方向运动矢量和第二方向运动矢量两者的信息进行编码。Information defining a motion vector among a plurality of motion vector candidates for encoding the current block may also be encoded. If the plurality of motion vector candidates are generated based on the motion vector of at least one block encoded before the current block is encoded, and one of the plurality of motion vector candidates is selected and used as the motion vector of the current block, indicating Information of the selected motion vector may be encoded. If the first direction prediction is determined as the prediction method in operation 1520, only information about the first direction motion vector may be encoded. If the second direction prediction is determined as the prediction method in operation 1520, only information about the second direction motion vector may be encoded. If bidirectional prediction is determined as a prediction method in operation 1520, only information on both the first-direction motion vector and the second-direction motion vector is encoded.
图16是示出根据本发明的实施例的图像解码方法的流程图。FIG. 16 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.
参照图16,在操作1610,图像解码设备对关于第一方向、第二方向和双向中将被用于对当前块进行解码的预测方向的信息进行解码。在这种情况下,可对包括在比特流中的关于预测方向的信息进行解码。可对分别分配给第一方向、第二方向和双向的二进制数中分配给预测方向的二进制数进行解码。包括在比特流中的关于预测方向的信息可被解码为序列参数、像条参数或块参数。Referring to FIG. 16 , in operation 1610, the image decoding apparatus decodes information about a prediction direction to be used to decode a current block among a first direction, a second direction, and a bidirectional direction. In this case, information on the prediction direction included in the bitstream may be decoded. The binary number assigned to the prediction direction among the binary numbers respectively assigned to the first direction, the second direction, and the bidirectional direction may be decoded. The information on the prediction direction included in the bitstream can be decoded as sequence parameters, slice parameters or block parameters.
在操作1610,图像解码设备还对关于当前块的像素值的信息进行编码。可对关于当前块的残差块的残差值的信息进行编码。可对关于残差块的信息进行熵解码、反量化和逆变换以恢复残差块。此外,可对指示当前块与预测块相同的信息进行解码。In operation 1610, the image decoding apparatus also encodes information on pixel values of the current block. Information about a residual value of a residual block of a current block may be encoded. Information on the residual block may be entropy decoded, dequantized, and inversely transformed to restore the residual block. Also, information indicating that the current block is the same as the predicted block may be decoded.
当如上所述从多个运动矢量候选中确定当前块的运动矢量时,可对定义所述多个运动矢量候选中的将被用于对当前块进行解码的运动矢量的信息进行解码。如果对关于预测方向的信息进行解码的结果显示预测方向是第一方向,则可对指示所述多个运动矢量候选中的当前块的第一方向运动矢量的信息进行解码。如果对关于预测方向的信息进行解码的结果显示预测方向是第二方向,则可对指示所述多个运动矢量候选中的当前块的第二方向运动矢量的信息进行解码。如果对关于预测方向的信息进行解码的结果显示预测方向是双向,则可对指示所述多个运动矢量候选中的第一方向运动矢量的信息和指示所述多个运动矢量候选中的第二方向运动矢量的信息进行解码。When the motion vector of the current block is determined from a plurality of motion vector candidates as described above, information defining a motion vector to be used for decoding the current block among the plurality of motion vector candidates may be decoded. If a result of decoding the information on the prediction direction shows that the prediction direction is the first direction, the information indicating the first direction motion vector of the current block among the plurality of motion vector candidates may be decoded. If a result of decoding the information on the prediction direction shows that the prediction direction is the second direction, the information indicating the second direction motion vector of the current block among the plurality of motion vector candidates may be decoded. If the result of decoding the information on the prediction direction shows that the prediction direction is bidirectional, the information indicating the motion vector in the first direction among the plurality of motion vector candidates and the information indicating the motion vector in the second direction among the plurality of motion vector candidates may be compared. The information of the directional motion vector is decoded.
在操作1620,图像解码设备基于在操作1610解码的关于预测方向的信息来确定当前块将被预测的预测方向。基于与预测方向相应的二进制数来确定当前块将被预测的预测方向,其中,预测方向的信息在操作1610被解码。如果当前块将被预测的预测方向被确定,则用于按照确定的预测方向预测当前块的至少一个运动矢量被确定。In operation 1620, the image decoding apparatus determines a prediction direction in which a current block is to be predicted based on the information on the prediction direction decoded in operation 1610. A prediction direction in which a current block is to be predicted is determined based on a binary number corresponding to a prediction direction, information of which is decoded in operation 1610 . If a prediction direction in which the current block is to be predicted is determined, at least one motion vector for predicting the current block in the determined prediction direction is determined.
如上所述,可根据在编码端和解码端之间共享的确定运动矢量的方法来隐式地确定当前块的运动矢量。如果从多个运动矢量候选中显式地选择当前块的运动矢量,则基于在当前块被解码之前解码的至少一个块运动矢量来产生所述多个运动矢量候选,并从所述多个运动矢量候选中确定当前块的运动矢量。可基于在操作1610解码的指示所述多个运动矢量候选中的当前块的运动矢量的信息,确定当前块的运动矢量。可基于在操作1610解码的信息来确定第一方向运动矢量和第二方向运动矢量中的至少一个。As described above, the motion vector of the current block may be implicitly determined according to the method of determining the motion vector shared between the encoding end and the decoding end. If the motion vector of the current block is explicitly selected from a plurality of motion vector candidates, the plurality of motion vector candidates are generated based on at least one block motion vector decoded before the current block is decoded, and the motion vector is selected from the plurality of motion vector candidates. The motion vector of the current block is determined from the vector candidates. The motion vector of the current block may be determined based on the information indicative of the motion vector of the current block among the plurality of motion vector candidates decoded in operation 1610 . At least one of the first direction motion vector and the second direction motion vector may be determined based on the information decoded in operation 1610 .
在操作1630,图像解码设备恢复当前块。基于在操作1620确定的当前块的运动矢量来确定当前块的预测块,基于预测块恢复当前块。In operation 1630, the image decoding apparatus restores a current block. A prediction block of the current block is determined based on the motion vector of the current block determined in operation 1620, and the current block is restored based on the prediction block.
可通过在操作1620确定的基于第一方向运动矢量和/或第二方向运动矢量来执行第一方向预测、第二方向预测和双向预测之一,产生当前块的预测块。A prediction block of the current block may be generated by performing one of first direction prediction, second direction prediction, and bidirectional prediction based on the first direction motion vector and/or the second direction motion vector determined in operation 1620 .
如果在操作1610残差块被恢复,则预测块与恢复的残差块组合以恢复当前块。如果指示预测块与当前块相同的信息被解码,则预测块被用作当前块。If the residual block is restored in operation 1610, the prediction block is combined with the restored residual block to restore the current block. If information indicating that the predicted block is the same as the current block is decoded, the predicted block is used as the current block.
虽然参照本发明的示例性实施例和附图具体显示和描述了本发明,但本领域的普通技术人员将理解,在不脱离本发明的原理和精神的情况下可对这些示例性实施例进行改变,本发明的范围在权利要求及其等同物中被限定。此外,根据本发明的实施例的系统可被实现为计算机可读记录介质中的计算机可读代码。Although the present invention has been specifically shown and described with reference to the exemplary embodiments of the invention and the accompanying drawings, those skilled in the art will understand that the exemplary embodiments can be modified without departing from the principle and spirit of the present invention. Instead, the scope of the invention is defined in the claims and their equivalents. Also, a system according to an embodiment of the present invention can be realized as computer readable codes in a computer readable recording medium.
例如,根据本发明的示例性实施例的图像编码设备、图像解码设备、运动矢量编码设备、运动矢量解码设备可包括与在图1、图2、图4、图5、图9和图14中示出的设备的各单元连接的总线以及与总线连接的至少一个处理器。所述设备中的每一个还可包括存储器,存储器与总线连接以存储命令、接收的消息或产生的消息,并与用于执行上述操作的所述至少一个处理器连接。For example, an image encoding device, an image decoding device, a motion vector encoding device, and a motion vector decoding device according to exemplary embodiments of the present invention may be included in the same as those shown in FIGS. 1, 2, 4, 5, 9, and 14. Shown is a bus to which units of the device are connected and at least one processor connected to the bus. Each of the devices may further include a memory connected to the bus to store commands, received messages or generated messages, and connected to the at least one processor for performing the above operations.
计算机可读记录介质可以是任何能够存储由计算机系统读取的数据的记录设备,例如,只读存储器(ROM)、随机存取存储器(RAM)、紧凑盘(CD)-ROM、磁带、软盘、光数据存储装置等。计算机可读记录介质可被分布在通过网络内联的计算机系统中,本发明可被存储和实现为分布式系统中的计算机可读代码。The computer-readable recording medium may be any recording device capable of storing data read by a computer system, for example, read-only memory (ROM), random-access memory (RAM), compact disk (CD)-ROM, magnetic tape, floppy disk, Optical data storage devices, etc. The computer-readable recording medium can be distributed in computer systems inline through a network, and the present invention can be stored and implemented as computer-readable codes in the distributed system.
Claims (1)
Applications Claiming Priority (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US29614110P | 2010-01-19 | 2010-01-19 | |
US61/296,141 | 2010-01-19 | ||
KR10-2011-0005377 | 2011-01-19 | ||
CN201180014824.9A CN102835111B (en) | 2010-01-19 | 2011-01-19 | The motion vector of previous block is used as the motion vector of current block, image to be carried out to the method and apparatus of coding/decoding |
KR1020110005377A KR101607308B1 (en) | 2010-01-19 | 2011-01-19 | Method and apparatus for encoding/decoding image by using motion vector of previous block as motion vector of current block |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201180014824.9A Division CN102835111B (en) | 2010-01-19 | 2011-01-19 | The motion vector of previous block is used as the motion vector of current block, image to be carried out to the method and apparatus of coding/decoding |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105025300A true CN105025300A (en) | 2015-11-04 |
CN105025300B CN105025300B (en) | 2018-05-04 |
Family
ID=48667759
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510446031.4A Active CN105025300B (en) | 2010-01-19 | 2011-01-19 | The method and apparatus encoded/decoded to image |
CN201510445868.7A Active CN105025299B (en) | 2010-01-19 | 2011-01-19 | The method and apparatus that image is encoded/decoded |
CN201510446035.2A Active CN105025301B (en) | 2010-01-19 | 2011-01-19 | Image decoding apparatus |
Family Applications After (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510445868.7A Active CN105025299B (en) | 2010-01-19 | 2011-01-19 | The method and apparatus that image is encoded/decoded |
CN201510446035.2A Active CN105025301B (en) | 2010-01-19 | 2011-01-19 | Image decoding apparatus |
Country Status (4)
Country | Link |
---|---|
JP (1) | JP2013517733A (en) |
CN (3) | CN105025300B (en) |
MY (2) | MY197143A (en) |
PH (1) | PH12012501455A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA3153608A1 (en) * | 2017-07-06 | 2019-01-10 | Samsung Electronics Co., Ltd. | Image encoding method and apparatus, and image decoding method and apparatus |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1336080A (en) * | 1999-10-29 | 2002-02-13 | 皇家菲利浦电子有限公司 | Video encoding-method |
US20040001546A1 (en) * | 2002-06-03 | 2004-01-01 | Alexandros Tourapis | Spatiotemporal prediction for bidirectionally predictive (B) pictures and motion vector prediction for multi-picture reference motion compensation |
EP1406450A1 (en) * | 2002-03-04 | 2004-04-07 | Matsushita Electric Industrial Co., Ltd. | Moving picture coding method and moving picture decoding method |
EP1513349A2 (en) * | 2003-09-07 | 2005-03-09 | Microsoft Corporation | Bitstream-controlled post-processing video filtering |
KR20060053517A (en) * | 2004-11-17 | 2006-05-22 | 삼성전자주식회사 | Deinterlacing method and apparatus using field variable division method |
CN1993995A (en) * | 2004-08-03 | 2007-07-04 | 学校法人大洋学园 | Method, medium, and apparatus predicting direct mode motion of a multi-angle moving picture |
CN100581259C (en) * | 2002-01-09 | 2010-01-13 | 松下电器产业株式会社 | Motion vector coding method and motion vector coding device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8064520B2 (en) * | 2003-09-07 | 2011-11-22 | Microsoft Corporation | Advanced bi-directional predictive coding of interlaced video |
KR101330630B1 (en) * | 2006-03-13 | 2013-11-22 | 삼성전자주식회사 | Method and apparatus for encoding moving picture, method and apparatus for decoding moving picture, applying adaptively an optimal prediction mode |
KR101505195B1 (en) * | 2008-02-20 | 2015-03-24 | 삼성전자주식회사 | Method for direct mode encoding and decoding |
KR101517768B1 (en) * | 2008-07-02 | 2015-05-06 | 삼성전자주식회사 | Method and apparatus for encoding video and method and apparatus for decoding video |
-
2011
- 2011-01-19 MY MYPI2019001262A patent/MY197143A/en unknown
- 2011-01-19 PH PH1/2012/501455A patent/PH12012501455A1/en unknown
- 2011-01-19 CN CN201510446031.4A patent/CN105025300B/en active Active
- 2011-01-19 CN CN201510445868.7A patent/CN105025299B/en active Active
- 2011-01-19 CN CN201510446035.2A patent/CN105025301B/en active Active
- 2011-01-19 JP JP2012549942A patent/JP2013517733A/en active Pending
- 2011-01-19 MY MYPI2012003278A patent/MY184904A/en unknown
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1336080A (en) * | 1999-10-29 | 2002-02-13 | 皇家菲利浦电子有限公司 | Video encoding-method |
CN100581259C (en) * | 2002-01-09 | 2010-01-13 | 松下电器产业株式会社 | Motion vector coding method and motion vector coding device |
EP1406450A1 (en) * | 2002-03-04 | 2004-04-07 | Matsushita Electric Industrial Co., Ltd. | Moving picture coding method and moving picture decoding method |
US20040001546A1 (en) * | 2002-06-03 | 2004-01-01 | Alexandros Tourapis | Spatiotemporal prediction for bidirectionally predictive (B) pictures and motion vector prediction for multi-picture reference motion compensation |
EP1513349A2 (en) * | 2003-09-07 | 2005-03-09 | Microsoft Corporation | Bitstream-controlled post-processing video filtering |
CN1993995A (en) * | 2004-08-03 | 2007-07-04 | 学校法人大洋学园 | Method, medium, and apparatus predicting direct mode motion of a multi-angle moving picture |
KR20060053517A (en) * | 2004-11-17 | 2006-05-22 | 삼성전자주식회사 | Deinterlacing method and apparatus using field variable division method |
Also Published As
Publication number | Publication date |
---|---|
CN105025301B (en) | 2019-08-23 |
CN105025299B (en) | 2019-04-16 |
MY197143A (en) | 2023-05-26 |
CN105025300B (en) | 2018-05-04 |
JP2013517733A (en) | 2013-05-16 |
CN105025299A (en) | 2015-11-04 |
MY184904A (en) | 2021-04-30 |
PH12012501455A1 (en) | 2017-01-27 |
CN105025301A (en) | 2015-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102835111B (en) | The motion vector of previous block is used as the motion vector of current block, image to be carried out to the method and apparatus of coding/decoding | |
CN104469362B (en) | For the method that motion vector is decoded | |
CN103260031B (en) | Method and apparatus for encoding/decoding to motion vector | |
CN104754355B (en) | A kind of image decoding apparatus | |
KR102027474B1 (en) | Method and apparatus for encoding/decoding image by using motion vector of previous block as motion vector of current block | |
CN102598670A (en) | Method and apparatus for encoding/decoding image with reference to a plurality of frames | |
CN105025300B (en) | The method and apparatus encoded/decoded to image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |