主权项 |
一种用于视频压缩中的编码块划分的方法,其特征在于,包括以下步骤:步骤S1:读取整个LCU中的像素值,从最小的CU开始,从下至上,根据梯度方向值判断小块能否合并为大块,完成块合并搜索表;所述梯度方向值是指主像素坐标方向梯度的绝对差平均值Dire_Grad;步骤S2:进入每个深度的CU,根据深度和位置信息,获取搜索表对应位置的结合块的深度和位置信息;步骤S3:若当前CU深度与结合块深度一致,进行由下至上的块划分方法的判断流程;否则,进行由上至下的块划分快速算法的判断流程;步骤S4:判断当前CU深度与结合块深度是否一致,是则计算损失代价,否则继续分裂;若当前CU深度与结合块深度一致,进行由下至上的块划分方法的判断流程具体执行如下:步骤S31:判断当前CU的梯度方向值是否在(1,9)内,是则进行Nx2N,nUx2N,nDx2N的块的预测编码,跳到步骤S4;步骤S32:判断当前CU的梯度方向值是否在(9,16)内,是则进行2NxN,2NxnU,2NxnD的块的预测编码,跳到步骤S4;上述步骤S31和步骤S32中的梯度方向值如下表所示:梯度方向的坐标定义<tables num="0001" id="ctbl0001"><table><tgroup cols="8"><colspec colname="c001" colwidth="12%" /><colspec colname="c002" colwidth="11%" /><colspec colname="c003" colwidth="13%" /><colspec colname="c004" colwidth="11%" /><colspec colname="c005" colwidth="13%" /><colspec colname="c006" colwidth="12%" /><colspec colname="c007" colwidth="12%" /><colspec colname="c008" colwidth="16%" /><tbody><row><entry morerows="1">梯度方向</entry><entry morerows="1">坐标</entry><entry morerows="1">梯度方向</entry><entry morerows="1">坐标</entry><entry morerows="1">梯度方向</entry><entry morerows="1">坐标</entry><entry morerows="1">梯度方向</entry><entry morerows="1">坐标</entry></row><row><entry morerows="1">1</entry><entry morerows="1">{1,‑1}</entry><entry morerows="1">5</entry><entry morerows="1">{1,0}</entry><entry morerows="1">9</entry><entry morerows="1">{1,1}</entry><entry morerows="1">13</entry><entry morerows="1">{0,1}</entry></row><row><entry morerows="1">2</entry><entry morerows="1">{4,‑3}</entry><entry morerows="1">6</entry><entry morerows="1">{4,1}</entry><entry morerows="1">10</entry><entry morerows="1">{4,‑3}</entry><entry morerows="1">14</entry><entry morerows="1">{1,‑4}</entry></row><row><entry morerows="1">3</entry><entry morerows="1">{2,‑1}</entry><entry morerows="1">7</entry><entry morerows="1">{2,1}</entry><entry morerows="1">11</entry><entry morerows="1">{1,2}</entry><entry morerows="1">15</entry><entry morerows="1">{1,‑2}</entry></row><row><entry morerows="1">4</entry><entry morerows="1">{4,‑1}</entry><entry morerows="1">8</entry><entry morerows="1">{4,3}</entry><entry morerows="1">12</entry><entry morerows="1">{1,4}</entry><entry morerows="1">16</entry><entry morerows="1">{3,‑4}</entry></row></tbody></tgroup></table></tables>若当前CU深度与结合块深度不一致,进行由上至下的块划分快速算法的判断流程具体执行如下:计算图像块内原像素小块均值与平面预测值之间绝对差的平均值,若该值小于设定阈值,则进行class A的预测,否则使用class B的预测,其中,class A为:A={PART_2Nx2N,PART_NxN},class B为:B={PART_2NxN,PART_Nx2N,PART_2NxnU,PART_2NxnD,PART_nLx2N,PART_nRx2N}。 |