Dependency Quantization Pruning Method Based on Context Adaptive Threshold

By adopting a dependent quantization pruning method based on context adaptive thresholds in video encoding, the problem of difficulty and long encoding time of H.265 video encoding standard in hardware circuits is solved, and the effect of reducing computing overhead and applicable to the new encoding standard is achieved.

CN115086662BActive Publication Date: 2025-06-03HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210660771.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-06-03
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

The difficulty of implementing the H.265 video encoding standard in hardware circuits has increased greatly, the encoding time is long, and there is still a lot of room for optimization in practical applications.

Method used

Using a dependent quantization pruning method based on context adaptive thresholds, the quantization results are simplified to classification problems based on quantization remainder ξ by analyzing the quantitative decision interval, an adaptive threshold model is established, and the probability of correct judgment is measured through the cumulative distribution function, and the quantization paths are pruned in advance, so as to simplify the full path search.

Benefits of technology

On the premise of ensuring that the encoding performance is not reduced, the path branch computing overhead is reduced by about 30%, greatly saving computing resources, and suitable for the latest encoding standard H.266/VVC.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115086662B_ABST
    Figure CN115086662B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of video coding quantization algorithms, and discloses a context - adaptive threshold - based dependent quantization pruning method, which includes the following steps: Step 1: Coefficient quantization classification; Step 2: Establish a context - based adaptive threshold model; Step 3: Determine the adaptive threshold; Step 5: Update the grid state. Through the DQ algorithm principle and statistical analysis of quantization results, the present invention abstracts complex dynamic programming quantization into a multi - variable and multi - interval classification problem of quantization parameters QP, quantization remainder ξ, coefficient context index, etc. Aiming at the problem that there are still different quantization results in the same interval, a pruning method based on threshold comparison is proposed to cut some "safe" paths and simplify the full - path search. It greatly reduces the dynamic programming search space and solves the problem of high complexity of full - path search in the DQ algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of video coding quantization algorithms, and particularly relates to a dependent quantization pruning method based on context adaptive threshold. Background Art

[0002] In July 2020, two major international standard organizations, the International Telecommunication Union ITU-T and the International Organization for Standardization ISO / IEC, jointly launched the new generation of video coding standard H.266 / VVC. Compared with the previous coding standards, under the premise of maintaining the same video picture quality, the compression performance is to be increased by 50%. Compared with the previous generation of video coding standard H.265, the H.266 coding standard innovatively uses techniques such as quadtree plus multi-type tree block partitioning method, multi-core transform, and dependent quantization. The application of this series of techniques has brought a qualitative improvement in the storage compression of video data for the H.266 video coding standard. For example, in the comparison of turning on and off the dependent quantization technique, when compressing the same video stream, the bitstream generated by using dependent quantization coding saves 6%-8% of the bitstream compared with the bitstream generated without using dependent quantization coding.

[0003] However, so far, the H.265 video coding standard is still the most widely used coding standard and the video coding standard with the largest market share. And currently, most video surveillance in the market only supports the previous generation of H.265 standard. Due to its relatively high algorithm complexity, taking the dependent quantization algorithm (DQ) as an example, the strong dependence between quantization coefficients makes the difficulty of its implementation in the hardware circuit increase greatly, and the coding time is relatively long. Currently, there is still a large room for optimization in practical applications. Summary of the Invention

[0004] The purpose of the present invention is to provide a dependent quantization pruning method based on context adaptive threshold to solve the above technical problems.

[0005] To solve the above technical problems, the specific technical solution of the dependent quantization pruning method based on context adaptive threshold of the present invention is as follows:

[0006] A dependent quantization pruning method based on context adaptive threshold, comprising the following steps:

[0007] Step 1: Coefficient quantization classification: By analyzing the coefficient quantization decision interval, simplify the DQ quantization result into a classification problem based on the quantization remainder ξ;

[0008] Step 2: Establish a context-based adaptive threshold model: DQ will select different context models for bitrate calculation according to the values of quantization candidate values. During quantization, the context models used are represented by index. To distinguish the context models used, an adaptive threshold model with the encoder quantization parameter QP, quantizer state S k and index as variables is established;

[0009] Step 3: Adaptive threshold determination: The cumulative distribution function is used to measure the probability of correct judgment, and the obtained adaptive threshold is stored offline in a table;

[0010] Step 4: Coefficient pre-judgment, pruning the "safe" path: The coefficients are pre-judged through the adaptive threshold, and non-necessary quantization paths are pruned in advance according to the judgment results to simplify the full-path search;

[0011] Step 5: Update the grid state.

[0012] Furthermore, the specific steps of the said Step 1 include the following:

[0013] The transform coefficient C (i) obtains the pre-quantization value l through hard decision quantization SQ , as shown in Formula 1, where Q step is the quantization step. To intuitively show the distribution relationship of the transform coefficient relative to l SQ , the quantization decision intervals of the quantizer are statistically analyzed. According to the rounding situation of the quantization remainder ξ, l DQ is classified into "round-down samples" and "round-up samples", where ξ is defined as in Formula 2. The former means that l DQ is equal to l SQ , and the corresponding ξ value is rounded to 0. The latter means that l DQ is equal to l SQ +1, and the corresponding ξ value is rounded to 1. Therefore, the ξ-related thresholds T DR and T UR are used to pre-judge and classify the coefficients, as shown in Formula 3,

[0014] Formula 1

[0015] Formula 2

[0016] Formula 3 Furthermore, the specific steps of the said Step 2 include the following:

[0017] DQ will select different context models to calculate the bitrate according to the values of quantization candidate values. During quantization, the context models used are represented by indices and are distinguished according to Formula 4. At the same time, according to the DQ principle, different quantizer reconstruction methods are different, and the encoder quantization parameter QP and quantizer state S k will have an important impact on the quantization result. Therefore, an adaptive threshold model with QP, S k and index as variables, T DR and T UR are represented as the discrete function shown in Formula 5,

[0018] Formula 4

[0019] Formula 5(T DR , T UR ) = Ψ(QP, S k , index).

[0020] Furthermore, step 3 includes the following specific steps:

[0021] Use the cumulative distribution function to measure the probability of correct judgment:

[0022] First, classify and count the coefficients using the same context probability model, and divide the coefficients into several sub-intervals;

[0023] Secondly, perform offline CDF analysis on the samples in each sub-interval. The values of T DR and T UR are adjusted according to requirements. Set two maximum misjudgment probabilities ω and used to represent the probability of pre-judgment error through the threshold. First, draw two dotted lines of 1 - ω and on the y-axis to determine the threshold, which are used for the judgment of "round-down samples" and "round-up samples" respectively. These two horizontal lines intersect the CDF curves of the two types of samples at two points respectively. Draw two dotted lines perpendicular to the x-axis through the two intersection points, and the intersection points with the x-axis are T DR and T UR , as shown in Formula 6:

[0024] Formula 6 The misjudgment probability determines the RD performance, while the probability of correct judgment helps to reduce the complexity. The thresholds T DR and T UR are predefined by weighing the complexity and RD performance;

[0025] Finally, store the obtained adaptive thresholds offline in a table.

[0026] Further, step 4 includes the following specific steps:

[0027] When quantifying the coefficients, first obtain the quantization parameter QP, the quantizer state S k , and the context index used. By querying the offline table established in step 3, obtain the pre-determination thresholds T corresponding to the current quantizer states DR and T UR , perform pre-determination on the quantization candidates using formula 3, and only retain the path branches corresponding to the pre-determination results in the grid, while the remaining quantization candidates are regarded as "safe"

[0028] Pruned paths.

[0029] Further, step 5 includes the following specific steps:

[0030] After completing the pruning of the four state nodes, still follow the original state transition rule for quantizer state transition, and update the quantized coefficient information and save it to the path history information.

[0031] The context-adaptive threshold-based dependent quantization pruning method of the present invention has the following advantages:

[0032] (1) Through reasonable pruning operations on the quantization candidates, this scheme enables some quantization candidates to avoid the calculation and comparison process of the RD cost. On the premise of ensuring that the coding performance is not reduced, it reduces the calculation overhead of about 30% of the path branches, greatly saving computing resources;

[0033] (2) Compared with the existing fast quantization algorithms, this scheme can be applied to the latest coding standard H.266 / VVC and can be implemented through the standard test software VTM. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is the flowchart of the adaptive threshold pruning of the present invention;

[0035] Figure 2 is the bar chart of the quantization decision interval of the present invention;

[0036] Figure 3 is the CDF curve graph of the typical interval of the present invention;

[0037] Figure 4 is the pruning schematic diagram of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0038] In order to better understand the purpose, structure and function of the present invention, the following further describes in detail a context-adaptive threshold-based dependent quantization pruning method of the present invention with reference to the drawings.

[0039] The DQ algorithm performs an optimal path search for all quantization candidates γ = {l SQ , l SQ +1}, and maintains the conversion of the quantizer state in the grid. It is necessary to calculate and compare the RD costs for all quantization candidates. The present invention reasonably prunes the quantization candidates of the transform coefficients through context-based adaptive thresholds, reducing the path branches in the grid that must perform RD cost calculations.

[0040] As Figure 1 shown, the context-based adaptive threshold-dependent quantization pruning method of the present invention includes the following steps:

[0041] Step 1: Coefficient quantization classification: By analyzing the coefficient quantization decision interval, the DQ quantization result is simplified to a classification problem based on the quantization remainder ξ;

[0042] Step 2: Establish a context-based adaptive threshold model: DQ will select different context models for rate calculation according to the value of the quantization candidate. During quantization, the context model used is represented by index to distinguish the context models used, and an adaptive threshold model with the encoder quantization parameter QP, the quantizer state S k and index as variables is established;

[0043] Step 3: Adaptive threshold determination: The cumulative distribution function (CDF) is used to measure the probability of correct judgment, and the obtained adaptive threshold is stored offline in a table;

[0044] Step 4: Coefficient pre-judgment, pruning the "safe" path: The coefficients are pre-judged through the adaptive threshold, and unnecessary quantization paths are pruned in advance according to the judgment results to simplify the full-path search;

[0045] Step 5: Grid state update.

[0046] Embodiment:

[0047] Since the DQ algorithm performs path search for all quantization candidates and maintains the conversion of the quantizer state in the grid. It is necessary to calculate and compare the RD costs for all quantization candidates. The present invention reasonably prunes the quantization candidates of the transform coefficients through context-based adaptive thresholds, reducing the path branches in the grid that must perform RD cost calculations. As Figure 1 shown, the specific steps of the present invention are as follows:

[0048] 1. Coefficient quantization classification situation

[0049] The transform coefficient C (i) obtains a pre-quantized value l through hard decision quantization SQ, as shown in Equation 1, where Q step is the quantization step size. To visually represent the distribution relationship of the transform coefficients relative to l SQ , the quantization decision intervals of the quantizer are statistically analyzed, and the results are as shown in Figure 2 . The abscissa uses l float to represent integer division with a remainder. The three histograms respectively represent the coefficient distribution in three cases where the DQ quantization result l DQ = 0, 1, and 2. According to the rounding situation of the quantization remainder ξ, l DQ can be classified into "downward rounding samples" and "upward rounding samples", where ξ is defined as in Equation 2. The former means that l DQ is equal to l SQ , and the corresponding ξ value is rounded to 0. The latter means that l DQ is equal to l SQ + 1, and the corresponding ξ value is rounded to 1. Therefore, the thresholds T DR and T UR related to ξ can be used to pre-judge and classify the coefficients, as shown in Equation 3.

[0050] Equation 1

[0051] Equation 2

[0052] Equation 3

[0053] 2. Establish a context-based adaptive threshold model

[0054] DQ will select different context models to calculate the bit rate according to the value of the quantization candidate. During the quantization process, the context model used is represented by index, and Equation 4 is used to distinguish the context models used. At the same time, according to the DQ principle, different quantizer reconstruction methods are different, and the encoder quantization parameter QP and the quantizer state S k will have an important impact on the quantization result. Therefore, an adaptive threshold model with QP, S k and index as variables is established, and T DR and T UR can be expressed as the discrete function shown in Equation 5.

[0055] Equation 4

[0056] Equation 5 (T DR , T UR ) = Ψ(QP, S k , index).

[0057] 3. Adaptive threshold determination

[0058] The present invention uses the Cumulative Distribution Function (CDF) to measure the probability of correct judgment. First, the coefficients using the same context probability model are classified and counted, and the coefficients are divided into several sub-intervals; second, offline CDF analysis is performed on the samples in each sub-interval, and the CDF analysis result of one sub-interval is as Figure 3 shown, T DR and T UR are adjusted according to requirements. In this article, two maximum misjudgment probabilities ω and are used to represent the probability of error through threshold pre-judgment. First, draw two dotted lines of 1 - ω and on the y-axis to determine the thresholds, which are respectively used for the judgment of "round-down samples" and "round-up samples". These two horizontal lines respectively have two intersection points with the CDF curves of the two types of samples. Draw two dotted lines perpendicular to the x-axis through the two intersection points respectively, and the intersection points with the x-axis are T DR and T UR , as shown in Formula 6:

[0059] Formula 6

[0060] The misjudgment probability determines the RD performance, and the probability of correct judgment helps to reduce the complexity. The thresholds T DR and T UR are predefined by weighing the complexity and the RD performance. In the simulation experiment of this article, the probabilities of correct classification in the two intervals caused by the values of T DR and T UR are set to 98%, which can achieve a good balance between performance loss and complexity saving; finally, the obtained adaptive thresholds are stored offline in a table.

[0061] 4. Coefficient pre-judgment, pruning the "safe" path

[0062] When quantifying the coefficients, first obtain the quantization parameter QP, the quantizer state S k , and the context index used. By querying the offline table established in Step 3, obtain the pre-judgment thresholds T DR and T UR corresponding to the current quantizer states respectively. Perform pre-judgment on the quantization candidates using Formula 3, and only retain the path branches corresponding to the pre-judgment results in the grid. The remaining quantization candidates are regarded as the paths pruned "safely", and the pruning schematic is as Figure 4 shown. The quantization candidates are L = {3[2], 4[2], 5[3], 6[3]}, where the values in the brackets are the quantization candidates, and the values outside the brackets represent the reconstructed values under the corresponding quantizer states. As Figure 4As shown, pre - decisions are made on the two path branches corresponding to each quantizer state in sequence, and only the path branches corresponding to the decision results are retained in the trellis, and the remaining paths are pruned in advance.

[0063] 5. Trellis state update

[0064] After the pruning of the four state nodes is completed, the quantizer state conversion still follows the original state conversion rule, and the quantized coefficient information is updated and saved into the path history information.

[0065] It can be understood that the present invention is described by some embodiments. Those skilled in the art know that, without departing from the spirit and scope of the present invention, various changes or equivalent replacements can be made to these features and embodiments. Additionally, under the teaching of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the scope protected by the present invention.

Claims

1. A context - adaptive threshold - based dependent quantization pruning method, characterized in that, it includes the following steps: Step 1: Coefficient quantization classification: By analyzing the coefficient quantization decision interval, simplify the quantization result of the dependent quantization algorithm DQ into a classification problem based on the quantization remainder ξ; Transformation coefficient C (i) The pre - quantization value l is obtained through hard - decision quantization SQ , as shown in Formula 1, where Q step is the quantization step. To visually represent the distribution relationship of the transformation coefficient relative to l SQ , the quantization decision intervals of the quantizer are statistically analyzed. l float represents integer division with a remainder. According to the rounding situation of the quantization remainder ξ, l DQ is classified into "floor samples" and "ceiling samples", where ξ is defined as in Formula 2. The former means that l DQ is equal to l SQ , and the corresponding ξ value is rounded to 0. The latter means that l DQ is equal to l SQ + 1, and the corresponding ξ value is rounded to 1. Therefore, ξ - related thresholds T DR and T UR are used to pre - judge and classify the coefficients, as shown in Formula 3 Formula 1 Formula 2 Formula 3 Step 2: Establish a context-based adaptive threshold model: DQ will select different context models for bitrate calculation according to the value of the quantization candidate. During quantization, the context model used is represented by index, and the used context models are distinguished to establish an adaptive threshold model with the encoder quantization parameter QP, quantizer state S k and index as variables; Step 3: Adaptive threshold determination: Use the cumulative distribution function to measure the probability of correct judgment, and store the obtained adaptive threshold offline in a table; Step 4: Coefficient pre - judgment and pruning of "safe" paths: Pre - judge the coefficients through the adaptive threshold, and prune non - necessary quantization paths in advance according to the judgment result to simplify the full - path search; Step 5: Grid state update; After completing the pruning of the four state nodes, still follow the original state transition rules for quantizer state transition, and update the quantized coefficient information and save it to the path history information.

2. The context - adaptive threshold - based dependent quantization pruning method according to claim 1, characterized in that, the specific steps of step 2 are as follows: DQ will select different context models for bitrate calculation according to the values of quantization candidate values. During quantization, the context models used are represented by indices and are distinguished using the formula shown in Equation 4. At the same time, according to the DQ principle, different quantizer reconstruction methods are different, and the encoder quantization parameter QP and quantizer state S k will have an important impact on the quantization result. Therefore, an adaptive threshold model with QP, S k and index as variables, T DR and T UR are represented as the discrete function shown in Equation 5 Formula 4 Formula 5(T DR ,T UR ) = Ψ(QP,S k ,index).

3. The context - adaptive threshold - based dependent quantization pruning method according to claim 2, characterized in that, the specific steps of step 3 are as follows: Use the cumulative distribution function to measure the probability of correct judgment: First, classify and count the coefficients using the same context probability model, and divide the coefficients into several sub - intervals; Secondly, perform offline CDF analysis on the samples in each sub-interval, T DR and T UR are adjusted according to requirements. Set two maximum error judgment probabilities ω and used to represent the probability of error through threshold pre-judgment. First, draw two dashed lines of 1 - ω and on the y-axis to determine the thresholds, which are used for the judgment of "round-down samples" and "round-up samples" respectively. These two horizontal lines have two intersection points with the CDF curves of the two types of samples. Draw two dashed lines perpendicular to the x-axis through the two intersection points respectively, and the intersection points with the x-axis are T DR and T UR , as shown in Formula 6: Formula 6 The probability of misjudgment determines the RD performance, while the probability of correct judgment helps to reduce the complexity, and the thresholds T DR and T UR are predefined by weighing the complexity and the RD performance; Finally, store the obtained adaptive threshold offline in a table.

4. The context - adaptive threshold - based dependent quantization pruning method according to claim 3, characterized in that, the specific steps of step 4 are as follows: When quantifying the coefficients, first obtain the quantization parameter QP, the quantizer state S k , and the context index used. By querying the offline table established in step 3, obtain the pre-determination threshold T corresponding to each current quantizer state DR and T UR . Use formula 3 to perform a pre-determination on the quantization candidates, and only retain the path branches corresponding to the pre-determination results in the grid. The remaining quantization candidates are regarded as paths that are "safely" pruned