Method for judging PLANAR mode in advance in HEVC intra-frame prediction

By judging the PLANAR mode in HEVC intra prediction in advance, and using the calculation of reference pixel smoothness and threshold values, RDCost calculation is directly performed, which solves the problem of long-term mode selection process in intra prediction and improves the video encoding speed.

CN119232933APending Publication Date: 2024-12-31HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310808874.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the intra prediction, the existing HEVC video encoding technology has a long time to perform due to the complex RDCost calculation in intra prediction, which affects the encoding speed.

Method used

Before the mode initial selection, by calculating the smoothness and setting threshold of the current CU reference pixel, we will determine whether the PLANAR mode is selected in advance. If selected, RDCost calculation will be performed directly, skipping the initial screening of multiple modes, saving encoding time .

Benefits of technology

By judging the PLANAR mode in advance, the calculation complexity and time of intra prediction mode selection is significantly reduced, and the video encoding speed is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232933A_ABST
    Figure CN119232933A_ABST
Patent Text Reader

Abstract

The invention provides a method for judging a PLANAR mode in advance in HEVC (High Efficiency Video Coding) intra-frame prediction. The method comprises the following steps: S1, reference pixel smoothness Varall calculation: the smoothness Varall of all reference pixels is selected according to features: # imgabs0 # N is the width / height of a CU, f is a reference pixel, f superscript U represents an upper reference pixel, f superscript L represents a left reference pixel, mu all is the average value of all reference pixels: # imgabs1 # S2, and a threshold value THall is calculated according to THall = WQP * WT * WBD; tHall is a threshold value, WQP is a parameter controlled by a quantization step Qstep, WT is an empirical value set to be 0.706, WBD is a parameter adapted to different bit depths, and # imgabs2 # n is an image bit depth; s3, comparing the value of the smoothness with a threshold value, if the value of the smoothness is smaller than the threshold value, directly marking PLflag as 1, otherwise, marking PLflag as 0; and if the PLflag is 1, setting the final intra-frame prediction mode of the current CU as a PLANAR mode, and directly entering the calculation of the RDCost, otherwise, selecting the intra-frame mode according to the original steps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video coding and decoding, and in particular relates to a method for early judging a PLANAR mode in HEVC intra-frame prediction. Background Art

[0002] In the prior art, H.265 / HEVC retains the original H.264 / AVC framework while also upgrading and improving certain aspects. Intra-frame prediction in HEVC includes 35 prediction modes, of which PLANAR (mode 0) and DC (mode 1) are non-angle modes, and modes 2-34 are angle modes. When HEVC selects a mode for the current CU in intra-frame prediction, it calculates its distortion and bitstream bit, uses λ as the weight, and calculates cost = distortion + λ*bit. It selects the mode with the lowest cost among the 35 modes, of which the PLANAR mode is the mode selected the most times in intra-frame prediction.

[0003] However, the main defects of the prior art are:

[0004] RDCost uses distortion and bits as metrics to select the best mode. All modes are predicted when selecting a mode. Since RDCost is very complex in calculation, in order to reduce RDCost calculation, a certain number of modes are initially screened to calculate RDCost. Even after the initial screening, a certain amount of calculation is reduced, but it is still very complex and affects the speed of video encoding.

[0005] In addition, common terms in the prior art include:

[0006] H.265 / HEVC: It is a video compression coding standard and a lossy compression scheme standard. CU: Coding unit in H.265 / HEVC, with sizes of 64*64, 32*32, 16*16 and 8*8. Reconstructed block: In video coding, the pixel value of a CU calculated by the decoder based on the bitstream generally has some error with the original pixel value of the current CU.

[0007] Reference pixel: A row of pixels adjacent to the current CU in the reconstructed block in the upper right, upper, upper left, left and lower left directions of the current CU. The number of reference pixels is 4 times the width / height of the CU plus 1. RDCost: In general, the higher the video compression bit rate, the lower the distortion; and the lower the bit rate, the greater the distortion. RDCost is an expression for calculating bit rate and distortion, RDCost = D + λR. Where D is distortion, R is bit rate, and λ is external input. Through RDCost comparison, the mode is judged to maintain a balance between bit rate and distortion.

[0008] Intra-frame prediction: does not refer to other images, only eliminates spatial redundant information in the current coded image. Mode selection: H.265 / HEVC intra-frame mode prediction has 35 modes, and the encoder will select one of them for encoding. The official model selects the mode with the smallest RDCost.

[0009] Quantization step size Q step : Parameters that control the quality of the encoded image. The larger the quantization step, the worse the image quality. Summary of the invention

[0010] In order to solve the above problems, the purpose of the present application is to calculate a characteristic value using the value of the current CU reference pixel before the initial mode selection, and set a threshold to compare with the calculated characteristic value to determine whether the current CU selects the PLANAR mode in advance. If the PLANAR mode is selected, only one RDCost calculation is required, which can skip the initial mode screening calculation and the RDCost calculation of multiple modes in advance, thereby saving encoding time.

[0011] Specifically, the present invention provides a method for early judging a PLANAR mode in HEVC intra-frame prediction, the method comprising the following steps:

[0012] S1, reference pixel smoothness Var all calculate:

[0013] Assuming the size of CU is M*M, the upper reference pixel and the upper left reference pixel are uniformly defined as the upper reference pixel;

[0014] The feature selects the smoothness Var of all reference pixels all , the calculation formula is as follows:

[0015]

[0016] Among them, N is the width / height of CU, f is the reference pixel, the superscript U represents the upper reference pixel, the superscript L represents the left reference pixel, μ all is the average value of all reference pixels, and the formula is defined as follows:

[0017]

[0018] S2, threshold TH all calculate:

[0019] The threshold calculation formula is as follows:

[0020] TH all =W QP ×W T ×W BD

[0021] Among them, TH all is the threshold, W QP is the quantization step size Q step Controlled parameter, W T is the experience value, W BD To adapt to different bit depth parameters, W QP The definition is as follows:

[0022]

[0023] W BD The definition is as follows:

[0024]

[0025] Where n is the image bit depth;

[0026] S3, compare the smoothness value with the threshold, if it is less than the threshold, directly mark PL_flag as 1, otherwise it is 0;

[0027] If PL_flag is 1, the final intra-frame prediction mode of the current CU is set to the PLANAR mode, that is, there is no need to preliminarily select several better modes from the 35 intra-frame prediction modes, and directly calculate the RDCost of the PLANAR mode. Otherwise, it is necessary to preliminarily select several better modes from the 35 intra-frame prediction modes, and then calculate the RDCost for the preliminarily selected prediction modes, select the prediction mode with the smallest RDCost, and set it as the final intra-frame prediction mode of the current CU.

[0028] The step S3 further comprises:

[0029] S3.1, Determine Var all <TH all Is it true?

[0030] If no, proceed to step S3.2; if yes, proceed to step S3.4;

[0031] S3.2, PL_flag is 0;

[0032] S3.3, select several better models from the 35 prediction models; proceed to step S3.6;

[0033] S3.4, PL_flag is 1;

[0034] S3.5, select PLANAR;

[0035] S3.6, RDCost calculation; end.

[0036] In step S1, it is assumed that M is 8, M*M=8*8; the value range of N is 2Q , Q ranges from 2 to 6, f ranges from 0 to 255, μ all The value range is 0 to 255.

[0037] In step S2, W T Set to 0.706; n is 8 or 10.

[0038] The calculation of RDCost calculates the bit rate and distortion, and its expression is RDCost=D+λR, where D is the distortion, R is the bit rate, and λ is the external input.

[0039] The 35 prediction modes refer to the 35 prediction modes included in the intra-frame prediction in HEVC, of ​​which PLANAR is mode 0, DC is mode 1, PLANAR and DC are non-angle modes, and modes 2-34 are angle modes.

[0040] Therefore, the advantages of the present application are: the present method designs a reference pixel smoothness estimation formula, uses the reference pixel value of the current CU to estimate the smoothness of the reference pixel, takes the reference pixel smoothness as a feature, and the feature value calculation is simple and fast; the reference pixel smoothness threshold formula is designed, and the threshold obtained using simple features can quickly predict the PLANAR mode in advance and accelerate the speed of the encoder. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0042] Figure 1 It is a flow chart of the present application method.

[0043] Figure 2 This is a schematic diagram of reference pixels using a CU of 8*8 size as an example in the method of this application.

[0044] Figure 3 It is a flowchart of the algorithm in a specific embodiment of the method of this application. DETAILED DESCRIPTION

[0045] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.

[0046] like Figure 1 As shown, the method relates to a method for early judging the PLANAR mode in HEVC intra-frame prediction, comprising the following steps:

[0047] S1, reference pixel smoothness Var all calculate:

[0048] Assuming the size of the CU is 8*8, the upper reference pixel and the upper-left reference pixel are uniformly defined as the upper reference pixel;

[0049] The feature selects the smoothness Var of all reference pixels all , the calculation formula is as follows:

[0050]

[0051] Among them, N is the width / height of CU, f is the reference pixel, the superscript U represents the upper reference pixel, the superscript L represents the left reference pixel, μ all is the average value of all reference pixels, and the formula is defined as follows:

[0052]

[0053] S2, threshold TH all calculate:

[0054] The threshold calculation formula is as follows:

[0055] TH all =W QP ×W T ×W BD

[0056] Among them, TH all is the threshold, W QP is the quantization step size Q step Controlled parameter, W T The empirical value is set to 0.706, W BD To adapt to different bit depth parameters, W QP The definition is as follows:

[0057]

[0058] W BD The definition is as follows:

[0059]

[0060] Where n is the image bit depth;

[0061] S3, comparing the smoothness value with a threshold value, if it is less than the threshold value, directly marking PL_flag as 1, otherwise 0; if PL_flag is 1; further comprising:

[0062] S3.1, Determine Var all <TH all Is it true?

[0063] If no, proceed to step S3.2; if yes, proceed to step S3.4;

[0064] S3.2, PL_flag is 0;

[0065] S3.3, select several better models from the 35 prediction models; proceed to step S3.6;

[0066] S3.4, PL_flag is 1;

[0067] S3.5, select PLANAR;

[0068] S3.6, RDCost calculation; end.

[0069] Specifically, this method can also be described as follows:

[0070] 1. Feature Selection:

[0071] Taking the 8*8 CU as an example, the upper reference pixel and the upper left reference pixel are uniformly defined as the upper reference pixel, such as Figure 2 shown.

[0072] The feature selects the smoothness of all reference pixels (Var all ), the calculation formula is as follows:

[0073]

[0074] Among them, N is the width / height of CU, and the value range of N is 2 Q , Q ranges from 2 to 6, f is the reference pixel, f ranges from 0 to 255, the superscript U on f represents the upper reference pixel, the superscript L on f represents the left reference pixel, μ all is the average value of all reference pixels, μ all The value range is 0 to 255, and the formula is defined as follows:

[0075]

[0076] 2. Threshold calculation formula and process:

[0077] (1) The threshold calculation formula is as follows:

[0078] TH all =W QP ×W T ×W BD Among them, TH all is the threshold, W QP is the quantization step size (Q step ) controlled parameter, W T The empirical value is set to 0.706, W BD To adapt to different bit depth parameters, W QP The definition is as follows:

[0079]

[0080] Among them, Q step The value range is 0.625~228.

[0081] W BD The definition is as follows:

[0082]

[0083] Where n is the image bit depth, which can be 8 or 10.

[0084] (2) The main process is:

[0085] 1) Calculate the smoothness value using the reference pixel;

[0086] 2) Substitute relevant parameters into the threshold formula to calculate the threshold;

[0087] 3) Compare the smoothness value with the threshold. If it is less than the threshold, directly mark PL_flag as 1, otherwise it is 0;

[0088] 4) If PL_flag is 1, the final intra-frame prediction mode of the current CU is set to PLANAR mode, skipping all subsequent steps and directly entering the calculation of RDCost, otherwise the intra-frame mode selection is performed according to the original steps.

[0089] 3. Algorithm flow chart, such as Figure 3 shown.

[0090] 0, start;

[0091] 1. Reference pixel smoothness Var all calculate;

[0092] 2.Threshold TH all calculate;

[0093] 3. Determine Var all <TH all Is it true?

[0094] If no, proceed to step S4; if yes, proceed to step SS6;

[0095] 4, PL_flag is 0;

[0096] 5. Select several better prediction modes from the 35 prediction modes; proceed to step S8;

[0097] 6, PL_flag is 1;

[0098] 7. Select PLANAR;

[0099] 8. RDCost calculation;

[0100] 9. End.

[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for early judging the PLANAR mode in HEVC intra-frame prediction, characterized in that: The method The following steps are involved: S1, reference pixel smoothness Var all calculate: Assuming the size of CU is M*M, the upper reference pixel and the upper left reference pixel are uniformly defined as the upper reference pixel; The feature selects the smoothness Var of all reference pixels all , the calculation formula is as follows: Among them, N is the width / height of CU, f is the reference pixel, the superscript U represents the upper reference pixel, the superscript L represents the left reference pixel, μ all is the average value of all reference pixels, and the formula is defined as follows: S2, threshold TH all calculate: The threshold calculation formula is as follows: TH all =In QP ×W T ×W BD Among them, TH all is the threshold, W QP is the quantization step size Q step Controlled parameter, W T is the experience value, W BD To adapt to different bit depth parameters, W QP The definition is as follows: W BD The definition is as follows: Where n is the image bit depth; S3, compare the smoothness value with the threshold, if it is less than the threshold, directly mark PL_flag as 1, otherwise it is 0; If PL_flag is 1, the final intra-frame prediction mode of the current CU is set to the PLANAR mode, that is, there is no need to preliminarily select several better modes from the 35 intra-frame prediction modes, and directly calculate the RDCost of the PLANAR mode. Otherwise, it is necessary to preliminarily select several better modes from the 35 intra-frame prediction modes, and then calculate the RDCost for the preliminarily selected prediction modes, select the prediction mode with the smallest RDCost, and set it as the final intra-frame prediction mode of the current CU.

2. The method for determining the PLANAR mode in advance in HEVC intra-frame prediction according to claim 1, characterized in that: The step S3 further comprises: S3.1, Determine Var all <TH all Is it true? If no, proceed to step S3.2; if yes, proceed to step S3.4; S3.2, PL_flag is 0; S3.3, select several better models from the 35 prediction models; proceed to step S3.6; S3.4, PL_flag is 1; S3.5, select PLANAR; S3.6, RDCost calculation; end.

3. The method for determining the PLANAR mode in advance in HEVC intra-frame prediction according to claim 1, characterized in that: In step S1, it is assumed that M is 8, M*M=8*8; the value range of N is 2 Q , Q ranges from 2 to 6, f ranges from 0 to 255, μ all The value range is 0 to 255.

4. The method for determining the PLANAR mode in advance in HEVC intra-frame prediction according to claim 1, characterized in that: In step S2, W T Set to 0.706; n is 8 or 10.

5. The method for determining the PLANAR mode in advance in HEVC intra-frame prediction according to claim 1, characterized in that: The calculation of RDCost calculates the bit rate and distortion, and its expression is RDCost=D+λR, where D is the distortion, R is the bit rate, and λ is the external input.

6. The method for determining the PLANAR mode in advance in HEVC intra-frame prediction according to claim 1, characterized in that: The 35 prediction modes refer to the 35 prediction modes included in the intra-frame prediction in HEVC, of ​​which PLANAR is mode 0, DC is mode 1, PLANAR and DC are non-angle modes, and modes 2-34 are angle modes.