WO2020181612A1 - 最优拉格朗日乘子基准定点标定方法 - Google Patents

最优拉格朗日乘子基准定点标定方法 Download PDF

Info

Publication number
WO2020181612A1
WO2020181612A1 PCT/CN2019/082845 CN2019082845W WO2020181612A1 WO 2020181612 A1 WO2020181612 A1 WO 2020181612A1 CN 2019082845 W CN2019082845 W CN 2019082845W WO 2020181612 A1 WO2020181612 A1 WO 2020181612A1
Authority
WO
WIPO (PCT)
Prior art keywords
lagrangian multiplier
range
optimal
point
calibration
Prior art date
Application number
PCT/CN2019/082845
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 WO2020181612A1 publication Critical patent/WO2020181612A1/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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • 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/56Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search

Definitions

  • the invention relates to video coding technology, in particular to an optimal Lagrangian multiplier reference fixed-point calibration method.
  • rate-distortion optimization The introduction of rate-distortion optimization technology in video coding has brought about a significant improvement in performance. Since H.264, it has been widely used in mainstream encoders. As the core coding optimization technology, the rate-distortion optimization directly determines the performance and efficiency of the encoder.
  • the rate-distortion optimization formula is written as formula (1):
  • D is the image distortion, which is usually expressed by the sum of square difference (SSE) and the sum of absolute error (SAD).
  • SSE sum of square difference
  • SAD sum of absolute error
  • R is the actual encoding bit rate
  • R T is the encoding target bit rate.
  • J is the coding cost and ⁇ is the Lagrangian multiplier.
  • each video image block will make a lot of attempts on block division structure, motion search, quantization parameters and residual transformation. Each combination will produce corresponding bit consumption and image distortion information.
  • the result of these mode combinations is substituted into formula (2), and the mode combination with the smallest cost J is selected as the final coding mode. Since the selection of the Lagrangian multiplier determines the balance between the video quality and the size of the generated bitstream, the calculation of the Lagrangian multiplier is very important.
  • C and K are model parameters.
  • is calculated by setting the first-order differential of the cost function to zero, as shown in formula (4):
  • q step is the quantization step length, which is uniquely determined by the quantization parameter (QP).
  • c is a constant, generally the value is 0.85.
  • the Lagrangian multiplier used in the reference software (RD) code corresponding to the second-generation source coding standard AVS2 with independent intellectual property rights in my country after calculating the benchmark Lagrangian multiplier using formula (6), The video frame type and reference relationship are used to formulate the Lagrangian multiplier correction strategy.
  • rate-distortion optimization algorithms have brought greater coding efficiency improvements.
  • rate-distortion optimization algorithms requires a lot of previous theoretical accumulation and algorithm design experience in order to obtain a stable improvement in coding efficiency.
  • the technical problem to be solved by the present invention is to provide an optimal Lagrangian multiplier benchmark fixed-point calibration method, and obtain the optimal benchmark Lagrangian multiplier under different coding scenarios through a relatively simple coding test process.
  • ⁇ c (QP i ) and the scale factor calculate the Lagrangian multiplier used by each measuring point in each QP configuration when coding, and perform the coding test at each measuring point respectively, and obtain each QP configuration including each A collection of coding test results of measuring points;
  • step S5. Determine whether the calibration range of the updated Lagrangian multiplier meets the threshold condition, if it is satisfied, the fixed-point process is ended, otherwise, it returns to step S2 to continue iteration.
  • the present invention uses the empirical value to set the initial Lagrangian multiplier
  • the calibration range is set to
  • the lambda mathematical model can also be used to estimate the calibration range of the initial Lagrangian multiplier according to requirements.
  • r min and r max are the lower and upper bounds of the calibration range, respectively.
  • step S2 the calculation method of the Lagrangian multiplier used in the coding of the j-th measuring point under the QP i configuration is:
  • the encoding test is performed on each measurement point under all y standard QP configurations specified by the encoding standard adopted by the video sequence, and the set of encoding test results including each measurement point is obtained:
  • d j (QP i ) represents the image distortion obtained by using the Lagrangian multiplier encoding offset by the j-th scale factor in the QP i configuration
  • rate j (QP i ) represents the image distortion obtained in the QP i configuration using the first
  • the value of y here depends on the coding standard adopted by the video sequence.
  • step S3 the calculation of the relative optimal performance group in the set of coding test results using BD-Rate as the evaluation index specifically includes:
  • the coded test results in the set can form a total of n y groups, one of which can be selected as anchor points, and all available groups are used as test point sets, using BD- Rate performance evaluation index calculates the optimal performance group in the test point set n y group results:
  • the idea of updating the calibration range in step S4 is: Considering the three situations in which the optimal Lagrangian multiplier of the current iteration is in the calibration range: 1The current optimal Lagrangian multiplier falls in the middle of the calibration range Part; 2The current optimal Lagrangian multiplier falls within the minimum value of the calibration range; 3The current optimal Lagrangian multiplier falls within the maximum value of the calibration range; for the above situation 1, we will iterate next The range of is set near the current optimal Lagrangian multiplier to improve the search efficiency; for the above cases 2 and 3, we believe that the optimal Lagrangian multiplier may fall outside the calibration range, so it needs to be expanded Search range, the accuracy of the optimal Lagrangian multiplier obtained.
  • the setting of the above interception coefficient is to control the size of the new calibration range, and the setting of the expansion coefficient is to expand the search range when the current optimal scale factor appears on the edge, avoiding the occurrence of local optimum.
  • N ratio be the number of scale factors
  • the cutoff coefficient is 1
  • ⁇ and ⁇ are the expansion coefficients at both ends, and satisfy 0 ⁇ 1 and ⁇ >1
  • r i-1 and r i+1 are the previous and next scale factors of r i , respectively.
  • step S5 the judgment of the calibration range of the updated Lagrangian multiplier is transformed into the interval measurement between the scale factors obtained by dividing the new calibration range, because as the search proceeds, the Lagrangian multiplier The calibration range is also gradually reduced. Correspondingly, the scale factor interval is also shortened.
  • step S5 includes:
  • determining whether the interval of the new scale factor meets the threshold condition specifically includes: if the interval of the new scale factor is less than one thousandth, determining that the threshold condition is satisfied.
  • the beneficial effects of the present invention are: by searching for the Lagrangian multiplier according to the divided scale factor within the calibration range of the Lagrangian multiplier, the coding test is performed and the BD-Rate is used to evaluate the test result to obtain the relatively optimal performance of the Lagrangian Longer multiplier, and then update the calibration range based on the position of the Lagrangian multiplier with the relative optimal performance, and then obtain a new scale factor, and iterate until the threshold condition is met.
  • a large number of iterative calculations are required, its realization The process is simple and the whole process is automated. It does not require previous theoretical accumulation and rate-distortion optimization algorithm design experience, and does not require human intervention to obtain an accurate optimal benchmark Lagrangian multiplier.
  • Fig. 1 is a flow chart of an optimal Lagrangian multiplier reference fixed-point calibration method in an embodiment of the present invention.
  • the invention aims to provide an optimal Lagrangian multiplier reference fixed-point calibration method, through a relatively simple coding test process, to obtain the optimal reference Lagrangian multiplier under different coding scenarios.
  • the core idea is to search for Lagrangian multipliers according to the divided scale factors within the calibration range of Lagrangian multipliers, perform coding tests and use BD-Rate to evaluate the test results to obtain relatively optimal Lagrangian performance Then update the calibration range based on the position of the Lagrangian multiplier with the relative optimal performance, and then obtain a new scale factor, and iterate until the threshold condition is met.
  • the calibration range of the initial Lagrangian multiplier is set to
  • the lambda mathematical model can also be used to estimate the calibration range of the initial Lagrangian multiplier according to requirements.
  • the range is divided into n segments with equal length (also can be divided according to the same proportion or using a random division method that obeys a certain distribution), and n+1 scale factors can be derived, and then each QP configuration can be obtained.
  • n+1 measuring points in one-to-one correspondence with n+1 scale factors, that is, each measuring point uses a scale factor to offset on the basis of the initial Lagrangian multiplier, the jth under QP i configuration
  • the definition of the scale factor r i,j of each measuring point is shown in formula (7):
  • r min and r max are the lower and upper bounds of the calibration range, respectively.
  • the Lagrangian multiplier used in the coding of the j-th measuring point under the QP i configuration can be derived from the initial point ⁇ c (QP i ) and the scale factor r i,j , as shown in formula (8):
  • ⁇ c (QP i ) is the initial Lagrangian multiplier corresponding to QP i
  • r i,j is the scale factor of the j-th measuring point under the QP i configuration.
  • step S1 Taking the division of the calibration range into 8 segments to obtain 9 scale factors in step S1 as an example, 4 QP configurations and 9 scale factors are traversely encoded, and the result set obtained by encoding is shown in formula (9):
  • d j (QP i ) represents the image distortion obtained by using the Lagrangian multiplier encoding offset by the j-th scale factor in the QP i configuration
  • rate j (QP i ) represents the image distortion obtained in the QP i configuration using the first The bit rate obtained by encoding the Lagrangian multiplier after offset by j scale factors.
  • BD-Rate is a commonly used encoder performance evaluation index, which represents the increase in bit rate under the same PSNR (Peak to Noise Ratio). Therefore, when the BD-Rate is negative, the encoder performance is improved.
  • the encoding result of 4 and 9 arranged QP scale factor obtained may be composed of a total of 94 groups.
  • the calibration range of the Lagrangian multiplier needs to be contracted according to the optimal performance group.
  • the scale factor corresponding to QP 1 in the optimal performance group of this round of iteration is r i
  • the calibration range of the new Lagrangian multiplier is shown in formula (11):
  • the present invention considers three situations in which the optimal Lagrangian multiplier of the current iteration is in the calibration range: 1The current optimal Lagrangian multiplier falls in the middle of the calibration range; 2 The current optimal Lagrangian multiplier falls within the minimum value of the calibration range; 3The current optimal Lagrangian multiplier falls within the maximum value of the calibration range; for the above situation 1, we set the range of the next iteration In the vicinity of the current optimal Lagrangian multiplier, in order to improve the search efficiency; for the above cases 2 and 3, we believe that the optimal Lagrangian multiplier may fall outside the calibration range, so the search range needs to be expanded. The accuracy of the obtained optimal Lagrangian multiplier;
  • formula (7) can be used to calculate the new scale factor for coding test.
  • the calibration range of the Lagrange multiplier is gradually reduced, and correspondingly, the scale factor interval is shortened.
  • the implementation process of the present invention is to iterate according to the test process of steps S1 to S5 until the scale factor interval is less than one thousandth. At this time, the set of Lagrangian multipliers corresponding to the optimal Lagrangian shift ratio is obtained, as shown in formula (12):
  • the above embodiment introduces the fixed point of the Lagrangian multiplier in the AI test scenario.
  • different application scenarios usually use different coding structure configurations, such as video conferencing and instant messaging scenarios often use low-latency coding structures, and Random access structure is often used for storage.
  • Different encoding structures will use different encoding frame types. Due to different encoding technologies, the relationship between their corresponding image distortion and encoding bit rate is also different. Therefore, in the process of practical application, the optimal Lagrangian multiplier needs to be fixed according to different structures such as frame type and frame interval.
  • Table 2 shows the coding performance test situation of the present invention under the random access configuration.
  • the test uses the open source commercial encoder x265v2.3 version.
  • the test videos are all 4K sources.
  • the test is performed according to the 4 QP points configured by the fixed-point method and the obtained optimal scale factor.
  • the performance evaluation uses BD-Rate as the evaluation index. It can be found that the optimal Lagrangian multiplier benchmark obtained by the present invention can obtain performance improvements of 6.31%, 14.41%, and 14.86% on the three YUV channels, respectively, and the compression performance is improved significantly.
  • Table 2 Best benchmark Lagrangian multiplier performance test table
  • the use of the optimal Lagrangian multiplier reference fixed-point method of the present invention can obtain accurate optimal Lagrangian multipliers, which is beneficial to improve video coding performance, and the fixed-point process is simple. Although a large number of iterative calculations are required, the realization The process is fully automated, and it can be completed without prior theoretical accumulation and rate-distortion optimization algorithm design experience.

Landscapes

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

Abstract

一种最优拉格朗日乘子基准定点标定方法,该方法通过在拉格朗日乘子变化范围内按照划分的比例因子搜索拉格朗日乘子,进行编码测试并采用BD-Rate评价测试结果,获取相对最优性能拉格朗日乘子,然后以此相对最优性能拉格朗日乘子的所处位置更新变化范围,再获得新的比例因子,如此迭代至满足阈值条件为止。该方法通过相对简单的编码测试流程,获得不同编码情景下最优的基准拉格朗日乘子,适用于各种编码情景下的最优的基准拉格朗日乘子的获取。

Description

最优拉格朗日乘子基准定点标定方法 技术领域
本发明涉及视频编码技术,具体涉及一种最优拉格朗日乘子基准定点标定方法。
背景技术
视频编码中率失真优化技术的引入带来了性能的大幅提升,自H.264以后,已经被广泛地应用于各主流编码器中。作为最核心的编码优化技术,率失真优化的好坏直接决定了编码器的性能和效率。率失真优化公式写作为公式(1):
min(D)s.t.R≤R T    (1)
其中,D为图像失真,常用差值平方和(SSE)与绝对误差和(SAD)表示。R为实际编码产生的比特率,R T为编码的目标比特率。
2002年T.W引入了拉格朗日方法后,将公式(1)所示的有约束问题改造成为求解最小编码代价的无约束问题,如公式(2)所示:
min{J=D+λ·R}      (2)
其中,J为编码代价,λ为拉格朗日乘子。
具体到视频编码的率失真优化实施过程中,每一个视频的图像块都将对块划分结构、运动搜索、量化参数及残差变换做大量尝试。每一种组合都将产生对应的比特消耗以及图像失真信息,将这些模式组合的结果代入至公式(2)中,选取出代价J最小的模式组合作为最终的编码模式。由于拉格朗日乘子的选取决定了视频质量与产生比特流大小的平衡,因此,拉格朗日乘子的计算就显得十分重要。
一般性认为,视频编码的失真D与比特率R是单调函数关系。通常采
用公式(3)来描述两者的关系:
D(R)=C·e -K·R   (3)
其中,C和K为模型参数。
根据拉格朗日优化理论,λ的取值是由代价函数一阶微分置为零计算得到,如公式(4)所示:
Figure PCTCN2019082845-appb-000001
在高比特假设下,视频编码的量化失真仅与量化步长q step相关,具体如公式(5)所示:
Figure PCTCN2019082845-appb-000002
其中,q step即为量化步长,由量化参数(QP)唯一确定。
将公式(5)代入公式(4),得到λ的计算公式,如公式(6)所示:
Figure PCTCN2019082845-appb-000003
其中,c为常数,一般取值为0.85。
但随着编码器的发展,视频编码的失真D与比特率R的函数关系发生一定程度的变化,直接沿用公式(5)导出拉格朗日乘子必然不能获得最佳编码性能。因此目前主流的编码标准都会有针对性地研发率失真优化算法。HEVC/H.265的参考软件(HM)不直接使用公式(6)导出的拉格朗日乘子进行编码,而是会根据视频帧类型对拉格朗日乘子进行一定程度的偏移。我国具备自主知识产权的第二代信源编码标准AVS2对应的参考软件(RD)编码使用的拉格朗日乘子,在使用公式(6)计算得到基准拉格朗日乘子后,会针对视频帧类型及参考关系制定拉格朗日乘子修正策略。
这些率失真优化算法带来了较大的编码效率提升。但是,研究与开发率失真优化算法需要大量的前期理论积累以及算法设计经验,才能获得编码效率的稳定提升。
发明内容
本发明所要解决的技术问题是:提供一种最优拉格朗日乘子基准定点标定方法,通过相对简单的编码测试流程,获得不同编码情景下最优的基准拉格朗日乘子。
本发明解决上述技术问题采用的技术方案是:
S1.针对视频序列所采用的编码标准中的各个QP配置,选取初始拉格朗日乘子λ c(QP i),其中,QP i为所述编码标准的第i个标准QP配置,设置λ c(QP i)的标定范围,并将标定范围划分为n个分段,导出n+1个比例因子,获得QP i配置下的n+1个测点;
S2.根据λ c(QP i)和比例因子,计算各QP配置下各个测点在编码时所使用的拉格朗日乘子,在各个测点分别进行编码测试,获得包括各QP配置下各个测点的编码测试结果的集合;
S3.以BD-Rate作为评价指标,计算编码测试结果的集合中的相对最优性能组;
S4.根据相对最优性能组中的编码测试结果在编码时所使用的拉格朗日乘子在标定范围中的所处位置更新拉格朗日乘子的标定范围;
S5.判断更新后的拉格朗日乘子的标定范围是否满足阈值条件,若满足,则结束定点流程,否则返回步骤S2继续迭代。
对于初始拉格朗日乘子λ c(QP i)的值的选取,推荐采用公式(6)计算获 得λ c(QP i),因为尽管随着编码算法的发展,失真D与比特R的关系发生一定程度改变,但公式(6)计算得到的拉格朗日乘子值与最优拉格朗日乘子值较为接近,以该点为起点可以更快、更准确地找出最优基准拉格朗日乘子。
对于标定范围的设置,要保证标定范围不会使得搜索范围过大,增加迭代工作量,也不会使得搜索范围过小,导致标定不准确,本发明根据经验值将初始拉格朗日乘子的标定范围设为
Figure PCTCN2019082845-appb-000004
此外,也可以根据需求采用lambda数学模型来估算初始拉格朗日乘子的标定范围。
对于标定范围的划分方式,可以选择等比例划分或等长度划分或者使用服从一定分布的随机划分方式进行划分均可,考虑到简便性,推荐采用等长方式将标定范围划分为n段,导出n+1个比例因子,获得QP i配置下的n+1个测点,其中第j个测点的比例因子r i,j的计算方式为:
Figure PCTCN2019082845-appb-000005
其中,r min和r max分别为标定范围的下界与上界。
步骤S2中,QP i配置下第j个测点在编码时所使用的拉格朗日乘子的计算方式为:
λ i,j=r i,j·λ c(QP i)  (8)
在视频序列所采用的编码标准规定的所有y个标准QP配置下的各个测点分别进行编码测试,获得的包括各个测点的编码测试结果的集合为:
S={d j(QP i),rate j(QP i)|i=1,...y.j=0,...n}  (9)
其中,d j(QP i)表示在QP i配置下使用第j个比例因子偏移后的拉格朗日乘子编码得到的图像失真,rate j(QP i)表示在QP i配置下使用第j个比例因子偏移后的的拉格朗日乘子编码得到的比特率。这里y的取值取决于视频序 列所采用的编码标准。
步骤S3中,所述以BD-Rate作为评价指标,计算编码测试结果的集合中的相对最优性能组,具体包括:
将y个含有不同QP的测试结果称为一组,则集合中的编码测试结果共可以组成n y个组,任选其中一组作为锚点,所有可用的组作为测试点集,利用BD-Rate性能评价指标计算测试点集n y组结果中的最优性能组:
arg min{BD-Rate(anchor,test 1),...BD-Rate(anchor,test m)|m=n y}  (10)。
步骤S4中对于标定范围的更新思路是:考虑到本轮迭代的最优拉格朗日乘子在标定范围中的三种情况:①当前最优拉格朗日乘子落在标定范围的中间部分;②当前最优拉格朗日乘子落在标定范围的极小值;③当前最优拉格朗日乘子落在标定范围的极大值;对于上述情况①,我们将下一次迭代的范围设置在当前最优拉格朗日乘子的附近,以提高搜索效率;对于上述情况②和③,我们认为最优拉格朗日乘子可能落在了标定范围之外,因此需要扩大搜索范围,获取的最优拉格朗日乘子的准确性。
设本轮迭代的最优性能组中QP i对应的比例因子为r i,设置截取系数和扩展系数,
当r i处于标定范围内时,则选择r i所对应测点两侧分段的范围作为计算范围,由计算范围结合截取系数计算获得新的标定范围;
当r i处于标定范围两端时,选择r i所对应测点一侧分段的范围结合通过r i和扩展系数计算的扩展范围形成计算范围,再由计算范围结合截取系数计算获得新的标定范围。
上述截取系数的设置是为了控制新标定范围的大小,扩展系数的设置 是为了当前最优比例因子出现在边缘时扩展搜索范围,避免出现局部最优的情况。
具体而言,设N ratio是比例因子的个数,截取系数为1,α与β分别为两端的扩展系数,并满足0<α<1和β>1,
则,拉格朗日乘子的标定范围更新为:
Figure PCTCN2019082845-appb-000006
其中,r i-1和r i+1分别为r i的前一个和后一个比例因子。
步骤S5中对更新后的拉格朗日乘子的标定范围的判断转化为对新的标定范围划分得到的的比例因子之间的间隔度量,因为随着搜索的进行,拉格朗日乘子标定范围也逐渐减小,与之对应的,比例因子间隔也缩短,当拉格朗日乘子的偏移比例(比例因子间隔)小到一定程度时,其对编码的影响可以忽略不计,此时就可以认定为获得了最优的拉格朗日乘子的比例因子。因此,步骤S5包括:
S5A.根据更新后的拉格朗日乘子的标定范围和步骤S1的划分方式对标定范围进行划分,计算新的比例因子;
S5B.判断新的比例因子的间隔是否满足阈值条件,若满足,则结束定点流程,否则返回步骤S2继续迭代。
具体的,步骤S5B中,所述判断新的比例因子的间隔是否满足阈值条件,具体包括:若新的比例因子的间隔小于千分之一,则判定满足阈值条件。
本发明的有益效果是:通过在拉格朗日乘子标定范围内按照划分的比 例因子搜索拉格朗日乘子,进行编码测试并采用BD-Rate评价测试结果,获取相对最优性能拉格朗日乘子,然后以此相对最优性能拉格朗日乘子的所处位置更新标定范围,再获得新的比例因子,如此迭代至满足阈值条件为止,虽然需要大量迭代计算,但其实现流程简单,全程自动化,不需要前期理论积累和率失真优化算法设计经验,不需要人为干预即可获得准确的最优基准拉格朗日乘子。
附图说明
图1为本发明实施例中的最优拉格朗日乘子基准定点标定方法流程图。
具体实施方式
本发明旨在提供一种最优拉格朗日乘子基准定点标定方法,通过相对简单的编码测试流程,获得不同编码情景下最优的基准拉格朗日乘子。其核心思想是:通过在拉格朗日乘子标定范围内按照划分的比例因子搜索拉格朗日乘子,进行编码测试并采用BD-Rate评价测试结果,获取相对最优性能拉格朗日乘子,然后以此相对最优性能拉格朗日乘子的所处位置更新标定范围,再获得新的比例因子,如此迭代至满足阈值条件为止。
实施例:
以一个视频序列在四个标准QP配置下进行全帧内编码(All Intra,AI)模式为例,阐述本发明中的基准拉格朗日乘子定点标定方法,其包括以下实施步骤:
S1.选取初始拉格朗日乘子,设置初始拉格朗日乘子的标定范围,对标定范围进行划分,获得比例因子和对应的测点;
首先选取一个基准λ c(QP i)作为起始点,QP i为第i个标准QP配置。尽管随着编码算法的发展,失真D与比特R的关系发生一定程度改变,但公式(6)计算得到的拉格朗日乘子值与最优拉格朗日乘子值较为接近,以该点为起点可以更快、更准确地找出最优基准拉格朗日乘子。因此本发明推荐使用公式(6)导出初始拉格朗日乘子。
在导出初始拉格朗日乘子后,设置搜索拉格朗日乘子的标定范围。需要注意的是,本发明所述的定点法应遵循“先粗后细”的搜索规则,定点开始时选用相对较大的搜索范围,随着搜索的进行,不断提升搜索精度,最后获得性能最优的基准拉格朗日乘子。在本发明中,根据经验值将初始拉格朗日乘子的标定范围设为
Figure PCTCN2019082845-appb-000007
此外也可以根据需求采用lambda数学模型来估算初始拉格朗日乘子的标定范围。
得到标定范围后,将范围等长划分为n段(也可以按照等比例或者使用服从一定分布的随机划分方式进行划分),可以导出n+1个比例因子,则可获得每个QP配置下的与n+1个比例因子一一对应的n+1个测点,即,每一个测点使用一个比例因子在初始拉格朗日乘子的基础上进行偏移,QP i配置下的第j个测点的比例因子r i,j的定义如公式(7)所示:
Figure PCTCN2019082845-appb-000008
其中,r min和r max分别为标定范围的下界与上界。
S2.根据初始拉格朗日乘子和比例因子,计算测点在编码时所使用的拉格朗日乘子,在各个测点分别进行编码测试,获得包括各个测点的编码测试结果的集合;
QP i配置下的第j个测点在编码时所使用的拉格朗日乘子可以由初始点λ c(QP i)和比例因子r i,j导出,具体如公式(8)所示:
λ i,j=r i,j·λ c(QP i)   (8)
其中,λ c(QP i)为QP i对应的初始拉格朗日乘子,r i,j为QP i配置下第j个测点的比例因子。
以步骤S1中将标定范围划分为8段获得9个比例因子为例,对4个QP 配置、9个比例因子进行遍历编码,编码得到的结果集合如公式(9)所示:
S={d j(QP i),rate j(QP i)|i=1,...4.j=0,...9}  (9)
其中,d j(QP i)表示在QP i配置下使用第j个比例因子偏移后的拉格朗日乘子编码得到的图像失真,rate j(QP i)表示在QP i配置下使用第j个比例因子偏移后的的拉格朗日乘子编码得到的比特率。
S3.以BD-Rate作为评价指标,计算编码测试结果的集合中的相对最优性能组;
在得到所有编码结果后,需找出性能最佳的比例因子。BD-Rate是常用的编码器性能评价指标,其表示在相同PSNR(峰值性噪比)下,比特率的增加情况。因此,BD-Rate为负值时表明编码器性能得到提升。
将4个含有不同QP的测试结果称为一组。在本例中,4个QP配置和9个比例因子得到的编码结果共可以组成9 4个组。获得编码结果集合后,任选其中一组作为锚点(anchor),所有可用的组作为测试点集(Test Set),利用BD-Rate性能评价指标计算测试点集9 4组结果中的最优性能组,如公式(10)所示:
argmin{BD-Rate(anchor,test 1),...BD-Rate(anchor,test m)|m=9 4}  (10)
需要注意的是,锚点也处于测试点集中,满足BD-Rate(anchor,anchor)=0。计算得到当前迭代的最小BD-Rate组为{d u(QP 1),rate u(QP 1),d v(QP 2),rate v(QP 2),d w(QP 3),rate w(QP 3),d x(QP 4),rate x(QP 4)},其中u,v,w,x=0,1,……9。
S4.根据相对最优性能组中的编码测试结果在编码时所使用的拉格朗日乘子在标定范围中的所处位置更新拉格朗日乘子的标定范围;
得到本次迭代的相对最优性能组后,需根据最优性能组收缩拉格朗日乘子标定范围。以QP 1为例,设本轮迭代的最优性能组中QP 1对应的比例因子为r i,则新的拉格朗日乘子的标定范围如公式(11)所示:
Figure PCTCN2019082845-appb-000009
其中,N ratio是比例因子的个数,此处N ratio=9;α与β为常数,满足0<α<1和β>1。
根据公式(11),本发明考虑了本轮迭代的最优拉格朗日乘子在标定范围中的三种情况:①当前最优拉格朗日乘子落在标定范围的中间部分;②当前最优拉格朗日乘子落在标定范围的极小值;③当前最优拉格朗日乘子落在标定范围的极大值;对于上述情况①,我们将下一次迭代的范围设置在当前最优拉格朗日乘子的附近,以提高搜索效率;对于上述情况②和③,我们认为最优拉格朗日乘子可能落在了标定范围之外,因此需要扩大搜索范围,获取的最优拉格朗日乘子的准确性;
α与β就是用于当最优比例因子出现在边缘时扩展搜索范围而设置的常数,取值首先要满足0<α<1和β>1。其次要保证α和β的选择能够让后续新的比例因子之间保持足够的“间隙”,不要过大也不要过小。根据经验,建议的配置为α=0.5,β=2。
S5.根据更新后的拉格朗日乘子的标定范围计算新的比例因子;
在获取新的拉格朗日乘子的标定范围后,利用公式(7)可计算得到新的比例因子进行编码测试。
S6.判断新的比例因子的间隔是否满足阈值条件,若满足,则结束定点流程,获得各个QP配置下的最优拉格朗日乘子,否则返回步骤S2继续迭代。
随着搜索的进行,拉格朗日乘子标定范围也逐渐减小,与之对应的,比例因子间隔缩短。实验表明,当拉格朗日乘子偏移的比例小于千分之一时,对编码结果几乎没有影响。因此,当比例因子之间间隔小于千分之一时,定点结束,获取到各个QP配置下的最优拉格朗日乘子(最优拉格朗日乘子=初始拉格朗日乘子*最优比例因子);
即本发明的实施流程是按照步骤S1至S5测试流程迭代至比例因子间隔小于千分之一。此时得到最优拉格朗日偏移比例对应的拉格朗日乘子的集合,如公式(12)所示:
Figure PCTCN2019082845-appb-000010
至此,得到了一个序列在AI测试情景下的最优基准拉格朗日乘子。
上述实施例介绍的是在AI测试场景下的拉格朗日乘子定点,由于不同的应用场景通常使用不同的编码结构配置,如视频会议和即时通信情景下常使用低延迟编码结构,而面向存储时常使用随机访问结构。不同的编码结构将使用不同的编码帧类型,这些帧类型由于编码技术的不同,它们对应的图像失真与编码比特率的关系也有着一定区别。因此,在实践应用过程中,需根据帧类型,帧间隔等不同结构进行最优拉格朗日乘子定点。
下面给出利用本发明提出的最优拉格朗日乘子基准定点方法对几个视频序列中的Intra类型帧、P7类型帧和b7类型帧进行迭代计算的结果,其最后获取的最优拉格朗日比例因子如表1所示:
表1:最优拉格朗日比例因子表
Figure PCTCN2019082845-appb-000011
表2给出了本发明在随机访问配置下的编码性能测试情况。测试使用开源的商用编码器x265v2.3版本,测试视频均为4K信源,按照定点法配置的4个QP点及得到的最优比例因子进行测试,性能评价以BD-Rate作为评价指标。可以发现,通过本发明得到的最优拉格朗日乘子基准在YUV三个通道上能够分别获得6.31%,14.41%,14.86%的性能提升,压缩性能提升显著。
表2:最优基准拉格朗日乘子性能测试表
Figure PCTCN2019082845-appb-000012
因此,采用本发明的最优拉格朗日乘子基准定点方法可以获取精确的最优拉格朗日乘子,有利于提高视频编码性能,而且定点流程简单,虽然需要大量迭代计算,但实现过程全程自动化,不需要前期理论积累和率失真优化算法设计经验就可以完成。

Claims (10)

  1. 最优拉格朗日乘子基准定点标定方法,其特征在于,包括以下步骤:
    S1.针对视频序列所采用的编码标准中的各个QP配置,选取初始拉格朗日乘子λ c(QP i),其中,QP i为所述编码标准的第i个标准QP配置,设置λ c(QP i)的标定范围,并将标定范围划分为n个分段,导出n+1个比例因子,获得QP i配置下的n+1个测点;
    S2.根据λ c(QP i)和比例因子,计算各QP配置下各个测点在编码时所使用的拉格朗日乘子,在各个测点分别进行编码测试,获得包括各QP配置下各个测点的编码测试结果的集合;
    S3.以BD-Rate作为评价指标,计算编码测试结果的集合中的相对最优性能组;
    S4.根据相对最优性能组中的编码测试结果在编码时所使用的拉格朗日乘子在标定范围中的所处位置更新拉格朗日乘子的标定范围;
    S5.判断更新后的拉格朗日乘子的标定范围是否满足阈值条件,若满足,则结束定点流程,否则返回步骤S2继续迭代。
  2. 如权利要求1所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S1中,按照等长方式将标定范围划分为n段,导出n+1个比例因子,获得QP i配置下的n+1个测点,其中第j个测点的比例因子r i,j的计算方式为:
    Figure PCTCN2019082845-appb-100001
    其中,r min和r max分别为标定范围的下界与上界。
  3. 如权利要求1所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S1中,所述标定范围设置为
    Figure PCTCN2019082845-appb-100002
  4. 如权利要求1所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    所述λ c(QP i)的值由公式
    Figure PCTCN2019082845-appb-100003
    导出,c为常数,q step为量化步长。
  5. 如权利要求1所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S2中,QP i配置下第j个测点在编码时所使用的拉格朗日乘子的计算方式为:
    λ i,j=r i,j·λ c(QP i)    (8)
    在视频序列所采用的编码标准规定的所有y个标准QP配置下的各个测点分别进行编码测试,获得的包括各个测点的编码测试结果的集合为:
    S={d j(QP i),rate j(QP i)i=1,…y.j=0,…n}    (9)
    其中,d j(QP i)表示在QP i配置下使用第j个比例因子偏移后的拉格朗日乘子编码得到的图像失真,rate j(QP i)表示在QP i配置下使用第j个比例因子偏移后的的拉格朗日乘子编码得到的比特率。
  6. 如权利要求5所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S3中,所述以BD-Rate作为评价指标,计算编码测试结果的集合 中的相对最优性能组,具体包括:
    将y个含有不同QP的测试结果称为一组,则集合中的编码测试结果共可以组成n y个组,
    任选其中一组作为锚点,所有可用的组作为测试点集,利用BD-Rate性能评价指标计算测试点集n y组结果中的最优性能组:
    argmin{BD-Rate(anchor,test 1),...BD-Rate(anchor,test m)|m=n y}    (10)。
  7. 如权利要求1任意一项所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S4中,所述根据相对最优性能组中的编码测试结果在编码时所使用的拉格朗日乘子在标定范围中的所处位置更新拉格朗日乘子的标定范围,具体包括:
    设本轮迭代的最优性能组中QP i对应的比例因子为r i,设置截取系数和扩展系数,
    当r i处于标定范围内时,则选择r i所对应测点两侧分段的范围作为计算范围,由计算范围结合截取系数计算获得新的标定范围;
    当r i处于标定范围两端时,选择r i所对应测点一侧分段的范围结合通过r i和扩展系数计算的扩展范围形成计算范围,再由计算范围结合截取系数计算获得新的标定范围。
  8. 如权利要求7所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S4中,设N ratio是比例因子的个数,截取系数为1,α与β分别为两端的扩展系数,并满足0<α<1和β>1,
    则,拉格朗日乘子的标定范围更新为:
    Figure PCTCN2019082845-appb-100004
    其中,r i-1和r i+1分别为r i的前一个和后一个比例因子。
  9. 如权利要求1所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    所述步骤S5包括:
    S5A.根据更新后的拉格朗日乘子的标定范围和步骤S1的划分方式对标定范围进行划分,计算新的比例因子;
    S5B.判断新的比例因子的间隔是否满足阈值条件,若满足,则结束定点流程,否则返回步骤S2继续迭代。
  10. 如权利要求1-9任意一项所述的最优拉格朗日乘子基准定点标定方法,其特征在于,
    步骤S5B中,所述判断新的比例因子的间隔是否满足阈值条件,具体包括:若新的比例因子的间隔小于千分之一,则判定满足阈值条件。
PCT/CN2019/082845 2019-03-12 2019-04-16 最优拉格朗日乘子基准定点标定方法 WO2020181612A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910184735.7 2019-03-12
CN201910184735.7A CN109889837B (zh) 2019-03-12 2019-03-12 最优拉格朗日乘子基准定点标定方法

Publications (1)

Publication Number Publication Date
WO2020181612A1 true WO2020181612A1 (zh) 2020-09-17

Family

ID=66931859

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/082845 WO2020181612A1 (zh) 2019-03-12 2019-04-16 最优拉格朗日乘子基准定点标定方法

Country Status (2)

Country Link
CN (1) CN109889837B (zh)
WO (1) WO2020181612A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116155906A (zh) * 2022-12-25 2023-05-23 浙江省新型互联网交换中心有限责任公司 算力网络中面向低时延任务的MapReduce混合编码方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113784130B (zh) * 2021-08-09 2024-05-07 西安交通大学 一种基于梯度模相似度离差最小化的比特分配方法
CN114915789B (zh) * 2022-04-13 2023-03-14 中南大学 一种帧间的拉格朗日乘子优化方法、系统、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1727370A1 (en) * 2005-05-25 2006-11-29 Thomson Licensing Rate-distortion based video coding mode selection foreseeing the esitmation of bit rate and distortion using a simplified transform on low activity prediction residuals
CN106534855A (zh) * 2016-11-04 2017-03-22 西安理工大学 一种面向satd的拉格朗日因子计算方法
CN107040782A (zh) * 2017-04-21 2017-08-11 上海电力学院 基于拉格朗日方法的视频编码全局率失真优化方法
CN108235025A (zh) * 2018-03-13 2018-06-29 电子科技大学 自适应帧间参考结构的拉格朗日乘子优化方法
CN108347611A (zh) * 2018-03-02 2018-07-31 电子科技大学 用于经纬图的编码块级拉格朗日乘子的优化方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2346031B1 (en) * 2009-11-26 2015-09-30 BlackBerry Limited Rate-distortion optimization for advanced audio coding
CN102625102B (zh) * 2011-12-22 2014-02-12 北京航空航天大学 一种面向h.264/svc mgs编码的率失真模式选择方法
CN102821280B (zh) * 2012-08-21 2015-05-06 深圳广晟信源技术有限公司 一种率失真优化方法
GB2506594B (en) * 2012-09-28 2016-08-17 Canon Kk Method and devices for encoding an image of pixels into a video bitstream and decoding the corresponding video bitstream
CN104301724B (zh) * 2014-10-17 2017-12-01 华为技术有限公司 视频处理方法、编码设备和解码设备
CN104349167B (zh) * 2014-11-17 2018-01-19 电子科技大学 一种视频编码率失真优化的调整方法
CN107846593B (zh) * 2016-09-21 2020-01-03 中国移动通信有限公司研究院 一种率失真优化方法及装置
JP6491628B2 (ja) * 2016-09-23 2019-03-27 日本電信電話株式会社 映像符号化方法、映像符号化装置及び映像符号化プログラム
US10469854B2 (en) * 2017-06-21 2019-11-05 Intel Corporation Content, psychovisual, region of interest, and persistence based adaptive quantization for video coding
CN107707918A (zh) * 2017-10-26 2018-02-16 北京佳讯飞鸿电气股份有限公司 基于hevc/h.265平均码率控制的优化算法
CN108012150B (zh) * 2017-12-14 2020-05-05 湖南兴天电子科技有限公司 视频帧间编码方法及装置
CN108737839B (zh) * 2018-04-11 2020-09-25 西安理工大学 一种面向帧内码率控制的拉格朗日因子计算方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1727370A1 (en) * 2005-05-25 2006-11-29 Thomson Licensing Rate-distortion based video coding mode selection foreseeing the esitmation of bit rate and distortion using a simplified transform on low activity prediction residuals
CN106534855A (zh) * 2016-11-04 2017-03-22 西安理工大学 一种面向satd的拉格朗日因子计算方法
CN107040782A (zh) * 2017-04-21 2017-08-11 上海电力学院 基于拉格朗日方法的视频编码全局率失真优化方法
CN108347611A (zh) * 2018-03-02 2018-07-31 电子科技大学 用于经纬图的编码块级拉格朗日乘子的优化方法
CN108235025A (zh) * 2018-03-13 2018-06-29 电子科技大学 自适应帧间参考结构的拉格朗日乘子优化方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116155906A (zh) * 2022-12-25 2023-05-23 浙江省新型互联网交换中心有限责任公司 算力网络中面向低时延任务的MapReduce混合编码方法
CN116155906B (zh) * 2022-12-25 2024-03-12 浙江省新型互联网交换中心有限责任公司 算力网络中面向低时延任务的MapReduce混合编码方法

Also Published As

Publication number Publication date
CN109889837A (zh) 2019-06-14
CN109889837B (zh) 2022-05-27

Similar Documents

Publication Publication Date Title
WO2020181612A1 (zh) 最优拉格朗日乘子基准定点标定方法
US20220254057A1 (en) Point cloud attribute prediction method and device based on filter
CN103826121B (zh) 低延迟视频编码基于场景切换检测的码率控制方法
CN100574427C (zh) 视频编码比特率的控制方法
CN108134939B (zh) 一种运动估计方法及装置
CN107846593B (zh) 一种率失真优化方法及装置
CN101262603B (zh) 一种自适应码率控制方法
WO2021196682A1 (zh) 一种基于失真类型传播分析的时域率失真优化方法
CN104796705A (zh) 一种基于ssim的hevc视频编码率失真优化与码率控制算法
CN103957410A (zh) 一种基于残差频域复杂度的i帧码率控制方法
CN105993175A (zh) 用于具有增强动态范围的信号的分段层间预测
WO2024082579A1 (zh) 一种考虑时域失真传播的零时延全景视频码率控制方法
WO2021098030A1 (zh) 一种视频编码的方法和装置
CN101331773B (zh) 使用速率失真特性进行速率受控视频编码的装置和方法
CN103945222A (zh) 一种基于hevc视频编码标准的码率控制模型更新方法
CN104754335B (zh) 一种视频编码码率控制方法
WO2024082580A1 (zh) 一种考虑时域失真传播的低复杂度全景视频编码方法
JP2007243337A (ja) 動画像符号化方法及び動画像符号化装置とプログラムならびに媒体
CN108012149A (zh) 一种视频编码中码率控制的方法
WO2022194103A1 (zh) 解码方法、编码方法、装置、设备及存储介质
CN105263026A (zh) 基于概率统计与图像梯度信息的全局矢量获取方法
CN115996293B (zh) 一种视频图像编码的方法、系统、设备和存储介质
WO2019141007A1 (zh) 图像编码中的预测方向选取方法、装置和存储介质
CN113992911A (zh) 全景视频h264编码的帧内预测模式确定方法和设备
JP2001526850A (ja) 画像符号化器における量子化値の最適化方法及び装置

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: 19919089

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: 19919089

Country of ref document: EP

Kind code of ref document: A1