WO2018184411A1 - 一种预测模式的判决方法、装置及存储介质 - Google Patents

一种预测模式的判决方法、装置及存储介质 Download PDF

Info

Publication number
WO2018184411A1
WO2018184411A1 PCT/CN2017/120011 CN2017120011W WO2018184411A1 WO 2018184411 A1 WO2018184411 A1 WO 2018184411A1 CN 2017120011 W CN2017120011 W CN 2017120011W WO 2018184411 A1 WO2018184411 A1 WO 2018184411A1
Authority
WO
WIPO (PCT)
Prior art keywords
prediction mode
value
strip
mode
distortion
Prior art date
Application number
PCT/CN2017/120011
Other languages
English (en)
French (fr)
Inventor
黄勃
鄢展鹏
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2018184411A1 publication Critical patent/WO2018184411A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/184Methods 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods 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/19Methods 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/567Motion estimation based on rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding

Definitions

  • the present disclosure relates to the field of video communications, and in particular, to a prediction method, apparatus, and storage medium for a prediction mode.
  • the intra prediction mode and the inter prediction mode are two important prediction modes in video compression.
  • each frame can be divided into I frame, P frame and B.
  • 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, so it is necessary to judge by rate distortion optimization.
  • motion estimation and motion vector prediction are used to obtain inter-predicted pixel values.
  • the three sets of residual data are Transform, quantize, inverse quantize and inverse transform operations are performed to obtain three sets of reconstructed images; then the reconstructed image and the original image distortion values are calculated, and the number of bits of the encoded prediction information and the residual is estimated, and finally the law of rate distortion is used to determine The prediction mode of the current coding unit.
  • the method transforms, quantizes, dequantizes, and inverse transforms the residual data as the number of motion vector candidates increases, and estimates the estimated number of bits of the residual information to make the hardware resource overhead of the encoder. Very big.
  • embodiments of the present disclosure are expected to provide a prediction method, apparatus, and storage medium for a prediction mode.
  • An embodiment of the present disclosure provides a method for determining a prediction mode, where the method includes:
  • the prediction mode is determined according to the type of the strip and the value of the generation.
  • the obtaining the estimated coded bits in each prediction mode includes:
  • Distortion values include:
  • the sum of squared differences in each prediction mode is determined as the distortion value in each prediction mode.
  • the calculating the value of each of the prediction modes according to the preset quantization parameter value, the distortion value in each prediction mode, and the estimated coding bit number includes:
  • the type of the strip includes an I strip, a P strip, and a B strip;
  • the inter prediction mode includes a motion estimation manner and a motion vector prediction manner; and the type according to the associated strip and the generation value
  • the decision on the prediction mode includes:
  • the prediction mode is determined to be an intra prediction mode
  • the prediction mode is decided as an inter prediction mode.
  • the embodiment of the present disclosure further provides a prediction mode decision device, where the device includes: an acquisition module, a distortion value calculation module, a cost calculation module, and a decision module; wherein
  • the acquiring module is configured to acquire a predicted image in each prediction mode, and obtain an estimated number of encoded bits in each prediction mode;
  • the distortion value calculation module is configured to perform a difference statistical operation on the pixel value in the predicted image in each prediction mode and the pixel value in the original image, and determine the result of the difference statistical operation as each prediction Distortion value in mode;
  • the cost calculation module is configured to calculate a surrogate value in each prediction mode according to a preset quantization parameter value, a distortion value in each prediction mode, and an estimated coding bit number;
  • the decision module is configured to determine the prediction mode according to the type of the associated strip and the value of the generation.
  • the acquiring module is configured to obtain the estimated number of coded bits in the intra prediction mode; and based on the motion vector difference method preset in the motion estimation mode, estimate the estimated number of coded bits in the motion estimation mode. Obtaining the estimated number of coded bits as a preset value in the motion vector prediction mode.
  • the distortion value calculation module includes: a statistical unit and a first determining unit; wherein
  • the statistical unit is configured to calculate a sum of squares of the difference between the pixel value in the predicted image in each prediction mode and the pixel value in the original image;
  • the first determining unit is configured to determine a sum of squared differences in each prediction mode as a distortion value in each prediction mode.
  • the cost calculation module includes: a second determining unit and an obtaining unit; wherein
  • the second determining unit is configured to determine a Lagrangian coefficient of the quantized parameter value according to a preset quantization parameter value
  • the acquiring unit is configured to multiply the estimated number of coded bits in each prediction mode by the Lagrangian coefficient, and add the multiplied result to the distortion value in each prediction mode, The cost value of each of the prediction modes is obtained.
  • the type of the strip includes an I strip, a P strip, and a B strip;
  • the inter prediction mode includes a motion estimation mode and a motion vector prediction mode;
  • the decision module includes: a first decision unit and a second Decision unit; among them,
  • the first determining unit is configured to determine the prediction mode as an intra prediction mode if the type of the associated strip is an I strip;
  • the second determining unit is configured to determine whether the value of the intra prediction mode is smaller than the value of the motion estimation mode and is smaller than the motion vector prediction mode if the type of the strip is P strip or B strip.
  • the generation value of the intra prediction mode when the generation value in the intra prediction mode is smaller than the generation value in the motion estimation mode and less than the generation value in the motion vector prediction mode, the prediction mode is determined as the intra prediction mode; when the intra prediction mode is used If the next generation value is greater than or equal to the generation value under the motion estimation mode, or greater than or equal to the generation value under the motion vector prediction mode, the prediction mode is determined as the inter prediction mode.
  • Embodiments of the present disclosure further provide a storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the above methods.
  • the method and device for predicting a prediction mode are used to determine a prediction mode of a coding unit.
  • the prediction image in each prediction mode is acquired, and the number of estimated coding bits in each prediction mode is obtained.
  • performing a difference statistical operation on the pixel value in the predicted image in each prediction mode and the pixel value in the original image to calculate a distortion value in each prediction mode; and then, according to the preset quantization parameter value And the distortion value and the estimated coding bit number in each prediction mode, and calculating the generation value in each prediction mode; finally, determining the prediction mode according to the type of the associated stripe and the generation value.
  • the embodiment of the present disclosure does not need to reconstruct the image on the basis of the residual image to obtain a true distortion value; but only needs to acquire the prediction image, and
  • the coding unit performs a difference statistical operation on the pixel value in the original image and the pixel value in the predicted image to obtain a predicted distortion value.
  • the hardware resource overhead of the encoder is greatly increased; therefore, the embodiment of the present disclosure can greatly reduce the hardware resource overhead of the encoder and reduce the complexity of the hardware design of the encoder by reducing the above steps.
  • Embodiment 1 is a schematic flowchart of an implementation process of Embodiment 1 of a method for determining a prediction mode according to the present disclosure
  • FIG. 2 is a schematic diagram of a refinement process of performing a difference statistical operation in the implementation flow shown in FIG. 1 and determining a result of the difference statistical operation as a distortion value in each prediction mode;
  • FIG. 3 is a schematic diagram of a refinement process for calculating the cost value of each prediction mode in the implementation flow shown in FIG. 1;
  • FIG. 4 is a schematic diagram of a refinement process for determining a prediction mode in the implementation flow shown in FIG. 1;
  • FIG. 5 is a schematic structural diagram of a first embodiment of a determining apparatus for a prediction mode according to the present disclosure
  • FIG. 6 is a schematic structural diagram of a refinement component of a distortion value calculation module in the apparatus shown in FIG. 5;
  • FIG. 7 is a schematic structural diagram of a refinement composition of the generation value calculation module in the apparatus shown in FIG. 5;
  • FIG. 8 is a schematic diagram showing the refinement structure of the decision module in the apparatus shown in FIG. 5.
  • the prediction mode prediction method provided by the embodiment of the present disclosure is mainly applied to an encoder for determining a prediction mode of a coding unit; and reducing conversion, quantization, inverse quantization, and inverse transformation based on a 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 quality of the encoding.
  • FIG. 1 is a schematic flowchart of the implementation of the method for determining the prediction mode of the present disclosure. Referring to FIG. 1 , the method for determining the prediction mode in this embodiment includes the following steps:
  • Step 101 Acquire predicted images in respective prediction modes, and obtain estimated number of encoded bits in each prediction mode.
  • each frame image is divided into a plurality of strips, and the stripe type may be an I strip, a P strip, or a B strip.
  • 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 required to determine the prediction mode of each coding unit in the encoder to implement correct compression coding of the video image; the prediction mode of the prediction mode in this embodiment is applied to the encoder. Used to determine the prediction mode of the coding unit.
  • the prediction mode includes an intra prediction mode and an inter prediction mode
  • 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 frame.
  • acquiring the predicted image of the coding unit in each prediction mode comprises: acquiring a prediction image of the coding unit in an intra prediction mode, a motion estimation mode, and a motion vector prediction mode, respectively; acquiring the coding unit
  • the estimated number of coded bits in each prediction mode includes: obtaining the estimated number of coded bits 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 coded bits will be described in detail below.
  • the intra prediction image IntraPredImage is calculated from the intra prediction mode by selecting a preferred intra prediction mode within the current coding unit and according to the preferred intra prediction mode.
  • a preferred intra prediction mode in the current coding unit may be selected from corresponding 35 intra prediction modes; as for a strategy of selecting a preferred intra prediction mode, since the strategy is not
  • the disclosure is within the scope of the protection and therefore will not be described.
  • the motion vector SearchMV is obtained by motion estimation; and the inter prediction image InterSearchImage in the motion estimation mode is obtained by searching for motion vector interpolation.
  • the motion vector family PredMV is obtained by motion prediction; wherein PredMV(0) represents the 0th candidate motion vector, PredMV(1) represents the 1st candidate motion vector, PredMV(i) represents the ith candidate motion vector, and so on. .
  • the inter prediction image InterPredImage(i) in the motion vector prediction mode is obtained by interpolation.
  • the estimated number of coded bits is recorded as bits (Intra), and the acquisition steps are as follows:
  • the MPM (Most Probable Mode) mode list which includes three MPM modes, which are recorded 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 are 6; if the intra prediction mode of the current coding unit is equal to MPM[0], the bits (Intra) of the current coding unit are 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 are 3.
  • the obtaining the estimated number of coded bits in the motion estimation mode by the coding unit includes: estimating a predicted number of coded bits in the motion estimation mode based on a preset motion vector difference method in the motion estimation mode, and the estimation
  • the number of coded bits is recorded as bits (Search), and the acquisition steps are as follows:
  • the LIST0 direction motion vector obtained by the current coding unit by the motion estimation method is mv_list0, and the mv_list0 vector includes a horizontal direction motion vector component mv_list0_x and a vertical direction motion vector component mv_list0_y;
  • the first motion vector in the LIST0 direction obtained by the current coding unit by the motion vector prediction method is mvp_list0, and the vector mvp_list0 includes a horizontal direction motion vector component mvp_list0_x and a vertical direction motion vector component mvp_list0_y;
  • the estimated number of coded bits of mvdx is N ⁇ 2, which is recorded as Bits(mvdx); if the highest bit of mvdy is at the Mth bit, the estimated number of coded bits of mvdy is M. ⁇ 2, written as Bits (mvdy).
  • the estimated number of coded bits in the motion estimation mode in the final inter prediction mode is the sum of the number of mvdx predictive coded bits and the number of mvdy predictive coded bits plus 2, as shown in equation (3):
  • the estimated number of coded bits of the coding unit in the motion estimation mode is obtained by a fast motion vector difference value, and the number of bits required for coding the residual is not calculated, thereby saving the hardware resource overhead of the encoder.
  • the number of the estimated coding bits of the coding unit in the motion vector prediction mode is a preset value; and obtaining the estimated coded bit number of the coding unit in the motion vector prediction mode includes: acquiring the preset value, the estimation The number of coded 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 codes.
  • the calculation rate distortion cost required in the prediction mode decision process can be greatly reduced. , saving the hardware resource overhead of the encoder.
  • Step 102 performing a difference statistical operation on the pixel value in the predicted image in each prediction mode and the pixel value in the original image, and determining the result of the difference statistical operation as the distortion value in each prediction mode;
  • step 102 is specifically Includes the following steps:
  • Step 1021 Calculate a sum of squares of the difference between the pixel value in the predicted image in each prediction mode and the pixel value in the original image;
  • Step 1022 Determine a sum of squared differences in each prediction mode as a distortion value in each prediction mode.
  • the sum of 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 the formula (4), and the current coding unit is obtained in the intra prediction. Distortion value in mode;
  • curCU represents the current coding unit
  • Distortion 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) A pixel value representing a predicted image of the current coding unit in the intra prediction mode.
  • Distortion represents the distortion value of the current coding unit in the motion estimation mode
  • InterSearchImage(x, y) represents the pixel value in the prediction image of the current coding unit in the motion estimation mode.
  • Distortion represents the distortion value of the current coding unit in the motion vector prediction mode
  • InterPredImage(i)) (x, y) represents the pixel in the prediction image of the current coding unit in the motion vector prediction mode. value.
  • Step 103 Calculate a cost value in each prediction mode according to a preset quantization parameter value, a distortion value in each prediction mode, and an estimated coding bit number.
  • the quantization parameter has a total of 52 values, and takes an integer value of 0 to 51; wherein, when the quantization parameter value takes a minimum value of 0, it indicates that the quantization is the finest; When the maximum value is 51, it indicates that the quantization is the coarsest; in theory, the quantization parameter value can be set to any integer value in the range of 0 to 51. In this embodiment, the quantization parameter value can be set to 20.
  • FIG. 3 is a schematic diagram of a refinement process for calculating the cost value in each prediction mode in the implementation flow shown in FIG. 1.
  • step 103 specifically includes the following steps:
  • Step 1031 Determine a Lagrangian coefficient of the quantization parameter value according to a preset quantization parameter value.
  • the Lagrangian coefficient may be set according to actual needs, and is specifically required to be set according to the quantization parameter value.
  • the Lagrangian parameter is selected according to the quantization parameter value. a set of coefficients.
  • Step 1032 Multiply the estimated coded bit number in each prediction mode by the Lagrangian coefficient, and add the multiplied result to the distortion value in each prediction mode to obtain the The value of generation in a prediction mode.
  • the cost value of the coding unit in the intra prediction mode can be calculated by the formula (8);
  • Cost is the value of the coding unit in the intra prediction mode.
  • the value of the coding unit in the motion estimation mode can be calculated by the formula (9);
  • Cost (Search) is the value of the coding unit in the motion estimation mode.
  • the generation value of the coding unit in the motion vector prediction mode can be calculated by the formula (10);
  • Cost (Pred (i)) is the value of the coding unit in the motion vector prediction mode.
  • Step 104 Determine a prediction mode according to the type of the associated strip and the generation value.
  • the type of the strip may include an I strip, a P strip, and a B strip.
  • FIG. 4 is a schematic diagram of a refinement process for determining a prediction mode in the implementation flow shown in FIG. 1.
  • step 104 specifically includes the following steps:
  • Step 1041 If the type of the strip is I strip, the prediction mode is determined to be an intra prediction mode.
  • Step 1042 If the type of the stripe is P strip or B strip, determine whether the surrogate value in the intra prediction mode is smaller than the surrogate value in the motion estimation mode and whether it is smaller than the surrogate value in the motion vector prediction mode; if yes, Then, the prediction mode is decided as an intra prediction mode; if not, the prediction mode is decided as an inter prediction mode.
  • the prediction mode of the coding unit can be performed.
  • the above-mentioned generation value refers to a relationship between the degree of distortion between the original image of the coding unit and the predicted image in each prediction mode, and the coding rate; when the coding unit is in some
  • the smaller the generation value in the prediction mode the higher the coding efficiency of the coding unit in the prediction mode, that is, the less the image distortion obtained at the coding rate as small as possible.
  • the coding efficiency of the coding unit in the intra prediction mode is higher than the coding.
  • the coding efficiency of the unit in the inter prediction mode so it can be determined that the prediction mode of the coding unit is the intra prediction mode, and vice versa.
  • the present disclosure also provides a prediction mode decision device configured to implement the specific details of the decision mode of the present disclosure prediction mode to achieve the same effect.
  • FIG. 5 is a schematic structural diagram of the first embodiment of the apparatus for determining the prediction mode of the present disclosure.
  • the apparatus for determining the prediction mode in the embodiment includes: an obtaining module 21, a distortion value calculating module 22, and a cost calculating module 23. And a decision module 24; wherein
  • the acquiring module 21 is configured to acquire predicted images in each prediction mode, and obtain the estimated number of encoded bits in each prediction mode.
  • the distortion value calculation module 22 is configured to perform a difference statistical operation on the pixel value in the predicted image in each prediction mode and the pixel value in the original image, and determine the result of the difference statistical operation as each of the Distortion value in prediction mode;
  • the cost calculation module 23 is configured to calculate a cost value in each prediction mode according to a preset quantization parameter value, a distortion value in each prediction mode, and an estimated number of coding bits;
  • the decision module 24 is configured to determine the prediction mode according to the type of the associated strip and the value of the generation.
  • the acquiring module 21 is configured to obtain the estimated coded bit number in the intra prediction mode, and obtain the estimated coded bit in the motion estimation mode based on the preset motion vector difference method in the motion estimation mode. Number; obtains the estimated number of coded bits as a preset value in the motion vector prediction mode.
  • FIG. 6 is a schematic structural diagram of a refinement component of the distortion value calculation module in the apparatus shown in FIG. 5.
  • the distortion value calculation module 22 includes: a statistics unit 221 and a first determining unit 222; ,
  • the statistic unit 221 is configured to calculate a sum of squares of the difference between the pixel value in the predicted image in each prediction mode and the pixel value in the original image;
  • the first determining unit 222 is configured to determine a sum of squared differences in each prediction mode as a distortion value in each prediction mode.
  • FIG. 7 is a schematic structural diagram of a refinement component of the value calculation module in the apparatus shown in FIG. 5.
  • the cost calculation module 23 includes: a second determining unit 231 and an obtaining unit 232; ,
  • the second determining unit 231 is configured to determine a Lagrangian coefficient of the quantization parameter value according to a preset quantization parameter value
  • the obtaining unit 232 is configured to multiply the estimated coded bit number in each prediction mode by the Lagrangian coefficient, and add the multiplied result to the distortion value in each prediction mode. Obtaining the value of the generation in each of the prediction modes.
  • the type of the strip includes an I strip, a P strip, and a B strip;
  • the inter prediction mode includes a motion estimation mode and a motion vector prediction mode;
  • FIG. 8 is a detail of the decision module in the apparatus shown in FIG. Schematic diagram of the composition, as shown in FIG. 8, the decision module 24 includes: a first decision unit 241 and a second decision unit 242;
  • the first determining unit 241 is configured to determine the prediction mode as an intra prediction mode if the type of the associated strip is I stripe;
  • the second determining unit 242 is configured to determine whether the value of the intra prediction mode is smaller than the value of the motion estimation mode and is smaller than the motion vector prediction mode if the type of the strip is P strip or B strip. Lower generation value; when the generation value in the intra prediction mode is smaller than the generation value in the motion estimation mode and less than the generation value in the motion vector prediction mode, the prediction mode is determined as the intra prediction mode; when the intra prediction is performed If the generation value in the mode is greater than or equal to the generation value in the motion estimation mode, or greater than or equal to the generation value in the motion vector prediction mode, the prediction mode is decided as the inter prediction mode.
  • the decision unit 241 and the second decision unit 242 may each be a processor located in the encoder such as a Central Processing Unit (CPU), a Micro Processor Unit (MPU), and a digital signal processor (DSP, Digital). Signal Processor), Application Specific Integrated Circuit (ASIC), or Field Programmable Gate Array (FPGA).
  • CPU Central Processing Unit
  • MPU Micro Processor Unit
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • embodiments of the present disclosure further provide a storage medium, particularly a computer readable storage medium, such as a read only memory (ROM), a magnetic surface memory, an optical disk, or a compact disk (CD-ROM, Compact). Disc Read-Only Memory, etc., on which is stored a computer program that, when executed by the processor, implements the steps of the method of the embodiments of the present disclosure.
  • ROM read only memory
  • CD-ROM Compact disk
  • Disc Read-Only Memory etc.
  • the solution provided by the embodiment of the present disclosure is configured to determine a prediction mode of a coding unit. First, acquire prediction images in respective prediction modes, and obtain an estimated number of coding bits in each prediction mode. Then, for each prediction mode. Performing a difference statistical operation on the pixel value in the predicted image and the pixel value in the original image, and calculating the distortion value in each prediction mode; and then, according to the preset quantization parameter value, the distortion value in each prediction mode And estimating the number of coded bits, calculating the cost value of each prediction mode; finally, determining the prediction mode according to the type of the associated stripe and the generation value, and calculating the distortion of the coding unit in each prediction mode Value, there is no need to reconstruct the image based on the residual image to obtain the true distortion value; only the predicted image needs to be acquired, and the pixel value of the coding unit in the original image and the pixel value in the predicted image A difference statistical operation is performed to obtain a predicted distortion value.
  • the hardware resource overhead of the encoder is greatly increased; therefore, the embodiment of the present disclosure can greatly reduce the hardware resource overhead of the encoder and reduce the complexity of the hardware design of the encoder by reducing the above steps.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本公开公开了一种预测模式的判决方法,包括:获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;根据所属条带的类型和所述代价值,对预测模式进行判决。本公开还同时公开了一种预测模式的判决装置及存储介质。

Description

一种预测模式的判决方法、装置及存储介质
相关申请的交叉引用
本申请基于申请号为201710218729.X、申请日为2017年04月05日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及视频通信领域,尤其涉及一种预测模式的判决方法、装置及存储介质。
背景技术
帧内预测模式和帧间预测模式是视频压缩中两种重要的预测模式,以H.265/HEVC标准为例,针对连续动态图像的视频编码,可将各帧分成I帧、P帧和B帧三种类型。对于I帧而言,每个编码单元的预测模式均为帧内预测模式;但对P帧和B帧而言,每个编码单元的预测模式可能为帧内预测模式,也可能为帧间预测模式,因此需要通过率失真优化进行判决。
对于高清视频而言,为了提升帧间编码性能,会采用运动估计和运动矢量预测两种方式获取帧间预测像素值。而相关技术中,首先需要计算原始图像与帧内预测图像残差值、原始图像与运动估计预测图像残差值、以及原始图像与运动矢量预测图像残差值;然后对这三组残差数据进行变换、量化、反量化和反变换操作,获得三组重构图像;接着计算重构图像与原始图像失真值,并估计编码预测信息和残差的比特数,最终用率失真的法则判决出当前编码单元的预测模式。然而,该方法随着运动矢量候选数目的增加,对残差数据进行变换、量化、反量化和反变换操作,以及对残差信息的预估编码比特数进行估计,使编码器的硬件资源开销很大。
发明内容
为解决现有技术存在的问题,本公开实施例期望提供一种预测模式的判决方法、装置及存储介质。
本公开的技术方案是这样实现的:
本公开实施例提供了一种预测模式的判决方法,所述方法包括:
获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
根据所属条带的类型和所述代价值,对预测模式进行判决。
上述方案中,所述获取各个预测模式下的预估编码比特数包括:
获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。
上述方案中,所述对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值包括:
统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;
将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
上述方案中,所述根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值包括:
根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将 相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
上述方案中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述根据所属条带的类型和所述代价值,对预测模式进行判决包括:
若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;若是,则将预测模式判决为帧内预测模式;若否,则将预测模式判决为帧间预测模式。
本公开实施例还提供了一种预测模式的判决装置,所述装置包括:获取模块、失真值计算模块、代价值计算模块和判决模块;其中,
所述获取模块,配置为获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
所述失真值计算模块,配置为对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
所述代价值计算模块,配置为根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
所述判决模块,配置为根据所属条带的类型和所述代价值,对预测模式进行判决。
上述方案中,所述获取模块,配置为获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。
上述方案中,所述失真值计算模块包括:统计单元和第一确定单元;其中,
所述统计单元,配置为统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;
所述第一确定单元,配置为将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
上述方案中,所述代价值计算模块包括:第二确定单元和获取单元;其中,
所述第二确定单元,配置为根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
所述获取单元,配置为将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
上述方案中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述判决模块包括:第一判决单元和第二判决单元;其中,
所述第一判决单元,配置为若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
所述第二判决单元,配置为若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;当帧内预测模式下的代价值小于运动估计方式下的代价值、并且小于运动矢量预测方式下的代价值时,则将预测模式判决为帧内预测模式;当帧内预测模式下的代价值大于等于运动估计方式下的代价值、或者大于等于运动矢量预测方式下的代价值,则将预测模式判决为帧间预测模式。
本公开实施例又提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方法的步骤。
本公开实施例提供的预测模式的判决方法、装置及存储介质,用于对编码单元的预测模式进行判决;首先,获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;然后,对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,计算所述每一预测模式下的失真值;接着,根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;最后,根 据所属条带的类型和所述代价值,对预测模式进行判决。
可见,本公开实施例当计算编码单元在各个预测模式下的失真值时,不需要在残差图像的基础上来重构图像,以获得真实的失真值;而只需要获取预测图像,并对该编码单元在原始图像中的像素值和在预测图像中的像素值进行差值统计运算,以获得预测的失真值。由于在残差图像的基础上需要增加变换、量化、反量化和反变换操作,并且需要估计残差的比特数,而变换、量化、反量化和反变换的操作以及残差比特数的估计会大大增加编码器的硬件资源开销;因此,本公开实施例通过减少上述步骤,能够在保证编码质量的前提下,大大节省编码器的硬件资源开销,并且降低编码器硬件设计的复杂度。
附图说明
图1为本公开预测模式的判决方法实施例一的实现流程示意图;
图2为图1所示实现流程中进行差值统计运算并将差值统计运算的结果确定为所述每一预测模式下的失真值的细化流程示意图;
图3为图1所示实现流程中计算所述每一预测模式下的代价值的细化流程示意图;
图4为图1所示实现流程中对预测模式进行判决的细化流程示意图;
图5为本公开预测模式的判决装置实施例一的组成结构示意图;
图6为图5所示装置中失真值计算模块的细化组成结构示意图;
图7为图5所示装置中代价值计算模块的细化组成结构示意图;
图8为图5所示装置中判决模块的细化组成结构示意图。
具体实施方式
本公开实施例提供的预测模式的判决方法,主要应用在编码器中,用于对编码单元的预测模式进行判决;通过减少在残差图像的基础上增加的变换、量化、反量化和反变换的操作,以及残差比特数的估计操作,能够在保证编码质量的前提下,大大节省编码器的硬件资源开销。
本公开目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。应当理解,此处所描述的具体实施例仅仅用以解释本公开,并不用于限定公开。
图1为本公开预测模式的判定方法实施例一的实现流程示意图,参照图1所示,本实施例的预测模式的判定方法包括以下步骤:
步骤101,获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
通常,在H.265/HEVC编码标准的视频编解码过程中,每一帧图像会被分割成若干条带,条带类型可以是I条带、P条带或B条带。同时条带中包括多个编码单元,对于P条带和B条带而言,每个编码单元的预测模式可能为帧内预测模式,也可能为帧间预测模式。因此,视频图像在编码器中进行压缩时,需要在编码器中判定每个编码单元的预测模式,以实现视频图像正确的压缩编码;本实施例中的预测模式的判定方法就是应用在编码器中,用于对编码单元的预测模式进行判定。
这里,所述预测模式包括帧内预测模式和帧间预测模式,而所述帧间预测模式又包括运动估计方式和运动矢量预测方式;因此,本实施例中,所述各个预测模式包括帧内预测模式、帧间预测模式中运动估计方式和帧间预测模式中运动矢量预测方式。相应地,获取编码单元在各个预测模式下的预测图像包括:获取所述编码单元分别在帧内预测模式下、在运动估计方式下和在运动矢量预测方式下的预测图像;获取所述编码单元在各个预测模式下的预估编码比特数包括:获取所述编码单元分别在帧内预测模式下、在运动估计方式下和在运动矢量预测方式下的预估编码比特数。以下对所述预测图像和预估编码比特数的获取进行详细阐述。
具体地,首先介绍如何获取编码单元在帧内预测模式下的预测图像。通过从帧内预测模式中,选出当前编码单元内的优选帧内预测模式,并根据优选帧内预测模式,计算帧内预测图像IntraPredImage。
应当说明的是,编码单元亮度和色度的帧内预测,都有多种预测策略,因此实际应用中要选择最优的帧内预测策略。对于编码单元亮度和色度的帧内预测,可以从对应35种帧内预测模式中,选出当前编码单元内的优选 帧内预测模式;至于选择优选帧内预测模式的策略,由于该策略不在本公开的重点保护范围内,因此不对其进行阐述。
然后,介绍如何获取编码单元在运动估计方式下的预测图像。通过运动估计,获得运动矢量SearchMV;并通过搜索运动矢量插值,获得在运动估计方式下的帧间预测图像InterSearchImage。
接着,介绍如何获取编码单元在运动矢量预测方式下的预测图像。通过运动预测,获得运动矢量族PredMV;其中,PredMV(0)表示第0个候选运动矢量,PredMV(1)表示第1个候选运动矢量,PredMV(i)表示第i个候选运动矢量,依次类推。以第i个候选运动矢量PredMV(i)为例,经插值获得在运动矢量预测方式下的帧间预测图像InterPredImage(i)。
接着,介绍如何获取编码单元在帧内预测模式下的预估编码比特数。该预估编码比特数记为bits(Intra),获取步骤如下:
获取当前编码单元最有可能的帧内预测模式列表即MPM(Most Probable Mode)模式列表,包含3个MPM模式,记为MPM[0]、MPM[1]和MPM[2]。若当前编码单元的预测模式不在MPM模式列表中,则当前编码单元的bits(Intra)为6;若当前编码单元的帧内预测模式等于MPM[0],则当前编码单元的bits(Intra)为2;若当前编码单元的帧内预测模式等于MPM[1]或MPM[2],则当前编码单元的bits(Intra)为3。
接着,介绍如何获取编码单元在运动估计方式下的预估编码比特数。所述获取所述编码单元在运动估计方式下的预估编码比特数包括:基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数,该预估编码比特数记为bits(Search),获取步骤具体如下:
记当前编码单元通过运动估计方式获取的LIST0方向运动矢量为mv_list0,该mv_list0矢量包含水平方向运动矢量分量mv_list0_x和垂直方向运动矢量分量mv_list0_y;
记当前编码单元通过运动矢量预测方式获取的LIST0方向第一个运动矢量为mvp_list0,该矢量mvp_list0包含水平方向运动矢量分量mvp_list0_x和垂直方向运动矢量分量mvp_list0_y;
通过公式(1)计算水平方向运动矢量分量差值的绝对值,记为mvdx;并通过公式(2)计算垂直方向运动矢量分量差值的绝对值,记为mvdy;
mvdx=abs(mvp_list0_x-mv_list0_x)           (1)
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)所示:
bits(Search)=2+Bits(mvdx)+Bits(mvdy)      (3)
这里,通过一种快速的运动矢量差值,估计获得所述编码单元在运动估计方式下的预估编码比特数,不计算编码残差所需的比特数,从而节省了编码器的硬件资源开销。
接着,介绍如何获取编码单元在运动矢量预测方式下的预估编码比特数。所述编码单元在运动矢量预测方式下的预估编码比特数为预设值;获取所述编码单元在运动矢量预测方式下的预估编码比特数包括:获取所述预设值,该预估编码比特数记为bits(Pred(i));该预设值可以根据实际需要进行设置,该预设值是通过大量图像编码总结得到,本实施例中,所述预设值设置为4,即bits(Pred(i))=4。
这里,通过固定所述编码单元在运动矢量预测方式下的预估编码比特数,减少对预估编码比特数进行估计的步骤,能极大的减少预测模式决策过程中所需要的计算率失真花费,节省编码器的硬件资源开销。
步骤102,对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
这里,在计算所述编码单元在各个预测模式下的失真值时,只需要对当前编码单元在原始图像中的像素值和在预测图像中的像素值进行差值统计运算,而不需要在残差图像的基础上需要增加变换、量化、反量化和反 变换操作,从而能够节省编码器的硬件资源开销。
图2为图1所示实现流程中进行差值统计运算并将差值统计运算的结果确定为所述每一预测模式下的失真值的细化流程示意图,参照图2所示,步骤102具体包括以下步骤:
步骤1021,统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;
步骤1022,将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
这里,通过公式(4)统计所述编码单元在所述原始图像中的像素值与、在帧内预测模式下的预测图像中的像素值的差值平方和,获得当前编码单元在帧内预测模式下的失真值;
Figure PCTCN2017120011-appb-000001
其中,curCU表示当前编码单元,Distortion(Intra)表示当前编码单元在帧内预测模式下的失真值,OrgImage(x,y)表示当前编码单元在原始图像中的像素值,IntraPredImage(x,y)表示当前编码单元在帧内预测模式下的预测图像中的像素值。
通过公式(5)统计所述编码单元在所述原始图像中的像素值与、在运动估计方式下的预测图像中的像素值的差值平方和,获得当前编码单元在运动估计方式下的失真值;
Figure PCTCN2017120011-appb-000002
其中,Distortion(Search)表示当前编码单元在运动估计方式下的失真值,InterSearchImage(x,y)表示当前编码单元在运动估计方式下的预测图像中的像素值。
通过公式(6)统计所述编码单元在所述原始图像中的像素值与、在运动矢量预测方式下的预测图像中的像素值的差值平方和,获得当前编码单 元在运动矢量预测方式下的失真值;
Figure PCTCN2017120011-appb-000003
其中,Distortion(Pred(i))表示当前编码单元在运动矢量预测方式下的失真值,(InterPredImage(i))(x,y)表示当前编码单元在运动矢量预测方式下的预测图像中的像素值。
步骤103,根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
这里,对于亮度编码而言,所述量化参数共有52个值,取值0到51的整数值;其中,当量化参数值取最小值0时,表示量化最精细;相反,当量化参数值取最大值51时,表示量化是最粗糙;理论上说,所述量化参数值可以设置0到51范围内的任一整数值,本实施例中,所述量化参数值可以设置为20。
图3为图1所示实现流程中计算所述每一预测模式下的代价值的细化流程示意图,参照图3所示,步骤103具体包括以下步骤:
步骤1031,根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
这里,所述拉格朗日系数可以根据实际需要进行设置,具体需要根据所述量化参数值进行设置;本实施例中,所述拉格朗日参数是根据所述量化参数值,经过试验选取的一组系数。
步骤1032,将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
这里,可以通过公式(8)计算所述编码单元在帧内预测模式下的代价值;
Cost(Intra)=Distortion(Intra)+λ*bits(Intra)       (8)
其中,Cost(Intra)为所述编码单元在帧内预测模式下的代价值。
这里,可以通过公式(9)计算所述编码单元在运动估计方式下的代价值;
Cost(Search)=Distortion(Search)+λ*bits(Search)         (9)
其中,Cost(Search)为所述编码单元在运动估计方式下的代价值。
这里,可以通过公式(10)计算所述编码单元在运动矢量预测方式下的代价值;
Cost(Pred(i))=Distortion(Pred(i))+λ*bits(Pred(i))          (10)
其中,Cost(Pred(i))为所述编码单元在运动矢量预测方式下的代价值。
步骤104,根据所属条带的类型和所述代价值,对预测模式进行判决。
这里,所述条带的类型可以包括I条带、P条带和B条带。
图4为图1所示实现流程中对预测模式进行判决的细化流程示意图,参照图4所示,步骤104具体包括以下步骤:
步骤1041,若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
步骤1042,若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;若是,则将预测模式判决为帧内预测模式;若否,则将预测模式判决为帧间预测模式。
可以理解的是,通过比较所述编码单元在帧内预测模式下的代价值、与所述编码单元在帧间预测模式下的代价值的大小关系,就能对所述编码单元的预测模式进行判决,是因为:上述代价值指的是所述编码单元的原始图像与各个预测模式下的预测图像之间的失真度、和编码码率之间的相互关系;当所述编码单元在某个预测模式下的代价值越小时,则说明所述编码单元在该预测模式下的编码效率越高,即说明在以尽可能小的编码码率下,获取的图像失真度越少。而当所述编码单元在帧内预测模式下的代价值小于所述编码单元在帧间预测模式下的代价值时,即所述编码单元在帧内预测模式下的编码效率高于所述编码单元在帧间预测模式下的编码效率,因此可以确定所述编码单元的预测模式为帧内预测模式,反之同理。
本公开还提供一种预测模式的判决装置,配置为实现本公开预测模式的判决方法的具体细节,达到相同的效果。
图5为本公开预测模式的判决装置实施例一的组成结构示意图,参照图5所示,本实施例中预测模式的判决装置包括:获取模块21、失真值计算模块22、代价值计算模块23和判决模块24;其中,
所述获取模块21,配置为获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
所述失真值计算模块22,配置为对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
所述代价值计算模块23,配置为根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
所述判决模块24,配置为根据所属条带的类型和所述代价值,对预测模式进行判决。
可选地,所述获取模块21,配置为获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。
可选地,图6为图5所示装置中失真值计算模块的细化组成结构示意图,参照图6所示,所述失真值计算模块22包括:统计单元221和第一确定单元222;其中,
所述统计单元221,配置为统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;
所述第一确定单元222,配置为将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
可选地,图7为图5所示装置中代价值计算模块的细化组成结构示意图,参照图7所示,所述代价值计算模块23包括:第二确定单元231和获 取单元232;其中,
所述第二确定单元231,配置为根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
所述获取单元232,配置为将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
可选地,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;图8为图5所示装置中判决模块的细化组成结构示意图,参照图8所示,所述判决模块24包括:第一判决单元241和第二判决单元242;其中,
所述第一判决单元241,配置为若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
所述第二判决单元242,配置为若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;当帧内预测模式下的代价值小于运动估计方式下的代价值、并且小于运动矢量预测方式下的代价值时,则将预测模式判决为帧内预测模式;当帧内预测模式下的代价值大于等于运动估计方式下的代价值、或者大于等于运动矢量预测方式下的代价值,则将预测模式判决为帧间预测模式。
在实际应用中,所述获取模块21、失真值计算模块22、代价值计算模块23、判决模块24,以及统计单元221、第一确定单元222、第二确定单元231、获取单元232、第一判决单元241和第二判决单元242均可由位于编码器中的处理器比如(中央处理器(CPU,Central Processing Unit)、微处理器(MPU,Micro Processor Unit)、数字信号处理器(DSP,Digital Signal Processor)、专用集成电路(ASIC,Application Specific Integrated Circuit)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等)实现。
当然,实际应用时,还需要和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行本公开实施例方法的步骤。
因此,本公开实施例还提供了一种存储介质,具体为计算机可读存储介质,比如只读存储器(ROM,Read Only Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory)等,其上存储有计算机程序,所述计算机程序被所述处理器执行时实现本公开实施例方法的步骤。
本公开实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。
以上所述,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。凡在本公开的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本公开的保护范围之内。
工业实用性
本公开实施例提供的方案,用于对编码单元的预测模式进行判决;首先,获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;然后,对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,计算所述每一预测模式下的失真值;接着,根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;最后,根据所属条带的类型和所述代价值,对预测模式进行判决,当计算编码单元在各个预测模式下的失真值时,不需要在残差图像的基础上来重构图像,以获得真实的失真值;而只需要获取预测图像,并对该编码单元在原始图像中的像素值和在预测图像中的像素值进行差值统计运算,以获得预测的失真值。由于在残差图像的基础上需要增加变换、量化、反量化和反变换操作,并且需要估计残差的比特数,而变换、量化、反量化和反变换的操作以及残差比特数的估计会大大增加编码器的硬件资源开销;因此,本公开实施例通过减少上述步骤,能够在保证编码质量的前提下,大大节省编码器的硬件资源开销,并且降低编码器硬件设计的复杂度。

Claims (11)

  1. 一种预测模式的判决方法,包括:
    获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
    对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
    根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
    根据所属条带的类型和所述代价值,对预测模式进行判决。
  2. 根据权利要求1所述的方法,其中,所述获取各个预测模式下的预估编码比特数包括:
    获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。
  3. 根据权利要求1所述的方法,其中,所述对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值包括:
    统计每一预测模式下的预测图像中的像素值、与原始图像中的像素值的差值平方和;
    将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
  4. 根据权利要求1所述的方法,其中,所述根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值包括:
    根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
    将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将 相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
  5. 根据权利要求1所述的方法,其中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述根据所属条带的类型和所述代价值,对预测模式进行判决包括:
    若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
    若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;若是,则将预测模式判决为帧内预测模式;若否,则将预测模式判决为帧间预测模式。
  6. 一种预测模式的判决装置,包括:获取模块、失真值计算模块、代价值计算模块和判决模块;其中,
    所述获取模块,配置为获取各个预测模式下的预测图像,获取各个预测模式下的预估编码比特数;
    所述失真值计算模块,配置为对每一预测模式下的预测图像中的像素值和原始图像中的像素值进行差值统计运算,并将差值统计运算的结果确定为所述每一预测模式下的失真值;
    所述代价值计算模块,配置为根据预设的量化参数值、每一预测模式下的失真值和预估编码比特数,计算所述每一预测模式下的代价值;
    所述判决模块,配置为根据所属条带的类型和所述代价值,对预测模式进行判决。
  7. 根据权利要求6所述的装置,其中,所述获取模块,配置为获取帧内预测模式下的预估编码比特数;基于运动估计方式下预设的运动矢量差值方法,估计获得运动估计方式下的预估编码比特数;获取运动矢量预测方式下作为预设值的预估编码比特数。
  8. 根据权利要求6所述的装置,其中,所述失真值计算模块包括:统计单元和第一确定单元;其中,
    所述统计单元,配置为统计每一预测模式下的预测图像中的像素值、 与原始图像中的像素值的差值平方和;
    所述第一确定单元,配置为将所述每一预测模式下的差值平方和确定为所述每一预测模式下的失真值。
  9. 根据权利要求6所述的装置,其中,所述代价值计算模块包括:第二确定单元和获取单元;其中,
    所述第二确定单元,配置为根据预设的量化参数值,确定所述量化参数值的拉格朗日系数;
    所述获取单元,配置为将每一预测模式下的预估编码比特数与所述拉格朗日系数相乘,并将相乘的结果与所述每一预测模式下的失真值相加,获得所述每一预测模式下的代价值。
  10. 根据权利要求6所述的装置,其中,所述条带的类型包括I条带、P条带和B条带;帧间预测模式包括运动估计方式和运动矢量预测方式;所述判决模块包括:第一判决单元和第二判决单元;其中,
    所述第一判决单元,配置为若所属条带的类型为I条带,将预测模式判决为帧内预测模式;
    所述第二判决单元,配置为若所属条带的类型为P条带或者B条带,判断帧内预测模式下的代价值是否小于运动估计方式下的代价值并且是否小于运动矢量预测方式下的代价值;当帧内预测模式下的代价值小于运动估计方式下的代价值、并且小于运动矢量预测方式下的代价值时,则将预测模式判决为帧内预测模式;当帧内预测模式下的代价值大于等于运动估计方式下的代价值、或者大于等于运动矢量预测方式下的代价值,则将预测模式判决为帧间预测模式。
  11. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至5任一项所述方法的步骤。
PCT/CN2017/120011 2017-04-05 2017-12-29 一种预测模式的判决方法、装置及存储介质 WO2018184411A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710218729.XA CN108696750A (zh) 2017-04-05 2017-04-05 一种预测模式的判决方法及装置
CN201710218729.X 2017-04-05

Publications (1)

Publication Number Publication Date
WO2018184411A1 true WO2018184411A1 (zh) 2018-10-11

Family

ID=63713041

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120011 WO2018184411A1 (zh) 2017-04-05 2017-12-29 一种预测模式的判决方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN108696750A (zh)
WO (1) WO2018184411A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447438B (zh) * 2020-04-24 2023-05-26 西安理工大学 一种面向通用视频编码的快速帧内预测模式判决方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1846446A (zh) * 2003-09-03 2006-10-11 汤姆森许可贸易公司 编码视频图像的方法和布置
CN101651831A (zh) * 2003-01-08 2010-02-17 苹果公司 用于改进的编码模式选择的方法和装置
CN103609122A (zh) * 2011-06-24 2014-02-26 斯凯普公司 用于视频编码的率失真优化
CN103650493A (zh) * 2011-06-24 2014-03-19 斯凯普公司 低复杂度模式选择
CN103686165A (zh) * 2012-09-05 2014-03-26 乐金电子(中国)研究开发中心有限公司 深度图像帧内编解码方法及视频编解码器
US20150030082A1 (en) * 2013-07-23 2015-01-29 Ati Technologies Ulc Performing video encoding mode decisions based on down-scaled macroblock texture complexity

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752596B (zh) * 2012-07-05 2014-12-17 深圳广晟信源技术有限公司 一种率失真优化方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651831A (zh) * 2003-01-08 2010-02-17 苹果公司 用于改进的编码模式选择的方法和装置
CN1846446A (zh) * 2003-09-03 2006-10-11 汤姆森许可贸易公司 编码视频图像的方法和布置
CN103609122A (zh) * 2011-06-24 2014-02-26 斯凯普公司 用于视频编码的率失真优化
CN103650493A (zh) * 2011-06-24 2014-03-19 斯凯普公司 低复杂度模式选择
CN103686165A (zh) * 2012-09-05 2014-03-26 乐金电子(中国)研究开发中心有限公司 深度图像帧内编解码方法及视频编解码器
US20150030082A1 (en) * 2013-07-23 2015-01-29 Ati Technologies Ulc Performing video encoding mode decisions based on down-scaled macroblock texture complexity

Also Published As

Publication number Publication date
CN108696750A (zh) 2018-10-23

Similar Documents

Publication Publication Date Title
JP5373626B2 (ja) 複数の動きベクトル・プレディクタを使用して動きベクトルを推定する方法、装置、エンコーダ、デコーダ及びデコーディング方法
US10091507B2 (en) Perceptual optimization for model-based video encoding
US9628825B2 (en) Video decoder, video encoder, video decoding method, and video encoding method
JP5277257B2 (ja) 動画像復号化方法および動画像符号化方法
US8265145B1 (en) Management and selection of reference frames for long term prediction in motion estimation
CA2960617A1 (en) Perceptual optimization for model-based video encoding
US20140328403A1 (en) Image encoding/decoding method and apparatus using weight prediction
US8976856B2 (en) Optimized deblocking filters
US10085028B2 (en) Method and device for reducing a computational load in high efficiency video coding
US20160080769A1 (en) Encoding system using motion estimation and encoding method using motion estimation
US9571851B2 (en) Inter prediction method and apparatus using adjacent pixels, and image encoding/decoding method and apparatus using same
US9491480B2 (en) Motion vector encoding/decoding method and apparatus using a motion vector resolution combination, and image encoding/decoding method and apparatus using same
EP4037320A1 (en) Boundary extension for video coding
JP4494803B2 (ja) 動き補償に基づいた改善されたノイズ予測方法及びその装置とそれを使用した動画符号化方法及びその装置
US9432694B2 (en) Signal shaping techniques for video data that is susceptible to banding artifacts
US20160277767A1 (en) Methods, systems and apparatus for determining prediction adjustment factors
US20080123733A1 (en) Method and Apparatus for Selecting a Reference Frame for Motion Estimation in Video Encoding
US8792549B2 (en) Decoder-derived geometric transformations for motion compensated inter prediction
CN108028938A (zh) 视频编码方法及装置
KR20080064011A (ko) 인접 파티션의 크기를 고려한 움직임 벡터 예측 방법,장치, 인코더, 디코더 및 복호화 방법
WO2018184411A1 (zh) 一种预测模式的判决方法、装置及存储介质
KR20080035390A (ko) 영상 예측 모드 결정 방법 및 장치
EP4268460A1 (en) Temporal filter
CN118120234A (zh) 用于视频处理的方法、装置和介质
CN114760467A (zh) 编码模式的确定方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17904377

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17904377

Country of ref document: EP

Kind code of ref document: A1