CN108696750A - A kind of decision method and device of prediction mode - Google Patents
A kind of decision method and device of prediction mode Download PDFInfo
- Publication number
- CN108696750A CN108696750A CN201710218729.XA CN201710218729A CN108696750A CN 108696750 A CN108696750 A CN 108696750A CN 201710218729 A CN201710218729 A CN 201710218729A CN 108696750 A CN108696750 A CN 108696750A
- Authority
- CN
- China
- Prior art keywords
- prediction mode
- value
- mode
- cost value
- intra
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/107—Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/184—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/189—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
- H04N19/19—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding using optimisation based on Lagrange multipliers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/567—Motion estimation based on rate distortion criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明公开了一种预测模式的判决方法,包括:获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;根据所属条带的类型和所述代价值,对预测模式进行判决。本发明还同时公开了一种预测模式的判决装置。
The invention discloses a method for judging a prediction mode, which includes: obtaining a prediction image in each prediction mode, obtaining the number of estimated coding bits in each prediction mode; The difference statistical operation is performed on the pixel values in the image, and the result of the difference statistical operation is determined as the distortion value in each prediction mode; according to the preset quantization parameter value, the distortion value in each prediction mode and the prediction Estimate the number of coding bits, and calculate the cost value in each prediction mode; judge the prediction mode according to the type of the slice to which it belongs and the cost value. The invention also discloses a judgment device of the prediction mode at the same time.
Description
技术领域technical field
本发明涉及视频通信领域,尤其涉及一种预测模式的判决方法及装置。The present invention relates to the field of video communication, in particular to a method and device for judging a prediction mode.
背景技术Background technique
帧内预测模式和帧间预测模式是视频压缩中两种重要的预测模式,以H.265/HEVC标准为例,针对连续动态图像的视频编码,可将各帧分成I帧、P帧和B帧三种类型。对于I帧而言,每个编码单元的预测模式均为帧内预测模式;但对P帧和B帧而言,每个编码单元的预测模式可能为帧内预测模式,也可能为帧间预测模式,因此需要通过率失真优化进行判决。Intra-frame prediction mode and inter-frame prediction mode are two important prediction modes in video compression. Taking the H.265/HEVC standard as an example, for video coding of continuous dynamic images, each frame can be divided into I frame, P frame and B frame. There are three types of frames. For an I frame, the prediction mode of each coding unit is an intra prediction mode; but for a P frame and a B frame, the prediction mode of each coding unit may be an intra prediction mode or an inter prediction mode mode, so a decision needs to be made through rate-distortion optimization.
对于高清视频而言,为了提升帧间编码性能,会采用运动估计和运动矢量预测两种方式获取帧间预测像素值。而现有技术中,首先需要计算原始图像与帧内预测图像残差值、原始图像与运动估计预测图像残差值、以及原始图像与运动矢量预测图像残差值;然后对这三组残差数据进行变换、量化、反量化和反变换操作,获得三组重构图像;接着计算重构图像与原始图像失真值,并估计编码预测信息和残差的比特数,最终用率失真的法则判决出当前编码单元的预测模式。然而,该方法随着运动矢量候选数目的增加,对残差数据进行变换、量化、反量化和反变换操作,以及对残差信息的预估编码比特数进行估计,使编码器的硬件资源开销很大。For high-definition video, in order to improve the performance of inter-frame coding, motion estimation and motion vector prediction are used to obtain inter-frame predicted pixel values. In the prior art, it is first necessary to calculate the residual value of the original image and the intra-frame predicted image, the residual value of the original image and the motion estimation predicted image, and the residual value of the original image and the motion vector predicted image; The data is transformed, quantized, dequantized, and inversely transformed to obtain three sets of reconstructed images; then the distortion value of the reconstructed image and the original image is calculated, and the number of bits of the encoded prediction information and residual is estimated, and finally judged by the law of rate distortion Get the prediction mode of the current coding unit. However, as the number of motion vector candidates increases, this method performs transformation, quantization, inverse quantization and inverse transformation operations on the residual data, and estimates the number of predicted coding bits of the residual information, which makes the hardware resource overhead of the encoder very big.
发明内容Contents of the invention
为解决现有技术存在的问题,本发明实施例期望提供一种预测模式的判决方法及装置,用于对编码单元的预测模式进行判决,能够节省编码器的硬件资源开销。In order to solve the problems existing in the prior art, the embodiments of the present invention expect to provide a prediction mode judgment method and device for judging the prediction mode of the coding unit, which can save the hardware resource overhead of the encoder.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:
本发明实施例提供了预测模式的判决方法,所述方法包括:An embodiment of the present invention provides a method for judging a prediction mode, and the method includes:
获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;Obtain the predicted image in each prediction mode, and obtain the estimated number of coding bits in each prediction mode;
对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;performing a difference statistical operation on the pixel values in the predicted image in each prediction mode and the pixel values in the original image, and determining the result of the difference statistical operation as the distortion value in each prediction mode;
根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;Calculate the cost value in each prediction mode according to the preset quantization parameter value, the distortion value in each prediction mode and the estimated number of coding bits;
根据所属条带的类型和所述代价值,对预测模式进行判决。The prediction mode is determined according to the type of the slice to which it belongs and the cost value.
上述方案中,所述获取各个预测模式下的预估编码比特数包括:In the above solution, the acquisition of the number of estimated coding bits in each prediction mode includes:
获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。Obtain the estimated number of coding bits in the intra prediction mode; based on the preset motion vector difference method in the motion estimation mode, estimate and obtain the estimated coding bit number in the motion estimation mode; obtain the motion vector prediction mode as a preset value The estimated number of encoded bits for .
上述方案中,所述对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值包括:In the above solution, the difference statistical operation is performed on the pixel values in the predicted image and the pixel values in the original image in each prediction mode, and the result of the difference statistical operation is determined as the Distortion values include:
统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;Calculate the sum of the squares of the difference between the pixel value in the predicted image and the pixel value in the original image in each prediction mode;
将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。Determining the sum of squared differences in each prediction mode as the distortion value in each prediction mode.
上述方案中,所述根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值包括:In the above solution, the calculation of the cost value in each prediction mode according to the preset quantization parameter value, the distortion value in each prediction mode and the estimated number of coding bits includes:
根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;Determine the Lagrangian coefficient of the quantization parameter value according to the preset quantization parameter value;
将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。Multiply the number of estimated coding bits in each prediction mode by the Lagrangian coefficient, and add the result of the multiplication to the distortion value in each prediction mode to obtain the down the cost value.
上述方案中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述根据所属条带的类型和所述代价值,对预测模式进行判决包括:In the above solution, the type of the slice includes I slice, P slice and B slice; the inter prediction mode includes motion estimation mode and motion vector prediction mode; , making a decision on the prediction mode includes:
若所属条带的类型为I条带,将预测模式判决为帧内预测模式;If the type of the slice to which it belongs is an I slice, determine the prediction mode as an intra prediction mode;
若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;若是,则将预测模式判决为帧内预测模式;若否,则将预测模式判决为帧间预测模式。If the type of the slice to which it belongs is a P slice or a B slice, determine whether the cost value in the intra prediction mode is smaller than the cost value in the motion estimation mode and whether it is smaller than the cost value in the motion vector prediction mode; if so, predict The mode is determined to be an intra-frame prediction mode; if not, the prediction mode is determined to be an inter-frame prediction mode.
本发明实施例还提供了预测模式的判决装置,所述装置包括:获取模块、失真值计算模块、代价值计算模块和判决模块;其中,The embodiment of the present invention also provides a prediction mode judgment device, which includes: an acquisition module, a distortion value calculation module, a cost value calculation module and a judgment module; wherein,
所述获取模块,用于获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;The obtaining module is used to obtain the predicted image in each prediction mode, and obtain the estimated number of coding bits in each prediction mode;
所述失真值计算模块,用于对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;The distortion value calculation module is used to perform a difference statistical operation on the pixel value in the predicted image and the pixel value in the original image in each prediction mode, and determine the result of the difference statistical operation as the value of each prediction Distortion value in mode;
所述代价值计算模块,用于根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;The cost value calculation module is used to calculate the cost value in each prediction mode according to the preset quantization parameter value, the distortion value in each prediction mode and the estimated number of coding bits;
所述判决模块,用于根据所属条带的类型和所述代价值,对预测模式进行判决。The judging module is configured to judge the prediction mode according to the slice type and the cost value.
上述方案中,所述获取模块,具体用于获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。In the above solution, the acquisition module is specifically used to obtain the estimated number of coding bits in the intra prediction mode; based on the preset motion vector difference method in the motion estimation mode, estimate and obtain the estimated coding bits in the motion estimation mode Number; get the estimated coding bit number as the preset value in the motion vector prediction mode.
上述方案中,所述失真值计算模块包括:统计单元和第一确定单元;其中,In the above solution, the distortion value calculation module includes: a statistical unit and a first determination unit; wherein,
所述统计单元,用于统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;The statistical unit is used to count the sum of squares of the difference between the pixel value in the predicted image and the pixel value in the original image in each prediction mode;
所述第一确定单元,用于将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。The first determining unit is configured to determine the sum of squared differences in each prediction mode as the distortion value in each prediction mode.
上述方案中,所述代价值计算模块包括:第二确定单元和获取单元;其中,In the above solution, the cost value calculation module includes: a second determination unit and an acquisition unit; wherein,
所述第二确定单元,用于根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;The second determination unit is configured to determine the Lagrangian coefficient of the quantization parameter value according to the preset quantization parameter value;
所述获取单元,用于将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。The acquisition unit is configured to multiply the estimated number of coding bits in each prediction mode by the Lagrangian coefficient, and add the result of the multiplication to the distortion value in each prediction mode, A cost value in each prediction mode is obtained.
上述方案中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述判决模块包括:第一判决单元和第二判决单元;其中,In the above solution, the types of the slices include I slices, P slices and B slices; the inter prediction mode includes motion estimation and motion vector prediction; the decision module includes: a first decision unit and a second decision unit. Judgment unit; where,
所述第一判决单元,用于若所属条带的类型为I条带,将预测模式判决为帧内预测模式;The first decision unit is configured to determine the prediction mode as an intra prediction mode if the type of the slice to which it belongs is an I slice;
所述第二判决单元,用于若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;当帧内预测模式下的代价值小于运动估计方式下的代价值、并且小于运动矢量预测方式下的代价值时,则将预测模式判决为帧内预测模式;当帧内预测模式下的代价值大于等于运动估计方式下的代价值、或者大于等于运动矢量预测方式下的代价值,则将预测模式判决为帧间预测模式。The second judgment unit is configured to judge whether the cost value in the intra prediction mode is smaller than the cost value in the motion estimation mode and whether it is smaller than the cost value in the motion vector prediction mode if the type of the slice to which it belongs is a P slice or a B slice. cost value; when the cost value in the intra prediction mode is less than the cost value in the motion estimation mode and less than the cost value in the motion vector prediction mode, the prediction mode is determined as the intra prediction mode; when the intra prediction mode If the cost value under is greater than or equal to the cost value in the motion estimation mode, or greater than or equal to the cost value in the motion vector prediction mode, then the prediction mode is determined to be the inter-frame prediction mode.
本发明实施例提供的预测模式的判决方法及装置,用于对编码单元的预测模式进行判决;首先,获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;然后,对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,计算所述每一预测模式下的失真值;接着,根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;最后,根据所属条带的类型和所述代价值,对预测模式进行判决。The prediction mode judgment method and device provided by the embodiments of the present invention are used to judge the prediction mode of the coding unit; firstly, obtain the predicted image in each prediction mode, and obtain the estimated number of coding bits in each prediction mode; then, Perform a difference statistical operation on the pixel values in the predicted image in each prediction mode and the pixel values in the original image to calculate the distortion value in each prediction mode; then, according to the preset quantization parameter value, each The distortion value in the prediction mode and the estimated number of coding bits are used to calculate the cost value in each prediction mode; finally, the prediction mode is judged according to the type of the slice to which it belongs and the cost value.
可见,本发明实施例当计算编码单元在各个预测模式下的失真值时,不需要在残差图像的基础上来重构图像,以获得真实的失真值;而只需要获取预测图像,并对该编码单元在原始图像中的像素值和在预测图像中的像素值进行差值统计运算,以获得预测的失真值。由于在残差图像的基础上需要增加变换、量化、反量化和反变换操作,并且需要估计残差的比特数,而变换、量化、反量化和反变换的操作以及残差比特数的估计会大大增加编码器的硬件资源开销;因此,本发明实施例通过减少上述步骤,能够在保证编码质量的前提下,大大节省编码器的硬件资源开销,并且降低编码器硬件设计的复杂度。It can be seen that in the embodiment of the present invention, when calculating the distortion value of the coding unit in each prediction mode, it is not necessary to reconstruct the image on the basis of the residual image to obtain the real distortion value; instead, it is only necessary to obtain the predicted image and calculate the A difference statistical operation is performed on the pixel value of the coding unit in the original image and the pixel value in the predicted image to obtain a predicted distortion value. Since it is necessary to add transformation, quantization, inverse quantization, and inverse transformation operations on the basis of the residual image, and it is necessary to estimate the number of residual bits, the operations of transformation, quantization, inverse quantization, and inverse transformation and the estimation of the number of residual bits will be The hardware resource overhead of the encoder is greatly increased; therefore, the embodiment of the present invention can greatly save the hardware resource overhead of the encoder and reduce the complexity of the encoder hardware design under the premise of ensuring the encoding quality by reducing the above steps.
附图说明Description of drawings
图1为本发明预测模式的判决方法实施例一的实现流程示意图;Fig. 1 is a schematic diagram of the implementation flow of Embodiment 1 of the judgment method of the prediction mode of the present invention;
图2为图1所示实现流程中进行差值统计运算并将差值统计运算的结果确定为所述每一预测模式下的失真值的细化流程示意图;FIG. 2 is a schematic diagram of a detailed flow chart of performing a difference statistical operation in the implementation process shown in FIG. 1 and determining the result of the difference statistical operation as the distortion value in each prediction mode;
图3为图1所示实现流程中计算所述每一预测模式下的代价值的细化流程示意图;FIG. 3 is a schematic diagram of a refinement process for calculating the cost value in each prediction mode in the implementation process shown in FIG. 1;
图4为图1所示实现流程中对预测模式进行判决的细化流程示意图;FIG. 4 is a schematic diagram of a detailed flow for making a decision on a prediction mode in the implementation flow shown in FIG. 1;
图5为本发明预测模式的判决装置实施例一的组成结构示意图;FIG. 5 is a schematic diagram of the composition and structure of Embodiment 1 of the judgment device for the prediction mode of the present invention;
图6为图5所示装置中失真值计算模块的细化组成结构示意图;Fig. 6 is a schematic diagram of the refined composition structure of the distortion value calculation module in the device shown in Fig. 5;
图7为图5所示装置中代价值计算模块的细化组成结构示意图;Fig. 7 is a schematic diagram of the refined composition structure of the cost value calculation module in the device shown in Fig. 5;
图8为图5所示装置中判决模块的细化组成结构示意图。FIG. 8 is a schematic diagram of a detailed composition structure of the decision module in the device shown in FIG. 5 .
具体实施方式Detailed ways
本发明实施例提供的预测模式的判决方法,主要应用在编码器中,用于对编码单元的预测模式进行判决;通过减少在残差图像的基础上增加的变换、量化、反量化和反变换的操作,以及残差比特数的估计操作,能够在保证编码质量的前提下,大大节省编码器的硬件资源开销。The prediction mode judgment method provided by the embodiment of the present invention is mainly used in the encoder to judge the prediction mode of the coding unit; by reducing the transformation, quantization, inverse quantization and inverse transformation added on the basis of the residual image The operation and the estimation operation of the number of residual bits can greatly save the hardware resource overhead of the encoder under the premise of ensuring the encoding quality.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
图1为本发明预测模式的判定方法实施例一的实现流程示意图,参照图1所示,本实施例的预测模式的判定方法包括以下步骤:Fig. 1 is a schematic diagram of the implementation flow of Embodiment 1 of the method for determining the prediction mode of the present invention. Referring to Fig. 1, the method for determining the prediction mode of this embodiment includes the following steps:
步骤101,获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;Step 101, obtaining the predicted image in each prediction mode, and obtaining the estimated number of coding bits in each prediction mode;
通常,在H.265/HEVC编码标准的视频编解码过程中,每一帧图像会被分割成若干条带,条带类型可以是I条带、P条带或B条带。同时条带中包括多个编码单元,对于P条带和B条带而言,每个编码单元的预测模式可能为帧内预测模式,也可能为帧间预测模式。因此,视频图像在编码器中进行压缩时,需要在编码器中判定每个编码单元的预测模式,以实现视频图像正确的压缩编码;本实施例中的预测模式的判定方法就是应用在编码器中,用于对编码单元的预测模式进行判定。Generally, during the video encoding and decoding process of the H.265/HEVC encoding standard, each frame of image will be divided into several slices, and the slice type may be I slice, P slice or B slice. At the same time, a slice includes multiple coding units. For the P slice and the B slice, the prediction mode of each coding unit may be an intra prediction mode or an inter prediction mode. Therefore, when the video image is compressed in the encoder, it is necessary to determine the prediction mode of each coding unit in the encoder, so as to realize the correct compression encoding of the video image; the method for determining the prediction mode in this embodiment is applied to the encoder , used to determine the prediction mode of the coding unit.
这里,所述预测模式包括帧内预测模式和帧间预测模式,而所述帧间预测模式又包括运动估计方式和运动矢量预测方式;因此,本实施例中,所述各个预测模式包括帧内预测模式、帧间预测模式中运动估计方式和帧间预测模式中运动矢量预测方式。相应的,获取编码单元在各个预测模式下的预测图像包括:获取所述编码单元分别在帧内预测模式下、在运动估计方式下和在运动矢量预测方式下的预测图像;获取所述编码单元在各个预测模式下的预估编码比特数包括:获取所述编码单元分别在帧内预测模式下、在运动估计方式下和在运动矢量预测方式下的预估编码比特数。以下对所述预测图像和预估编码比特数的获取进行详细阐述。Here, the prediction mode includes an intra prediction mode and an inter prediction mode, and the inter prediction mode includes a motion estimation mode and a motion vector prediction mode; therefore, in this embodiment, each prediction mode includes an intra prediction mode prediction mode, motion estimation method in inter prediction mode, and motion vector prediction method in inter prediction mode. Correspondingly, obtaining the prediction image of the coding unit in each prediction mode includes: obtaining the prediction image of the coding unit in the intra prediction mode, the motion estimation mode and the motion vector prediction mode respectively; obtaining the prediction image of the coding unit The estimated number of coding bits in each prediction mode includes: acquiring the estimated number of coding bits of the coding unit in the intra prediction mode, the motion estimation mode and the motion vector prediction mode respectively. The acquisition of the predicted image and the estimated number of coding bits will be described in detail below.
具体地,首先介绍如何获取编码单元在帧内预测模式下的预测图像。通过从帧内预测模式中,选出当前编码单元内的优选帧内预测模式,并根据优选帧内预测模式,计算帧内预测图像IntraPredImage。Specifically, how to obtain a prediction image of a coding unit in an intra prediction mode is firstly introduced. By selecting the preferred intra prediction mode in the current coding unit from the intra prediction modes, and calculating the intra prediction image IntraPredImage according to the preferred intra prediction mode.
应当说明的是,编码单元亮度和色度的帧内预测,都有多种预测策略,因此实际应用中要选择最优的帧内预测策略。对于编码单元亮度和色度的帧内预测,可以从对应35种帧内预测模式中,选出当前编码单元内的优选帧内预测模式;至于选择优选帧内预测模式的策略,由于该策略不在本发明的重点保护范围内,因此不对其进行阐述。It should be noted that there are multiple prediction strategies for intra-frame prediction of luma and chrominance of coding units, so an optimal intra-frame prediction strategy should be selected in practical applications. For the intra prediction of the luminance and chroma of the coding unit, the preferred intra prediction mode in the current coding unit can be selected from the corresponding 35 intra prediction modes; as for the strategy of selecting the preferred intra prediction mode, since this strategy is not in Within the key protection scope of the present invention, so it will not be elaborated.
然后,介绍如何获取编码单元在运动估计方式下的预测图像。通过运动估计,获得运动矢量SearchMV;并通过搜索运动矢量插值,获得在运动估计方式下的帧间预测图像InterSearchImage。Then, how to obtain the prediction image of the coding unit in the motion estimation mode is introduced. Through motion estimation, the motion vector SearchMV is obtained; and through the search motion vector interpolation, the interframe prediction image InterSearchImage under the motion estimation mode is obtained.
接着,介绍如何获取编码单元在运动矢量预测方式下的预测图像。通过运动预测,获得运动矢量族PredMV;其中,PredMV(0)表示第0个候选运动矢量,PredMV(1)表示第1个候选运动矢量,PredMV(i)表示第i个候选运动矢量,依次类推。以第i个候选运动矢量PredMV(i)为例,经插值获得在运动矢量预测方式下的帧间预测图像InterPredImage(i)。Next, how to obtain the predicted image of the coding unit in the motion vector prediction mode is introduced. Through motion prediction, the motion vector family PredMV is obtained; among them, PredMV(0) represents the 0th candidate motion vector, PredMV(1) represents the 1st candidate motion vector, PredMV(i) represents the i-th candidate motion vector, and so on . Taking the i-th candidate motion vector PredMV(i) as an example, the interprediction image InterPredImage(i) in the motion vector prediction mode is obtained through interpolation.
接着,介绍如何获取编码单元在帧内预测模式下的预估编码比特数。该预估编码比特数记为bits(Intra),获取步骤如下:Next, how to obtain the estimated number of coding bits of the coding unit in the intra prediction mode is introduced. The estimated number of encoded bits is recorded as bits(Intra), and the acquisition steps are as follows:
获取当前编码单元最有可能的帧内预测模式列表即MPM(Most ProbableMode)模式列表,包含3个MPM模式,记为MPM[0]、MPM[1]和MPM[2]。若当前编码单元的预测模式不在MPM模式列表中,则当前编码单元的bits(Intra)为6;若当前编码单元的帧内预测模式等于MPM[0],则当前编码单元的bits(Intra)为2;若当前编码单元的帧内预测模式等于MPM[1]或MPM[2],则当前编码单元的bits(Intra)为3。Obtain the most probable intra prediction mode list of the current coding unit, that is, the MPM (Most Probable Mode) mode list, including 3 MPM modes, marked as MPM[0], MPM[1] and MPM[2]. If the prediction mode of the current coding unit is not in the MPM mode list, the bits(Intra) of the current coding unit is 6; if the intra prediction mode of the current coding unit is equal to MPM[0], the bits(Intra) of the current coding unit is 2; If the intra prediction mode of the current coding unit is equal to MPM[1] or MPM[2], the bits (Intra) of the current coding unit is 3.
接着,介绍如何获取编码单元在运动估计方式下的预估编码比特数。所述获取所述编码单元在运动估计方式下的预估编码比特数包括:基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数,该预估编码比特数记为bits(Search),获取步骤具体如下:Next, how to obtain the estimated number of coding bits of the coding unit in the motion estimation mode is introduced. The obtaining the estimated number of coding bits of the coding unit in the motion estimation mode includes: based on the preset motion vector difference method in the motion estimation mode, estimating and obtaining the estimated number of coding bits in the motion estimation mode, the estimated The number of encoded bits is recorded as bits(Search), and the acquisition steps are as follows:
记当前编码单元通过运动估计方式获取的LIST0方向运动矢量为mv_list0,该mv_list0矢量包含水平方向运动矢量分量mv_list0_x和垂直方向运动矢量分量mv_list0_y;Note that the LIST0 direction motion vector obtained by the current coding unit through motion estimation is mv_list0, and the mv_list0 vector includes the horizontal motion vector component mv_list0_x and the vertical motion vector component mv_list0_y;
记当前编码单元通过运动矢量预测方式获取的LIST0方向第一个运动矢量为mvp_list0,该矢量mvp_list0包含水平方向运动矢量分量mvp_list0_x和垂直方向运动矢量分量mvp_list0_y;Note that the first motion vector in the LIST0 direction obtained by the current coding unit through the motion vector prediction method is mvp_list0, and the vector mvp_list0 includes the horizontal motion vector component mvp_list0_x and the vertical motion vector component mvp_list0_y;
通过公式(1)计算水平方向运动矢量分量差值的绝对值,记为mvdx;并通过公式(2)计算垂直方向运动矢量分量差值的绝对值,记为mvdy;Calculate the absolute value of the horizontal direction motion vector component difference by formula (1), be recorded as mvdx; and calculate the absolute value of the vertical direction motion vector component difference by formula (2), be recorded as mvdy;
mvdx=abs(mvp_list0_x-mv_list0_x) (1)mvdx=abs(mvp_list0_x-mv_list0_x) (1)
mvdy=abs(mvp_list0_y-mv_list0_y) (2)mvdy=abs(mvp_list0_y-mv_list0_y) (2)
获取mvdx和mvdy中最高有效比特位的位置。若mvdx最高有效比特位在第N位,则mvdx的预估编码比特数为N×2,记为Bits(mvdx);若mvdy最高位在第M位,则mvdy的预估编码比特数为M×2,记为Bits(mvdy)。最终帧间预测模式中运动估计方式的预估编码比特数为mvdx预估编码比特数与mvdy预估编码比特数的和再加2,如公式(3)所示:Get the position of the most significant bit in mvdx and mvdy. If the most significant bit of mvdx is at bit N, the estimated number of encoded bits of mvdx is N×2, which is recorded as Bits(mvdx); if the highest bit of mvdy is at bit M, the estimated number of encoded bits of mvdy is M ×2, denoted as Bits(mvdy). The estimated number of coding bits in the motion estimation mode in the final inter-frame prediction mode is the sum of the estimated coding bits of mvdx and the estimated coding bits of mvdy plus 2, as shown in formula (3):
bits(Search)=2+Bits(mvdx)+Bits(mvdy) (3)bits(Search)=2+Bits(mvdx)+Bits(mvdy) (3)
这里,通过一种快速的运动矢量差值,估计获得所述编码单元在运动估计方式下的预估编码比特数,不计算编码残差所需的比特数,从而节省了编码器的硬件资源开销。Here, through a fast motion vector difference, the estimated number of coding bits of the coding unit in the motion estimation mode is estimated, and the number of bits required for coding the residual is not calculated, thereby saving the hardware resource overhead of the encoder .
接着,介绍如何获取编码单元在运动矢量预测方式下的预估编码比特数。所述编码单元在运动矢量预测方式下的预估编码比特数为预设值;获取所述编码单元在运动矢量预测方式下的预估编码比特数包括:获取所述预设值,该预估编码比特数记为bits(Pred(i));该预设值可以根据实际需要进行设置,该预设值是通过大量图像编码总结得到,本实施例中,所述预设值设置为4,即bits(Pred(i))=4。Next, how to obtain the estimated number of coding bits of the coding unit in the motion vector prediction mode is introduced. The estimated number of coding bits of the coding unit in the motion vector prediction mode is a preset value; obtaining the estimated number of coding bits of the coding unit in the motion vector prediction mode includes: obtaining the preset value, the estimated The number of encoded bits is recorded as bits(Pred(i)); the preset value can be set according to actual needs, and the preset value is obtained by summarizing a large number of image encodings. In this embodiment, the preset value is set to 4, That is, bits(Pred(i))=4.
这里,通过固定所述编码单元在运动矢量预测方式下的预估编码比特数,减少对预估编码比特数进行估计的步骤,能极大的减少预测模式决策过程中所需要的计算率失真花费,节省编码器的硬件资源开销。Here, by fixing the estimated number of coded bits of the coding unit in the motion vector prediction mode, the steps of estimating the estimated number of coded bits are reduced, which can greatly reduce the cost of computing rate-distortion required in the decision-making process of the prediction mode , saving the hardware resource overhead of the encoder.
步骤102,对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;Step 102, performing a difference statistical operation on the pixel values in the predicted image in each prediction mode and the pixel values in the original image, and determining the result of the difference statistical operation as the distortion value in each prediction mode;
这里,在计算所述编码单元在各个预测模式下的失真值时,只需要对当前编码单元在原始图像中的像素值和在预测图像中的像素值进行差值统计运算,而不需要在残差图像的基础上需要增加变换、量化、反量化和反变换操作,从而能够节省编码器的硬件资源开销。Here, when calculating the distortion value of the coding unit in each prediction mode, it is only necessary to perform a difference statistical operation on the pixel value of the current coding unit in the original image and the pixel value in the predicted image, without Transformation, quantization, inverse quantization and inverse transformation operations need to be added on the basis of the difference image, so that the hardware resource overhead of the encoder can be saved.
图2为图1所示实现流程中进行差值统计运算并将差值统计运算的结果确定为所述每一预测模式下的失真值的细化流程示意图,参照图2所示,步骤102具体包括以下步骤:Fig. 2 is a schematic diagram of a refinement process for performing difference statistical calculations and determining the results of difference statistical calculations as the distortion values in each prediction mode in the implementation process shown in Fig. 1, referring to Fig. 2, step 102 is specifically Include the following steps:
步骤1021,统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;Step 1021, counting the sum of squares of differences between the pixel values in the predicted image and the pixel values in the original image in each prediction mode;
步骤1022,将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。Step 1022: Determine the sum of squared differences in each prediction mode as the distortion value in each prediction mode.
这里,通过公式(4)统计所述编码单元在所述原始图像中的像素值与、在帧内预测模式下的预测图像中的像素值的差值平方和,获得当前编码单元在帧内预测模式下的失真值;Here, the sum of the squares of the difference between the pixel value of the coding unit in the original image and the pixel value in the predicted image in the intra prediction mode is calculated by formula (4), and the intra prediction of the current coding unit is obtained. Distortion value in mode;
其中,curCU表示当前编码单元,Distortion(Intra)表示当前编码单元在帧内预测模式下的失真值,OrgImage(x,y)表示当前编码单元在原始图像中的像素值,IntraPredImage(x,y)表示当前编码单元在帧内预测模式下的预测图像中的像素值。Among them, curCU represents the current coding unit, Distortion(Intra) represents the distortion value of the current coding unit in the intra prediction mode, OrgImage(x,y) represents the pixel value of the current coding unit in the original image, IntraPredImage(x,y) Indicates the pixel value in the predicted image of the current coding unit in intra prediction mode.
通过公式(5)统计所述编码单元在所述原始图像中的像素值与、在运动估计方式下的预测图像中的像素值的差值平方和,获得当前编码单元在运动估计方式下的失真值;Calculate the sum of the squares of the difference between the pixel value of the coding unit in the original image and the pixel value in the predicted image in the motion estimation mode by formula (5), to obtain the distortion of the current coding unit in the motion estimation mode value;
其中,Distortion(Search)表示当前编码单元在运动估计方式下的失真值,InterSearchImage(x,y)表示当前编码单元在运动估计方式下的预测图像中的像素值。Wherein, Distortion(Search) represents the distortion value of the current coding unit in the motion estimation mode, and InterSearchImage(x,y) represents the pixel value in the prediction image of the current coding unit in the motion estimation mode.
通过公式(6)统计所述编码单元在所述原始图像中的像素值与、在运动矢量预测方式下的预测图像中的像素值的差值平方和,获得当前编码单元在运动矢量预测方式下的失真值;Calculate the sum of the squares of the difference between the pixel value of the coding unit in the original image and the pixel value in the predicted image in the motion vector prediction mode by formula (6), and obtain the current coding unit in the motion vector prediction mode the distortion value;
其中,Distortion(Pred(i))表示当前编码单元在运动矢量预测方式下的失真值,(InterPredImage(i))(x,y)表示当前编码单元在运动矢量预测方式下的预测图像中的像素值。Among them, Distortion(Pred(i)) represents the distortion value of the current coding unit in the motion vector prediction mode, and (InterPredImage(i))(x,y) represents the pixels in the predicted image of the current coding unit in the motion vector prediction mode value.
步骤103,根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;Step 103, calculating the cost value in each prediction mode according to the preset quantization parameter value, the distortion value in each prediction mode and the number of estimated coding bits;
这里,对于亮度编码而言,所述量化参数共有52个值,取值0到51的整数值;其中,当量化参数值取最小值0时,表示量化最精细;相反,当量化参数值取最大值51时,表示量化是最粗糙;理论上说,所述量化参数值可以设置0到51范围内的任一整数值,本实施例中,所述量化参数值可以设置为20。Here, for luminance coding, the quantization parameter has 52 values in total, and takes an integer value from 0 to 51; wherein, when the quantization parameter value takes the minimum value of 0, it means that the quantization is the finest; on the contrary, when the quantization parameter value takes When the maximum value is 51, it means that the quantization is the roughest; theoretically, the quantization parameter value can be set to any integer value within the range of 0 to 51, and in this embodiment, the quantization parameter value can be set to 20.
图3为图1所示实现流程中计算所述每一预测模式下的代价值的细化流程示意图,参照图3所示,步骤103具体包括以下步骤:FIG. 3 is a schematic diagram of a detailed flow diagram for calculating the cost value in each prediction mode in the implementation flow shown in FIG. 1. Referring to FIG. 3, step 103 specifically includes the following steps:
步骤1031,根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;Step 1031, according to the preset quantization parameter value, determine the Lagrangian coefficient of the quantization parameter value;
这里,所述拉格朗日系数可以根据实际需要进行设置,具体需要根据所述量化参数值进行设置;本实施例中,所述拉格朗日参数是根据所述量化参数值,经过试验选取的一组系数。Here, the Lagrangian coefficient can be set according to actual needs, specifically according to the quantization parameter value; in this embodiment, the Lagrangian parameter is selected through experiments according to the quantization parameter value a set of coefficients.
步骤1032,将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。Step 1032: Multiply the estimated number of coding bits in each prediction mode by the Lagrangian coefficient, and add the result of the multiplication to the distortion value in each prediction mode to obtain the - The cost value in the prediction mode.
这里,可以通过公式(8)计算所述编码单元在帧内预测模式下的代价值;Here, the cost value of the coding unit in the intra prediction mode can be calculated by formula (8);
Cost(Intra)=Distortion(Intra)+λ*bits(Intra) (8)Cost(Intra)=Distortion(Intra)+λ*bits(Intra) (8)
其中,Cost(Intra)为所述编码单元在帧内预测模式下的代价值。Wherein, Cost(Intra) is the cost value of the coding unit in the intra prediction mode.
这里,可以通过公式(9)计算所述编码单元在运动估计方式下的代价值;Here, the cost value of the coding unit in the motion estimation mode can be calculated by formula (9);
Cost(Search)=Distortion(Search)+λ*bits(Search) (9)Cost(Search)=Distortion(Search)+λ*bits(Search) (9)
其中,Cost(Search)为所述编码单元在运动估计方式下的代价值。Wherein, Cost(Search) is the cost value of the coding unit in the motion estimation mode.
这里,可以通过公式(10)计算所述编码单元在运动矢量预测方式下的代价值;Here, the cost value of the coding unit in the motion vector prediction mode can be calculated by formula (10);
Cost(Pred(i))=Distortion(Pred(i))+λ*bits(Pred(i)) (10)Cost(Pred(i))=Distortion(Pred(i))+λ*bits(Pred(i)) (10)
其中,Cost(Pred(i))为所述编码单元在运动矢量预测方式下的代价值。Wherein, Cost(Pred(i)) is the cost value of the coding unit in the motion vector prediction mode.
步骤104,根据所属条带的类型和所述代价值,对预测模式进行判决。Step 104: Make a decision on the prediction mode according to the type of the slice to which it belongs and the cost value.
这里,所述条带的类型可以包括I条带、P条带和B条带。Here, the types of slices may include I slices, P slices, and B slices.
图4为图1所示实现流程中对预测模式进行判决的细化流程示意图,参照图4所示,步骤104具体包括以下步骤:FIG. 4 is a schematic diagram of a detailed flow for making a decision on the prediction mode in the implementation flow shown in FIG. 1. Referring to FIG. 4, step 104 specifically includes the following steps:
步骤1041,若所属条带的类型为I条带,将预测模式判决为帧内预测模式;Step 1041, if the type of the slice to which it belongs is an I slice, determine the prediction mode as the intra prediction mode;
步骤1042,若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;若是,则将预测模式判决为帧内预测模式;若否,则将预测模式判决为帧间预测模式。Step 1042, if the type of the slice to which it belongs is a P slice or a B slice, determine whether the cost value in the intra prediction mode is smaller than the cost value in the motion estimation mode and whether it is smaller than the cost value in the motion vector prediction mode; if so, Then determine the prediction mode as the intra-frame prediction mode; if not, determine the prediction mode as the inter-frame prediction mode.
可以理解的是,通过比较所述编码单元在帧内预测模式下的代价值、与所述编码单元在帧间预测模式下的代价值的大小关系,就能对所述编码单元的预测模式进行判决,是因为:上述代价值指的是所述编码单元的原始图像与各个预测模式下的预测图像之间的失真度、和编码码率之间的相互关系;当所述编码单元在某个预测模式下的代价值越小时,则说明所述编码单元在该预测模式下的编码效率越高,即说明在以尽可能小的编码码率下,获取的图像失真度越少。而当所述编码单元在帧内预测模式下的代价值小于所述编码单元在帧间预测模式下的代价值时,即所述编码单元在帧内预测模式下的编码效率高于所述编码单元在帧间预测模式下的编码效率,因此可以确定所述编码单元的预测模式为帧内预测模式,反之同理。It can be understood that, by comparing the cost value of the coding unit in the intra prediction mode with the cost value of the coding unit in the inter prediction mode, the prediction mode of the coding unit can be adjusted. The decision is because: the above cost value refers to the degree of distortion between the original image of the coding unit and the predicted image in each prediction mode, and the correlation between the coding rate; when the coding unit is in a certain The smaller the cost value in the prediction mode, the higher the coding efficiency of the coding unit in the prediction mode, that is, the less image distortion can be obtained at the smallest possible coding rate. And when the cost value of the coding unit in the intra prediction mode is smaller than the cost value of the coding unit in the inter prediction mode, that is, the coding efficiency of the coding unit in the intra prediction mode is higher than that of the coding unit The coding efficiency of the unit in the inter-frame prediction mode, so it can be determined that the prediction mode of the coding unit is the intra-frame prediction mode, and vice versa.
本发明还提供一种预测模式的判决装置,用于实现本发明预测模式的判决方法的具体细节,达到相同的效果。The present invention also provides a prediction mode judgment device, which is used to realize the specific details of the prediction mode judgment method of the present invention and achieve the same effect.
图5为本发明预测模式的判决装置实施例一的组成结构示意图,参照图5所示,本实施例中预测模式的判决装置包括:获取模块21、失真值计算模块22、代价值计算模块23和判决模块24;其中,FIG. 5 is a schematic diagram of the composition and structure of Embodiment 1 of the judgment device of the prediction mode of the present invention. Referring to FIG. 5 , the judgment device of the prediction mode in this embodiment includes: an acquisition module 21, a distortion value calculation module 22, and a cost value calculation module 23 And decision module 24; Wherein,
所述获取模块21,用于获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;The obtaining module 21 is used to obtain the predicted image in each prediction mode, and obtain the estimated number of coding bits in each prediction mode;
所述失真值计算模块22,用于对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;The distortion value calculation module 22 is configured to perform a difference statistical operation on the pixel values in the predicted image and the pixel values in the original image in each prediction mode, and determine the result of the difference statistical operation as each Distortion value in predictive mode;
所述代价值计算模块23,用于根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;The cost value calculation module 23 is configured to calculate the cost value in each prediction mode according to the preset quantization parameter value, the distortion value in each prediction mode and the number of estimated coding bits;
所述判决模块24,用于根据所属条带的类型和所述代价值,对预测模式进行判决。The judging module 24 is configured to judge a prediction mode according to the type of the slice to which it belongs and the cost value.
可选地,所述获取模块21,具体用于获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。Optionally, the acquisition module 21 is specifically configured to acquire the estimated number of coding bits in the intra prediction mode; based on the preset motion vector difference method in the motion estimation mode, estimate and obtain the estimated coding bit number in the motion estimation mode Number of bits; obtain the number of estimated coding bits as the preset value in the motion vector prediction mode.
可选地,图6为图5所示装置中失真值计算模块的细化组成结构示意图,参照图6所示,所述失真值计算模块22包括:统计单元221和第一确定单元222;其中,Optionally, FIG. 6 is a schematic diagram of a detailed composition structure of the distortion value calculation module in the device shown in FIG. 5 . Referring to FIG. 6 , the distortion value calculation module 22 includes: a statistical unit 221 and a first determination unit 222; ,
所述统计单元221,用于统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;The statistics unit 221 is used to calculate the sum of squares of differences between the pixel values in the predicted image and the pixel values in the original image in each prediction mode;
所述第一确定单元222,用于将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。The first determining unit 222 is configured to determine the sum of squared differences in each prediction mode as the distortion value in each prediction mode.
可选地,图7为图5所示装置中代价值计算模块的细化组成结构示意图,参照图7所示,所述代价值计算模块23包括:第二确定单元231和获取单元232;其中,Optionally, FIG. 7 is a schematic diagram of a detailed composition structure of the cost value calculation module in the device shown in FIG. ,
所述第二确定单元231,用于根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;The second determination unit 231 is configured to determine the Lagrangian coefficient of the quantization parameter value according to the preset quantization parameter value;
所述获取单元232,用于将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。The obtaining unit 232 is configured to multiply the estimated number of coding bits in each prediction mode by the Lagrangian coefficient, and add the multiplication result to the distortion value in each prediction mode , to obtain the cost value in each prediction mode.
可选地,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;图8为图5所示装置中判决模块的细化组成结构示意图,参照图8所示,所述判决模块24包括:第一判决单元241和第二判决单元242;其中,Optionally, the types of the slices include I slices, P slices, and B slices; the inter prediction mode includes motion estimation and motion vector prediction; FIG. 8 is a detailed view of the decision module in the device shown in FIG. Composition structure diagram, as shown in FIG. 8, the decision module 24 includes: a first decision unit 241 and a second decision unit 242; wherein,
所述第一判决单元241,用于若所属条带的类型为I条带,将预测模式判决为帧内预测模式;The first decision unit 241 is configured to determine the prediction mode as an intra prediction mode if the type of the slice to which it belongs is an I slice;
所述第二判决单元242,用于若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;当帧内预测模式下的代价值小于运动估计方式下的代价值、并且小于运动矢量预测方式下的代价值时,则将预测模式判决为帧内预测模式;当帧内预测模式下的代价值大于等于运动估计方式下的代价值、或者大于等于运动矢量预测方式下的代价值,则将预测模式判决为帧间预测模式。The second judging unit 242 is configured to judge whether the cost value in the intra prediction mode is smaller than the cost value in the motion estimation mode and whether it is smaller than the motion vector prediction mode if the type of the slice to which it belongs is a P slice or a B slice When the cost value in the intra-frame prediction mode is less than the cost value in the motion estimation mode and less than the cost value in the motion vector prediction mode, the prediction mode is determined as the intra-frame prediction mode; when the intra-frame prediction If the cost value in the mode is greater than or equal to the cost value in the motion estimation mode, or greater than or equal to the cost value in the motion vector prediction mode, then the prediction mode is determined as the inter-frame prediction mode.
在实际应用中,所述获取模块21、失真值计算模块22、代价值计算模块23、判决模块24,以及统计单元221、第一确定单元222、第二确定单元231、获取单元232、第一判决单元241和第二判决单元242均可由位于编码器中的中央处理器(CPU,Central ProcessingUnit)、微处理器(MPU,Micro ProcessorUnit)、数字信号处理器(DSP,Digital SignalProcessor)、专用集成电路(ASIC,Application Specific Integrated Circuit)、或现场可编程门阵列(FPGA,FieldProgrammable Gate Array)等实现。In practical applications, the acquisition module 21, the distortion value calculation module 22, the cost value calculation module 23, the decision module 24, and the statistical unit 221, the first determination unit 222, the second determination unit 231, the acquisition unit 232, the first Judging unit 241 and the second judging unit 242 all can be positioned at central processing unit (CPU, Central Processing Unit), microprocessor (MPU, Micro ProcessorUnit), digital signal processor (DSP, Digital Signal Processor), application-specific integrated circuit (ASIC) in encoder (ASIC, Application Specific Integrated Circuit), or Field Programmable Gate Array (FPGA, Field Programmable Gate Array) and other implementations.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements and improvements made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710218729.XA CN108696750A (en) | 2017-04-05 | 2017-04-05 | A kind of decision method and device of prediction mode |
PCT/CN2017/120011 WO2018184411A1 (en) | 2017-04-05 | 2017-12-29 | Prediction mode decision method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710218729.XA CN108696750A (en) | 2017-04-05 | 2017-04-05 | A kind of decision method and device of prediction mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108696750A true CN108696750A (en) | 2018-10-23 |
Family
ID=63713041
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710218729.XA Pending CN108696750A (en) | 2017-04-05 | 2017-04-05 | A kind of decision method and device of prediction mode |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108696750A (en) |
WO (1) | WO2018184411A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111447438A (en) * | 2020-04-24 | 2020-07-24 | 西安理工大学 | A Fast Intra Prediction Mode Decision Method for Universal Video Coding |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101651831A (en) * | 2003-01-08 | 2010-02-17 | 苹果公司 | Method and apparatus for improved coding mode selection |
CN102752596A (en) * | 2012-07-05 | 2012-10-24 | 深圳广晟信源技术有限公司 | Rate distortion optimization method |
CN103609122A (en) * | 2011-06-24 | 2014-02-26 | 斯凯普公司 | Rate-distortion optimization for video coding |
CN103650493A (en) * | 2011-06-24 | 2014-03-19 | 斯凯普公司 | Low complexity mode selection |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1513350A1 (en) * | 2003-09-03 | 2005-03-09 | Thomson Licensing S.A. | Process and arrangement for encoding video pictures |
CN103686165B (en) * | 2012-09-05 | 2018-01-09 | 乐金电子(中国)研究开发中心有限公司 | Decoding method and Video Codec in depth image frame |
US9609358B2 (en) * | 2013-07-23 | 2017-03-28 | Ati Technologies Ulc | Performing video encoding mode decisions based on down-scaled macroblock texture complexity |
-
2017
- 2017-04-05 CN CN201710218729.XA patent/CN108696750A/en active Pending
- 2017-12-29 WO PCT/CN2017/120011 patent/WO2018184411A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101651831A (en) * | 2003-01-08 | 2010-02-17 | 苹果公司 | Method and apparatus for improved coding mode selection |
CN103609122A (en) * | 2011-06-24 | 2014-02-26 | 斯凯普公司 | Rate-distortion optimization for video coding |
CN103650493A (en) * | 2011-06-24 | 2014-03-19 | 斯凯普公司 | Low complexity mode selection |
CN102752596A (en) * | 2012-07-05 | 2012-10-24 | 深圳广晟信源技术有限公司 | Rate distortion optimization method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111447438A (en) * | 2020-04-24 | 2020-07-24 | 西安理工大学 | A Fast Intra Prediction Mode Decision Method for Universal Video Coding |
Also Published As
Publication number | Publication date |
---|---|
WO2018184411A1 (en) | 2018-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12022093B2 (en) | Methods and systems for masking multimedia data | |
US10097851B2 (en) | Perceptual optimization for model-based video encoding | |
JP5081305B2 (en) | Method and apparatus for interframe predictive coding | |
US10091507B2 (en) | Perceptual optimization for model-based video encoding | |
US11240496B2 (en) | Low complexity mixed domain collaborative in-loop filter for lossy video coding | |
CN102984521B (en) | High-efficiency video coding inter-frame mode judging method based on temporal relativity | |
KR100871588B1 (en) | Intra coding device and method | |
US7881386B2 (en) | Methods and apparatus for performing fast mode decisions in video codecs | |
CA2960617A1 (en) | Perceptual optimization for model-based video encoding | |
US20120281762A1 (en) | System and method to process motion vectors of video data | |
JP5897218B2 (en) | Video encoding method and video encoding apparatus using this method | |
US9294765B2 (en) | Video encoder with intra-prediction pre-processing and methods for use therewith | |
CN102932642B (en) | Interframe coding quick mode selection method | |
US20150350686A1 (en) | Preencoder assisted video encoding | |
CN101888546B (en) | A kind of method of estimation and device | |
CN110351552B (en) | A Fast Coding Method in Video Coding | |
CN107087200A (en) | Skip coding mode early decision method for high-efficiency video coding standards | |
CN101304529A (en) | Method and device for selecting macroblock mode | |
US20070133689A1 (en) | Low-cost motion estimation apparatus and method thereof | |
CN101867818B (en) | Selection method and device of macroblock mode | |
US9736477B2 (en) | Performing video encoding mode decision based on motion activity | |
CN110446042B (en) | Coding method for improving P frame quality in H.264 | |
WO2021031225A1 (en) | Motion vector derivation method and apparatus, and electronic device | |
CN108696750A (en) | A kind of decision method and device of prediction mode | |
TW201711477A (en) | Video encoding methods and systems using adaptive color transform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181023 |
|
WD01 | Invention patent application deemed withdrawn after publication |