«上一篇 下一篇»
  计算机工程  2022, Vol. 48 Issue (3): 296-301  DOI: 10.19678/j.issn.1000-3428.0060717
0

引用本文  

王佳波, 杨静. H.266/VVC中一种改进的仿射运动估计算法[J]. 计算机工程, 2022, 48(3), 296-301. DOI: 10.19678/j.issn.1000-3428.0060717.
WANG Jiabo, YANG Jing. An Improved Affine Motion Estimation Algorithm in H.266/VVC[J]. Computer Engineering, 2022, 48(3), 296-301. DOI: 10.19678/j.issn.1000-3428.0060717.

基金项目

国家自然科学基金(61902239)

作者简介

王佳波(1996—),男,硕士研究生,主研方向为图像通信、视频压缩编码;
杨静,副教授、博士

文章历史

收稿日期:2021-01-27
修回日期:2021-03-19
H.266/VVC中一种改进的仿射运动估计算法
王佳波 , 杨静     
上海海事大学 信息与工程学院, 上海 201306
摘要:通用视频编码标准H.266/VVC通过引入多种新的编码技术,如仿射运动补偿预测、自适应运动矢量精度、多核变换等,以支持360°视频和HDR视频的编解码,从而为用户提供最优的视频质量,但是在H.266/VVC帧间预测过程中,仿射运动估计计算复杂度高导致编码时间显著增加。针对该问题,提出一种改进的仿射运动估计算法。通过对仿射高级矢量预测(AAMVP)候选列表的构建过程进行改进,并构建一种AAMVP候选列表候选项筛选准则,使得列表的候选项更接近编码块真实的运动矢量,从而缩短编码时间。同时对仿射运动估计中迭代搜索最优仿射运动矢量的迭代过程进行优化,以加快迭代搜索速度。实验结果表明,在低时延的编码器配置下,相比VVC原始算法,当BD-BR增加了0.023%时,该算法的总体编码时间平均缩短13%,在保证编码质量的前提下能够有效降低编码的计算复杂度。
关键词H.266/VVC标准    帧间预测    仿射运动估计    仿射高级运动矢量预测    
An Improved Affine Motion Estimation Algorithm in H.266/VVC
WANG Jiabo , YANG Jing     
College of Information Engineering, Shanghai Maritime University, Shanghai 201306, China
Abstract: The universal video coding standard H.266/VVC introduces a variety of new coding technologies, such as affine motion compensation prediction and adaptive coding motion vector accuracy, multi-core transformation.It supports the encoding and decoding of 360° video and HDR video, providing users with the best video quality.During the interframe prediction of the H.266/VVC, the high computational complexity of affine motion estimation significantly increases the coding time.An improved affine motion estimation algorithm is developed in this study to solve this problem.The construction process of the Affine Advanced Motion Vector Prediction (AAMVP) candidate list is improved, and a selection criterion for the AAMVP candidate list is constructed.The list candidates are closer to the real motion vector of the coding block, shortening the coding time.The process of iteratively searching for the optimal affine motion vector for affine motion estimation is optimized to accelerate the iterative search.The experimental results show that when the BD-BR increases by 0.023% under low-latency encoder configuration compared with the original versatile video coding algorithm, the overall encoding time of the algorithm decreases by an average of 13%.The proposed algorithm can effectively reduce the computational complexity of encoding while ensuring encoding quality.
Key words: H.266/VVC standard    inter-frame prediction    affine motion estimation    Affine Advanced Motion Vector Prediction(AAMVP)    

开放科学(资源服务)标志码(OSID):

0 概述

2020年7月1日,国际电信联盟视频编码专家组(ITU-T VCEG)和国际标准化组织活动图像编码专家组(ISO/IEC MPEG)联合制定了新一代视频编码标准H.266/VVC。直到标准测试模型VTM-10.0后,通用视频编码(Versatile Video Coding,VVC)性能基本稳定,在相同的峰值信噪比条件下相比HEVC的高清视频和超高清视频,VCC标准平均码率节省了约40%[1]

在帧间预测过程中,H.265/HEVC采用平移运动模型对物体的运动进行描述,即用一个运动矢量表示物体的运动,但该模型不能准确地描述物体的复杂运动,例如旋转、缩放和裁剪等[2-3]。在H.266/VVC的帧间预测过程中采用了仿射运动模型,它可以更精确地表示物体复杂运动的类型[4]。以往的相关研究尝试将仿射运动模型嵌入到运动补偿帧中,但是该方法在VVC之前一直未被采纳,其原因是所提的仿射运动估计方法增加了视频编码过程的复杂度,而且在大多数应用场景中该复杂度是不能忽略的[5-6]

文献[7]基于H.266/VVC提出2种降低仿射运动估计复杂度的方法,通过检查当前块父块的最佳帧间预测模式是否为Skip模式,如果是Skip模式,则当前块直接跳过整个仿射运动估计过程;对当前块的传统运动估计的最佳预测方向进行检查,基于检查结果决策是否缩减仿射运动估计参考帧序列的大小。文献[8]基于H.266/VVC的JEM测试模型提出一种仿射运动估计架构,该架构使得编码器自适应地选择四参数或者六参数仿射模型。文献[9]基于HEVC提出一种迭代搜索最优仿射运动矢量的仿射运动估计算法和一种仿射高级矢量预测(AAMVP)候选列表的构建方法,其中迭代搜索最优仿射运动矢量的仿射运动估计算法在VVC标准中已经被采纳。

相比H.265/HEVC,H.266/VVC视频编码标准的适应场景更广泛,H.265/HEVC中的仿射运动估计算法难以满足H.266/VVC对编码复杂度的要求,因此,本文提出一种改进的仿射运动估计算法。通过优化VVC中AAMVP候选列表的构建方法,使得选择出的候选运动矢量更精确,同时对VVC中迭代搜索最优仿射运动矢量的方法进行优化,缩短迭代搜索所需的时间。

1 VVC中的仿射运动估计

在H.266/VVC的帧间预测中采用与H.265/HEVC平移运动估计相类似的方式来实现仿射运动估计。H.266/VVC中编码器首先通过AAMVP技术为当前编码块构建一个仿射运动估计起始运动矢量组合的候选列表;然后在该列表中选择一个最优的候选运动矢量组合,编码器将该组合作为仿射运动估计的起始点,通过迭代搜索确定当前编码块真实的运动矢量组合[10-13]

1.1 仿射运动模型

在H.266/VVC的仿射运动估计中,有2种仿射运动模型,分别为四参数仿射运动模型和六参数仿射运动模型。四参数仿射运动模型使用2个控制点的运动矢量组合来描述当前编码块的运动类型,如图 1所示。六参数仿射运动模型用3个控制点的运动矢量来描述当前编码块的运动类型,相比于四参数仿射模型能更精确地表示仿射运动。

Download:
图 1 四参数仿射运动模型 Fig. 1 4-parameter affine motion model

当前图像中的编码块具有2个控制点,这2个控制点的运动矢量为$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{} $$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{} $,则当前编码块中任意点$ (x, y) $的运动矢量如式(1)所示:

$ \left\{\begin{array}{l}{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}}^{h}(x, y)=\frac{({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}-({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h})}{\omega -1}x-\\ \frac{({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v})}{\omega -1}y+{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h}\\ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}}^{v}(x, y)=\frac{({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v}-({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v})}{\omega -1}x+\\ \frac{({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h})}{\omega -1}y+{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v}\end{array}\right. $ (1)

其中:$ \omega $为当前编码块的宽度;$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h} $$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v} $$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h} $$ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v} $分别为控制点0和控制点1运动矢量的水平和垂直分量。式(1)也可以改写成矩阵形式,如式(2)~式(4)所示:

$ {\mathit{\boldsymbol{m}}}_{\rm{m}\rm{v}}(x, y)=A(x, y)\times {\mathit{\boldsymbol{M}}}_{\rm{M}\rm{V}\left(\mathit{\boldsymbol{A}}\right)}^{\rm{T}} $ (2)
$ A(x, y)=\left[\begin{array}{cccc}\left(1-\frac{x}{\omega -1}\right)& \frac{x}{\omega -1}& \frac{y}{\omega -1}& -\frac{y}{\omega -1}\\ -\frac{y}{\omega -1}& \frac{y}{\omega -1}& \frac{y}{\omega -1}& \frac{x}{\omega -1}\end{array}\right] $ (3)
$ {\mathit{\boldsymbol{M}}}_{\mathit{\boldsymbol{A}}}^{\rm{M}\rm{V}}=\left[\begin{array}{cccc}{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h}& {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}& {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v}& {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v}\end{array}\right] $ (4)

六参数仿射运动模型当前编码块的运动矢量的推导方式与四参数仿射运动模型的推导方式相类似。

1.2 AAMVP技术

AAMVP技术在H.266/VVC中被用于构建仿射迭代搜索过程中起始向量组合候选列表,同时编码器会选择一个最优的候选向量组合作为迭代搜索的起始位置[14-16]

在H.266/VVC中AAMVP候选列表的长度被限定为2。首先编码器按照特定的顺序对当前编码块的相邻已编码块是否使用仿射运动估计进行检查,如果相邻已编码块使用了仿射运动估计,则直接复用相邻已编码块的仿射运动信息。如果编码器对上一步所有相邻已编码块检查完成后,AAMVP候选列表未被填满,则分别检查当前编码块的3个角落相邻块中第1个可用的已编码块的平移运动矢量,若3个角落相邻块至少存在1个可用的平移运动矢量,则将它们直接构造组成运动矢量组合,并作为AAMVP的候选项。经过上述步骤,如果候选列表仍未被填满,则编码器直接用当前编码块3个角落的相邻已编码块,对第1个可用的已编码块的平移运动矢量进行重复扩充为运动矢量组合,作为AAMVP候选列表的候选项。然后,若AAMVP候选列表未被填满,编码器检查当前编码块的相邻编码块的时域候选是否存在,若存在,直接作为AAMVP列表的候选项。最后,若候选列表仍未被填满,编码器直接使用零向量对AAMVP候选列表进行填充。图 2所示为AAMVP候选列表中候选来自于当前编码块的相邻已编码块的位置信息[17-19]

Download:
图 2 仿射AAMVP候选列表的构建 Fig. 2 Construction of affine AAMVP candidate list
1.3 迭代搜索仿射运动矢量

在H.266/VVC中,编码器从AAMVP候选列表中选出一个最优的候选项,将该最优候选项作为起始点,通过迭代搜索得到当前编码块真实的仿射运动矢量。

在迭代搜索过程中,编码器采用最小均方误差作为匹配准则,如式(5)所示:

$ {M}_{\mathrm{M}\mathrm{S}\mathrm{E}}=\frac{1}{\omega \times h}{\sum\limits _{(x, y)\in \mathrm{当}\mathrm{前}\mathrm{块}}\left|{P}_{\mathrm{o}\mathrm{r}\mathrm{i}}^{\mathrm{p}\mathrm{i}\mathrm{c}}(x, y)-{P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{p}\mathrm{i}\mathrm{c}}\left(\right(x, y)+{\mathit{\boldsymbol{m}}}_{\rm{m}\rm{v}}(x, y\left)\right)\right|}^{2} $ (5)

其中:ωh分别为当前编码块的宽度和高度;$ {P}_{\mathrm{o}\mathrm{r}\mathrm{i}}^{\mathrm{p}\mathrm{i}\mathrm{c}} $为当前编码块所在的图像;$ {P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{p}\mathrm{i}\mathrm{c}} $为当前编码块的参考图像。

定义第$ i $次迭代过程的运动矢量变化为$ {\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i} $,则第$ i $次迭代时的运动矢量如式(6)所示:

$ \begin{array}{l}{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}(x, y)}^{i}=A(x, y)\left(\right({\mathit{\boldsymbol{m}}}_{\rm{m}\rm{v}}^{\mathit{\boldsymbol{i}}-1}{)}^{\mathrm{T}}+\left({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}}\right)=\\ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}(x, y)}^{i}+A(x, y)({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}}\end{array} $ (6)

其中:$ (x, y) $为当前编码块的位置;$ {\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i} $为一个行矩阵。$ {\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i} $的转置矩阵如式(7)所示:

$ ({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}}=\left[\begin{array}{c}{\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}\left(0\right)}^{h}\\ {\mathit{\boldsymbol{d}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}\\ {\mathit{\boldsymbol{d}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v}\\ {\mathit{\boldsymbol{d}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v}\end{array}\right]=\left[\begin{array}{c}{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{ih}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{(i-1)h}\\ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{ih}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{(i-1)h}\\ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{iv}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{(i-1)v}\\ {\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{iv}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{(i-1)v}\end{array}\right] $ (7)

经过$ i $次迭代后,参考点的像素值如式(8)所示:

$ \begin{array}{l}{P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{p}\mathrm{i}\mathrm{c}}\left(\right(x, y)+{\mathit{\boldsymbol{m}}}_{\rm{m}\rm{v}({x}, {y})})=\\ {P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{P}\mathrm{i}\mathrm{c}}\left(\right({x}^{i-1}, {y}^{i-1})+A(x, y\left)\right({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}})\end{array} $ (8)

其中:$ ({x}^{i-1}, {y}^{i-1}) $为上一次迭代搜索时匹配块的位置。对式(8)进行泰勒展开,并忽略高阶项得到式(9):

$ \begin{array}{l}{P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{P}\mathrm{i}\mathrm{c}}\left(\right({x}^{i-1}, {y}^{i-1})+A(x, y\left)\right({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}})\approx \\ {P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{P}\mathrm{i}\mathrm{c}}({x}^{i-1}, {y}^{i-1})+{P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{P}\mathrm{i}\mathrm{c}\text{'}}({x}^{i-1}, {y}^{i-1})A(x, y)({\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i}{)}^{\mathrm{T}}\end{array} $ (9)

在迭代搜索过程中参考点的像素值$ {P}_{\mathrm{r}\mathrm{e}\mathrm{f}}^{\mathrm{P}\mathrm{i}\mathrm{c}}(x, y) $尽可能接近原始像素值$ {P}_{\mathrm{o}\mathrm{r}\mathrm{i}}^{\mathrm{P}\mathrm{i}\mathrm{c}}(x, y) $,使得$ {M}_{\mathrm{M}\mathrm{S}\mathrm{E}} $的值最小。将$ {{\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}}^{i} $的相对梯度设置为0,使得参考像素值最接近原始像素值,得到$ {M}_{\mathrm{M}\mathrm{S}\mathrm{E}} $的最小值。

在H.266/VVC的测试模型VTM10.0中,采用$ \mathrm{S}\mathrm{o}\mathrm{b}\mathrm{e}\mathrm{l} $算子对像素矩阵进行卷积,求解$ {{\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}}^{i} $的相对梯度,如式(10)所示:

$ \left\{\begin{array}{l}{g}_{x}^{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}}=\left[\begin{array}{ccc}-1& 0& 1\\ -2& 0& 2\\ -1& 0& 1\end{array}\right]\times \left[\begin{array}{ccc}{P}_{x-1, y-1}& {P}_{x-1, y}& {P}_{x-1, y+1}\\ {P}_{x, y-1}& {P}_{x, y}& {P}_{x, y+1}\\ {P}_{x+1, y-1}& {P}_{x+1, y}& {P}_{x+1, y+1}\end{array}\right]\\ {g}_{y}^{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}}=\left[\begin{array}{ccc}-1& -2& -1\\ 0& 0& 0\\ 1& 2& 1\end{array}\right]\times \left[\begin{array}{ccc}{P}_{x-1, y-1}& {P}_{x-1, y}& {P}_{x-1, y+1}\\ {P}_{x, y-1}& {P}_{x, y}& {P}_{x, y+1}\\ {P}_{x+1, y-1}& {P}_{x+1, y}& {P}_{x+1, y+1}\end{array}\right]\end{array}\right. $ (10)

当迭代过程中$ {\mathit{\boldsymbol{d}}}_{\mathrm{d}\mathrm{m}\mathrm{v}}^{i} $的值为0时,则停止迭代,最后一次更新的运动矢量,即为当前编码块真实的仿射运动矢量。

2 本文算法 2.1 AAMVP优化

文献[9]基于H.265/HEVC提出一种利用相邻已编码块的平移运动信息构造仿射AAMVP候选方法。图 2中编码器首先检查当前编码块的3个角落中所有相邻块的平移运动信息可用性,并不是像H.266/VVC中在获得第一个可用相邻已编码块的平移信息后就立即终止与同一个角落其他相邻已编码块可用性的检查。编码器在得到3个角落的所有相邻已编码块的可用平移运动信息之后,分别将3个角落所有相邻块的可用平移运动矢量组合成向量组,同时利用准则选择$ \mathrm{D}\mathrm{M}\mathrm{V} $最小和次小的向量进行组合,并作为AAMVP候选列表的两个候选项。$ \mathrm{D}\mathrm{M}\mathrm{V} $具体表达如式(11)所示:

$ {D}_{\mathrm{D}\mathrm{M}\mathrm{V}}=\left|{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h}-({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(2\right)}^{v}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v})\right|+\\ \left|{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(2\right)}^{h}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h}-({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v})\right| $ (11)

相比于H.266/VVC的AAMVP候选列表构建过程,优化的AAMVP是直接使用3个角落的相邻已编码块中第一个可用平移运动矢量,以构成AAMVP列表候选项,文献[9]基于$ \mathrm{D}\mathrm{M}\mathrm{V} $准则,利用所有相邻已编码块的平移运动矢量构造的AAMVP列表候选项更加精确,因此本文考虑把文献[9]的$ \mathrm{D}\mathrm{M}\mathrm{V} $准则引入到H.266/VVC中AAMPV候选列表的构建过程。对于仿射变换块,在小程度变形的情况下,当前块的宽度在水平方向的变化程度接近高度在垂直方向的变化程度,而高度在水平方向上的变化程度接近宽度在垂直方向的变化程度,因此,本文对$ \mathrm{D}\mathrm{M}\mathrm{V} $准则进行改进,提出本文算法中的$ {D}_{\mathrm{D}\mathrm{M}\mathrm{V}}^{\mathrm{\text{'}}} $准则,如式(12)所示:

$ {D}_{\mathrm{D}\mathrm{M}\mathrm{V}}^{\mathrm{{'}}}=\\ \left|(h-1)({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{h}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h})-(\omega -1)({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(2\right)}^{v}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{v})\right|+\\ \left|(h-1)({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(2\right)}^{h}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{h})-(\omega -1)({\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(0\right)}^{c}-{\mathit{\boldsymbol{m}}}_{\mathrm{m}\mathrm{v}\left(1\right)}^{v})\right| $ (12)

本文将$ \mathrm{D}\mathrm{M}{\mathrm{V}}^{\text{'}} $准则引入到H.266/VVC的AAMVP候选列表构建过程中,得到更加精确的AAMVP列表候选项,使得列表的候选项更接近编码块真实的仿射运动矢量,从而减少后续编码器根据AAMVP列表最优候选项迭代搜索真实仿射运动矢量时所需的迭代次数,达到缩短编码时间的目的。具体算法主要有以下5个步骤。

步骤1    检查当前编码块左上角相邻块A- > C的平移运动矢量的可用性,并将可用的平移运动矢量添加到数组amvpInfo0中,利用变量ret0完成检查,确定amvpInfo0是否为空。

步骤2    检查当前编码块右上角相邻块D- > E的平移运动矢量的可用性,并将可用的平移运动矢量添加到数组amvpInfo1中,利用变量ret1完成检查,确定amvpInfo1是否为空。

步骤3    检查当前编码块左下角相邻块F- > G的平移运动矢量的可用性,并将可用的平移运动矢量添加到数组amvpInfo2中,利用变量ret2完成检查,确定amvpInf2是否为空。

步骤4    若根据ret0、ret1、ret2的检查结果判断3个数组amvpInfo0、amvpInfo1、amvpInfo2中任意一个为空,则结束仿射AAMVP候选的构造过程,否则利用循环遍历计算所有运动矢量组合的$ \mathrm{D}\mathrm{M}{\mathrm{V}}^{\text{'}} $值。

步骤5    将最小$ \mathrm{D}\mathrm{M}{\mathrm{V}}^{\text{'}} $值对应的运动矢量组合添加到AAMVP候选列表中。

AAMVP算法的流程如图 3所示。

Download:
图 3 AAMVP优化流程 Fig. 3 Optimization procedure of AAMVP
2.2 迭代搜索优化

编码器在H.266/VVC的仿射运动估计中进行迭代搜索,以寻找当前迭代位置周围像素梯度的最小失真方向,并更新最小失真对应的运动矢量,更新的运动矢量作为下一次迭代的初始运动矢量。当前运动矢量对应的率失真在每一次迭代时都会被更新,其反映了运动矢量汇聚到最优运动矢量的速度。为避免在迭代搜索过程中像素梯度极值处收敛太慢,本文所提的算法考虑在计算当前迭代位置的像素梯度时,增加一个动量参数以解决这个问题。当本次迭代的像素梯度在$ x $y方向上与上一次迭代的像素梯度方向相同时,动量参数能够加速迭代搜索过程,从而减少迭代搜索过程消耗的时间。相反,当本次迭代的梯度在xy方向上与上一次迭代的梯度方向差异较大时,动量参数能够减缓梯度的变化趋势,使得搜索过程更精确。该算法如式(13)所示:

$ \left\{\begin{array}{l}{g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(x\right)}^{i}={g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(x\right)}^{i}+{m}_{\mathrm{m}\mathrm{o}\mathrm{m}\mathrm{e}\mathrm{n}\mathrm{t}\mathrm{u}\mathrm{m}}\times {g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(x\right)}^{i-1}\\ {g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(y\right)}^{i}={g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(y\right)}^{i}+{m}_{\mathrm{m}\mathrm{o}\mathrm{m}\mathrm{e}\mathrm{n}\mathrm{t}\mathrm{u}\mathrm{m}}\times {g}_{\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{d}\left(\mathrm{y}\right)}^{i-1}\end{array}\right. $ (13)

考虑到包含复杂的仿射运动的视频序列,梯度下降过快会导致迭代搜索过程中梯度不平滑,最终得到的最优仿射运动矢量不够精确,从而造成重建后的视频序列质量损失较大。因此,选择六参数仿射运动的编码块的梯度下降速度相较于四参数仿射运动模型慢。对于快速仿射运动类型的编码块,在进行迭代搜索最优仿射运动矢量时能够达到相对减缓其梯度下降的目的,使搜索得到的最优仿射运动矢量更接近真实的仿射运动矢量,从而减少重建后视频序列的质量损失。当前编码块使用六参数仿射运动模型且为双向预测时,动量参数设置为0.1,其为单向预测时,动量参数设置为0.7;当前编码块使用四参数仿射运动模型且为双向预测时,动量参数设置为0.3,其为单向预测时动量参数设置为0.9;当前编码块不使用仿射运动估计时,动量参数设置为0。

3 实验仿真 3.1 仿真环境设置

本文的算法仿真实验以H.266/VVC原始参考模型VTM-10.0为平台,配置文件为encoder_lowdelay_vtm.cfg,量化参数为22、27、32和37,测试序列为官方推荐视频序列,测试范围为A~F类。实验平台的硬件配置为Inter® CoreTM i5-6500 CPU,主频为3.20 GHz,内存为8 GB,集成开发环境为VS 2015。实验编码性能使用BD-BR和$ \mathrm{\Delta }T $来评估算法性能。其中BD-BR为比特比变化率,表示在图像质量PSNR一致的情况下码率的平均变化情况,若数值为负数,表示能够减少码率;相反,表示增加了码率[20-21]$ \mathrm{\Delta }T $为编码时间减少的百分比,若为负数,表示相比VVC原始算法,序列的整体编码时间有所降低;相反,序列的整体编码时间得到提高。$ \mathrm{\Delta }T $如式(14)所示:

$ \mathrm{\Delta }T=\frac{1}{4}\sum\limits _{i=1}^{4}\frac{{T}_{\mathrm{t}\mathrm{e}\mathrm{s}\mathrm{t}}^{i}-{T}_{\mathrm{s}\mathrm{t}\mathrm{d}}^{i}}{{T}_{\mathrm{s}\mathrm{t}\mathrm{d}}^{i}}\times 100\mathrm{\%} $ (14)
3.2 仿真结果

由于文献[9]所提的算法是针对H.265/HEVC,仿真平台是H.265/HEVC的测试模型HM-16.7,而本文所提的算法是针对H.266/VVC中仿射运动估计的改进,对于本文,文献[9]的仿真结果不具有参考意义。因此,本文首先对文献[9]所提算法在H.266/VVC的测试模型VTM-10.0平台上进行仿真,以该部分的仿真结果作为本文所提算法的对比;然后分别对本文所提算法的AAMVP改进和迭代搜索优化进行仿真实验;最后对本文所提算法的整体改进性能进行仿真,结果如表 1所示。

下载CSV 表 1 本文算法与改进算法的仿真结果 Table 1 Simulation results of the proposed algorithm and improved algorithms  

文献[9]所提的算法经过改进后被H.266/VVC标准采纳,因此表 1中文献[9]所提的算法在相较于VVC标准算法的BD-BR增加了0.001%条件下,对于测试序列的整体编码时间平均提高了1.51%。本文在对文献[9]所提的算法做了适应于H.266/VVC的改进之后,仿真结果表明,本文算法在AAMVP改进部分中参考H.266/VVC标准算法,其在相较于VCC标准算法BD-BR提高0.001%的条件下,对于测试序列的整体编码时间平均降低了2.62%,迭代搜索改进部分参考H.266/VVC标准算法,在相较于VCC标准算法BD-BR增加0.014%的条件下,对于序列的整体编码时间平均降低了11.2%,最后本文所提算法的整体性能参考H266/VVC标准算法,在BD-BR提高0.023%的条件下,对于序列的整体编码时间平均降低了13%。相比文献[9]所提的算法,本文算法在BD-BR提高0.022%的条件下,对于序列的整体编码时间平均降低了14.51%。

在F类序列中所有测试序列的BD-BR值都为负数,表示在F类的所有序列中既节省了码率,同时减少了编码时间,本文所提改进的仿射运动估计算法使得仿射编码块运动估计得到的运动信息更精确,从而提高率失真性能。然而在C类和E类视频序列中,本文所提的算法具有较优的编码性能,相比VTM原始算法,其在BD-BR增加0.016%条件下,整体编码时间缩短了15.7%。其主要原因为相比于其他测试序列,C类和E类测试序列包含大量的仿射运动,而本文所提的算法是对进行仿射运动的编码过程进行改进。

将本文所提的算法与文献[7]所提的H.266/VVC中快速仿射运动估计算法进行对比,实验结果如表 2所示。从表 2可以看出,本文算法相较于文献[7]减少BD-BR的条件下,整体编码时间的下降幅度大于文献[7]所提的快速仿射运动估计算法,因此,本文算法具有更优的编码质量和更高的编码效率。将本文的算法与文献[21]的快速编码算法相比,文献[21]算法虽然降低了编码的计算复杂度,但是编码后重建的视频质量损失较大。本文算法能够平衡编码后重建视频的质量和编码效率。

下载CSV 表 2 不同算法的BD-BR和ΔT对比 Table 2 BD-BR and ΔT comparison among different algorithms  
4 结束语

本文基于H.266/VVC中帧间仿射运动估计的分析和研究,提出一种改进的仿射运动估计算法,对仿射运动估计中AAMVP候选列表的构建过程进行优化,以得到更精确的编码块仿射候选运动信息,同时对仿射运动估计中的迭代搜索真实仿射运动矢量进行改进,加快迭代搜索的过程。实验结果表明,本文算法在BD-BR损失较少的条件下,能够有效降低编码的计算复杂度。后续将在本文工作基础上对其他帧间预测工具进行优化,进一步降低编码的计算复杂度。

参考文献
[1]
BROSS B, CHEN J L, LIU S, et al. Versatile video coding(Draft10): JVET-S2001[S]. Ljubljana, The Republic of Slovenia: JEVT, 2020: 1-551.
[2]
朱昌秀, 刘峰, 胡栋. H. 265/HEVC视频编码新标准及其扩展[M]. 北京: 电子工业出版社, 2016.
ZHU C X, LIU F, HU D. New H. 265/HEVC video coding standard and its extension[M]. Beijing: Publishing House of Electronics Industry, 2016. (in Chinese)
[3]
万帅, 杨付正. 新一代高效视频编码H. 265/HEVC: 原理标准及其实现[M]. 北京: 电子工业出版社, 2014.
WAN S, YANG F Z. A new generation of high-efficiency video coding H. 265/HEVC: principle standard and implementation[M]. Beijing: Publishing House of Electronics Industry, 2014. (in Chinese)
[4]
周芸, 郭晓强, 潘晓菲. H. 266/VVC视频编码帧间预测关键技术研究[J]. 广播与电视技术, 2020, 47(7): 36-43.
ZHOU Y, GUO X Q, PAN X F. Research on key technologies of inter-frame prediction for H. 266/VVC video coding[J]. Broadcasting and TV Technology, 2020, 47(7): 36-43. (in Chinese)
[5]
LI B, HAN J N, ROSE K. An adaptive linear estimator based approach to bi-directional motion compensated prediction[C]//Proceedings of IEEE International Conference on Acoustics, Speech and Signal Processing. Washington D. C., USA: IEEE Press, 2020: 2038-2042.
[6]
CAO J, LI Z, LIANG F, et al. An intra-affine current picture referencing mode for screen content coding in VVC[C]//Proceedings of Picture Coding Symposium. Washington D. C., USA: IEEE Press, 2019: 1-5.
[7]
PARK S, KANG J. Fast affine motion estimation for versatile video coding(VVC) encoding[J]. IEEE Access, 2019, 7: 158075-158084. DOI:10.1109/ACCESS.2019.2950388
[8]
ZHANG K, CHEN Y, ZHANG L, et al. An improved framework of affine motion compensation in video coding[J]. IEEE Transactions on Image Processing, 2019, 28(3): 1456-1469. DOI:10.1109/TIP.2018.2877355
[9]
LI L, LI H Q, LIU D, et al. An efficient four-parameter affine motion model for video coding[J]. IEEE Transactions on Circuits and Systems for Video Technology, 2018, 28(8): 1934-1948. DOI:10.1109/TCSVT.2017.2699919
[10]
ZHANG K, ZHAGN L, LIU H B. CE4: affine prediction with 4×4 sub-blocks for chroma components(Test4.1. 16): JEVT-L0265[S]. Ljublijana, The Republic of Slovenia: JEVT, 2018: 1-2.
[11]
LIN Z Y, C T D. CE4.1. 6: MVP pair list construction for affine inter mode: JEVT-K0244[S]. Ljubljana, The Republic of Slovenia: JEVT, 2018: 1-4.
[12]
HE Y W, XIU X Y, YE Y. CE4-related: shape dependent control point selection for affine mode: JEVT-K0335[S]. Ljubljana, The Republic of Slovenia: JEVT, 2018: 1-6.
[13]
CHEN H B. Report on complexity analysis of affine MVP and Merge candidate list construction: JVET-K0558[S]. Ljubljana, The Republic of Slovenia: JEVT, 2018: 1-2.
[14]
张盛峰, 汪仟, 黄胜, 等. HEVC帧间预测编码单元深度快速选择算法[J]. 计算机工程, 2018, 44(10): 258-263.
ZHANG S F, WANG Q, HUANG S, et al. Fast coding unit depth selection algorithm for inter-frame prediction of HEVC[J]. Computer Engineering, 2018, 44(10): 258-263. (in Chinese)
[15]
杨静, 孙煜. 高效视频编码的Merge模式候选决策研究与改进[J]. 计算机工程, 2015, 41(12): 256-259, 264.
YANG J, SUN Y. Research and improvement of Merge mode candidate decision for high efficiency video coding[J]. Computer Engineering, 2015, 41(12): 256-259, 264. (in Chinese)
[16]
ASIKUZZAMAN M, RAJAMOHAN D, PICKERING M R. Object-oriented motion estimation using edge-based image registration[C]//Proceedings of the 22nd International Workshop on Multimedia Signal Processing. Washington D. C., USA: IEEE Press, 2020: 1-6.
[17]
CHIEN W, LIAO K, YANG Y. Enhanced AMVP mechanism based adaptive motion search range decision algorithm for fast HEVC coding[C]//Proceedings of IEEE International Conference on Image Processing. Washington D. C., USA: IEEE Press, 2014: 3696-3699.
[18]
BROSS B. JEVT AHG report: draft text and test model algorithm description editing(AHG2): JEVT-M0002[S]. Ljublijana, The Republic of Slovenia: JEVT, 2019: 1-6.
[19]
CHEN J, YE Y, KIM S. Test Model 3(VTM3) algorithm and encoder description: JEVT-K0002[S]. Ljublijana, The Republic of Slovenia: JEVT, 2019: 1-4.
[20]
郭泽. 高效帧间预测编码算法研究H. 266/VVC [D]. 西安: 西安电子科技大学, 2019.
GUO Z. Research on efficient inter prediction of H. 266/VVC[D]. Xi'An: Xidian University, 2019. (in Chinese)
[21]
陶耀东, 王鹏博, 高春, 等. 一种HEVC编码单元快速划分决策算法[J]. 小型微型计算机系统, 2015, 36(8): 1874-1877.
TAO Y D, WANG P B, GAO C, et al. A fast coding unit divided decision algorithm for HEVC[J]. Journal of Chinese Mini-Micro Computer Systems, 2015, 36(8): 1874-1877. (in Chinese)