[go: up one dir, main page]

CN119299702A - Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features - Google Patents

Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features Download PDF

Info

Publication number
CN119299702A
CN119299702A CN202411427210.9A CN202411427210A CN119299702A CN 119299702 A CN119299702 A CN 119299702A CN 202411427210 A CN202411427210 A CN 202411427210A CN 119299702 A CN119299702 A CN 119299702A
Authority
CN
China
Prior art keywords
neighborhood
prediction model
prediction
block
gradient
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202411427210.9A
Other languages
Chinese (zh)
Inventor
雷萌
周超
谷嘉文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202411427210.9A priority Critical patent/CN119299702A/en
Publication of CN119299702A publication Critical patent/CN119299702A/en
Pending legal-status Critical Current

Links

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/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/146Data rate or code amount at the encoder output
    • H04N19/149Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
    • 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/537Motion estimation other than block-based
    • H04N19/543Motion estimation other than block-based using regions
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the disclosure provides an intra-frame encoding and decoding method and device based on neighborhood characteristics, electronic equipment and a storage medium. The method comprises the steps of carrying out gradient feature analysis on a first neighborhood of a block to be coded, carrying out preliminary screening on a prediction model to determine a prediction model set, carrying out prediction on a second neighborhood through a third neighborhood based on the prediction model set to determine distortion values corresponding to the prediction models, determining a target prediction model according to the distortion values, and then coding the block to be coded. According to the method, on one hand, the primary screening of the prediction model is carried out through the gradient characteristics of the first neighborhood to form a prediction mode set, and on the other hand, the reference neighborhood range is enlarged through the second neighborhood and the third neighborhood to determine a more matched prediction model. Meanwhile, the encoding end does not need to encode the prediction model information by the method, but predicts the prediction mode based on the implicit of the decoding end, so that the code rate occupied by the prediction mode encoding information is saved, and the encoding code rate of the intra-frame prediction mode is greatly reduced.

Description

基于邻域特征的帧内编解码方法、装置、设备及存储介质Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features

技术领域Technical Field

本公开涉及图像处理技术领域,具体而言,涉及一种基于邻域特征的帧内编码方法、解码方法、装置、电子设备、存储介质及计算机程序产品。The present disclosure relates to the field of image processing technology, and in particular to an intra-frame encoding method, decoding method, device, electronic device, storage medium and computer program product based on neighborhood features.

背景技术Background Art

在视频编码中,帧内帧(Intra帧,I帧)不依赖于邻近参考帧,可以独立地编解码。帧内预测是编码I帧的关键技术,直接决定着I帧的压缩效率。帧内预测是一种基于同一图像帧内纹理相关性预测未知信息的方法,利用图像帧中已编码完成的信息作为先验,可以去除图像中的空域信息冗余。In video coding, intra frames (I frames) do not rely on adjacent reference frames and can be encoded and decoded independently. Intra prediction is a key technology for encoding I frames and directly determines the compression efficiency of I frames. Intra prediction is a method of predicting unknown information based on texture correlation within the same image frame. It uses the encoded information in the image frame as a priori to remove spatial information redundancy in the image.

在帧内预测过程中,基于待预测块的邻域(通常是其左方和上方区域)中已重构完成的像素作为参考像素,沿着给定的角度方向将待预测像素投影至该参考像素。该投影的角度方向的密集程度和参考像素的准确性决定了帧内预测的精确度。在最新的视频编解码标准H.266/VVC中,已扩展至65种预测模式(对应于不同角度方向)。因此,在帧内预测过程中如何在多种预测模式中确定预测失真最小的预测模式,成为本领域的关键技术问题。In the intra-frame prediction process, based on the reconstructed pixels in the neighborhood of the block to be predicted (usually the area to its left and above) as reference pixels, the pixels to be predicted are projected to the reference pixels along a given angular direction. The density of the angular direction of the projection and the accuracy of the reference pixels determine the accuracy of the intra-frame prediction. In the latest video codec standard H.266/VVC, it has been expanded to 65 prediction modes (corresponding to different angular directions). Therefore, how to determine the prediction mode with the smallest prediction distortion among multiple prediction modes in the intra-frame prediction process has become a key technical issue in this field.

发明内容Summary of the invention

本公开实施例提供一种基于邻域特征的帧内编码方法、解码方法、装置、电子设备、存储介质及计算机程序产品。The embodiments of the present disclosure provide an intra-frame encoding method, a decoding method, an apparatus, an electronic device, a storage medium, and a computer program product based on neighborhood features.

根据本公开实施例的第一方面,提供一种基于邻域特征的帧内编码方法,包括:对待编码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型;基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待编码块的邻域;所述第三邻域为所述第二邻域的邻域;根据所述失真值确定目标预测模型;根据所述目标预测模型对所述待编码块进行编码。According to a first aspect of an embodiment of the present disclosure, a neighborhood feature-based intra-frame coding method is provided, comprising: performing gradient feature analysis on reference pixels in a first neighborhood of a block to be coded, and determining a prediction model set; the prediction model set includes at least two prediction models; based on the prediction model set, predicting reference pixels in a second neighborhood through reference pixels in a third neighborhood, and determining distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is a neighborhood of the block to be coded; the third neighborhood is a neighborhood of the second neighborhood; determining a target prediction model according to the distortion value; and encoding the block to be coded according to the target prediction model.

在本公开的一些示例性实施例中,所述对待编码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合,包括:在所述第一邻域中确定至少一个滑动线;获取所述滑动线上各个参考像素的梯度强度和梯度方向;对所述梯度强度和梯度方向进行统计,生成对应于所述滑动线的梯度直方图;根据所述梯度直方图,从待定预测模型集合中确定所述预测模型集合;其中,所述待定预测模型集合中包括至少两个待定预测模型;各个所述待定预测模型分别与所述梯度方向相对应。In some exemplary embodiments of the present disclosure, the step of performing gradient feature analysis on reference pixels in a first neighborhood of a block to be encoded to determine a prediction model set includes: determining at least one sliding line in the first neighborhood; obtaining the gradient strength and gradient direction of each reference pixel on the sliding line; performing statistics on the gradient strength and gradient direction to generate a gradient histogram corresponding to the sliding line; determining the prediction model set from a set of pending prediction models based on the gradient histogram; wherein the set of pending prediction models includes at least two pending prediction models; and each of the pending prediction models corresponds to the gradient direction, respectively.

在本公开的一些示例性实施例中,所述在所述第一邻域中确定至少一个滑动线,包括:通过滑动窗口在所述第一邻域中滑动对所述参考像素进行梯度特征分析;确定所述滑动窗口滑动的中心线为所述滑动线。In some exemplary embodiments of the present disclosure, determining at least one sliding line in the first neighborhood includes: performing gradient feature analysis on the reference pixel by sliding a sliding window in the first neighborhood; and determining a center line of the sliding window as the sliding line.

在本公开的一些示例性实施例中,所述至少一个滑动线包括第一滑动线和第二滑动线;所述对所述梯度强度和梯度方向进行统计,生成对应于所述滑动线的梯度直方图,包括:对所述第一滑动线的所述梯度强度和梯度方向进行统计,生成对应于所述第一滑动线的第一梯度直方图;对所述第二滑动线的所述梯度强度和梯度方向进行统计,生成对应于所述第二滑动线的第二梯度直方图。In some exemplary embodiments of the present disclosure, the at least one sliding line includes a first sliding line and a second sliding line; the statistics of the gradient strength and gradient direction to generate a gradient histogram corresponding to the sliding line includes: statistics of the gradient strength and gradient direction of the first sliding line to generate a first gradient histogram corresponding to the first sliding line; statistics of the gradient strength and gradient direction of the second sliding line to generate a second gradient histogram corresponding to the second sliding line.

在本公开的一些示例性实施例中,所述根据所述梯度直方图,从待定预测模型集合中确定所述预测模型集合,包括:根据所述第一梯度直方图,从所述待定预测模型集合中确定第一预测模型集合;根据所述第二梯度直方图,从所述待定预测模型集合中确定第二预测模型集合;根据所述第一预测模型集合和第二预测模型集合,确定所述预测模型集合。In some exemplary embodiments of the present disclosure, determining the prediction model set from the set of pending prediction models based on the gradient histogram includes: determining a first prediction model set from the set of pending prediction models based on the first gradient histogram; determining a second prediction model set from the set of pending prediction models based on the second gradient histogram; and determining the prediction model set based on the first prediction model set and the second prediction model set.

在本公开的一些示例性实施例中,所述第一预测模型集合中包括M个预测模型,所述第一预测模型集合中包括N个预测模型;其中,M大于N;所述第一滑动线比第二滑动线距离所述待编码块更近。In some exemplary embodiments of the present disclosure, the first prediction model set includes M prediction models, and the second prediction model set includes N prediction models; wherein M is greater than N; and the first sliding line is closer to the block to be encoded than the second sliding line.

在本公开的一些示例性实施例中,所述根据所述梯度直方图,从待定预测模型集合中确定所述预测模型集合,包括:将所述第一梯度直方图和第二梯度直方图进行叠加,得到叠加后梯度直方图;根据所述叠加后梯度直方图,从所述待定预测模型集合中确定所述预测模型集合。In some exemplary embodiments of the present disclosure, determining the prediction model set from the set of pending prediction models based on the gradient histogram includes: superimposing the first gradient histogram and the second gradient histogram to obtain a superimposed gradient histogram; and determining the prediction model set from the set of pending prediction models based on the superimposed gradient histogram.

在本公开的一些示例性实施例中,所述基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值,包括:根据所述待编码块确定所述第二邻域;根据所述第二邻域确定所述第三邻域;分别基于所述预测模型集合中各个预测模型,根据所述第三邻域中参考像素对所述第二邻域中参考像素进行预测,得到对应于第二邻域的预测像素;计算所述第二邻域的预测像素与对应的第二邻域的参考像素之间的失真,得到所述预测模型集合中各个预测模型所对应的失真值。In some exemplary embodiments of the present disclosure, based on the prediction model set, reference pixels in the second neighborhood are predicted by reference pixels in the third neighborhood to determine the distortion values corresponding to each prediction model in the prediction model set, including: determining the second neighborhood according to the block to be encoded; determining the third neighborhood according to the second neighborhood; predicting the reference pixels in the second neighborhood according to the reference pixels in the third neighborhood based on each prediction model in the prediction model set, to obtain predicted pixels corresponding to the second neighborhood; calculating the distortion between the predicted pixels of the second neighborhood and the corresponding reference pixels of the second neighborhood, to obtain the distortion values corresponding to each prediction model in the prediction model set.

在本公开的一些示例性实施例中,所述目标预测模型至少包括第一预测模型和第二预测模型;所述第一预测模型和第二预测模型由所述预测模型集合中选定;所述根据所述目标预测模型对所述待编码块进行编码,包括:根据所述第一预测模型对所述待编码块进行编码,得到第一预测块;根据所述第二预测模型对所述待编码块进行编码,得到第二预测块;根据所述第一预测块和第二预测块,生成所述待编码块的编码块。In some exemplary embodiments of the present disclosure, the target prediction model includes at least a first prediction model and a second prediction model; the first prediction model and the second prediction model are selected from the prediction model set; encoding the block to be encoded according to the target prediction model includes: encoding the block to be encoded according to the first prediction model to obtain a first prediction block; encoding the block to be encoded according to the second prediction model to obtain a second prediction block; generating a coding block of the block to be encoded based on the first prediction block and the second prediction block.

在本公开的一些示例性实施例中,所述根据所述第一预测块和第二预测块,生成所述待编码块的编码块,包括:根据所述预测模型对应的失真值和/或梯度强度,确定所述第一预测模型和第二预测模型对应的权重值;基于所述权重值,对所述第一预测块和第二预测块进行加权预测,得到所述编码块。In some exemplary embodiments of the present disclosure, generating the coding block of the block to be encoded according to the first prediction block and the second prediction block includes: determining the weight values corresponding to the first prediction model and the second prediction model according to the distortion value and/or gradient strength corresponding to the prediction model; and performing weighted prediction on the first prediction block and the second prediction block based on the weight value to obtain the coding block.

根据本公开实施例的第二方面,提供一种基于邻域特征的帧内解码方法,其特征在于,包括:对待解码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型;基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待解码块的邻域;所述第三邻域为所述第二邻域的邻域;根据所述失真值确定目标预测模型;根据所述目标预测模型对所述待解码块进行解码。According to a second aspect of an embodiment of the present disclosure, a method for intra-frame decoding based on neighborhood features is provided, characterized in that it includes: performing gradient feature analysis on reference pixels in a first neighborhood of a block to be decoded to determine a prediction model set; the prediction model set includes at least two prediction models; based on the prediction model set, predicting reference pixels in a second neighborhood through reference pixels in a third neighborhood to determine distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is a neighborhood of the block to be decoded; the third neighborhood is a neighborhood of the second neighborhood; determining a target prediction model according to the distortion value; and decoding the block to be decoded according to the target prediction model.

根据本公开实施例的第三方面,提供一种基于邻域特征的帧内编码装置,包括:第一梯度分析模块,被配置为对待编码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型;第一失真计算模块,被配置为基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待编码块的邻域;所述第三邻域为所述第二邻域的邻域;第一预测模型确定模块,被配置为根据所述失真值确定目标预测模型;编码模块,被配置为根据所述目标预测模型对所述待编码块进行编码。According to a third aspect of an embodiment of the present disclosure, there is provided an intra-frame encoding device based on neighborhood features, comprising: a first gradient analysis module, configured to perform gradient feature analysis on reference pixels in a first neighborhood of a block to be encoded, and determine a prediction model set; the prediction model set includes at least two prediction models; a first distortion calculation module, configured to predict reference pixels in a second neighborhood through reference pixels in a third neighborhood based on the prediction model set, and determine distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is a neighborhood of the block to be encoded; the third neighborhood is a neighborhood of the second neighborhood; a first prediction model determination module, configured to determine a target prediction model according to the distortion value; and an encoding module, configured to encode the block to be encoded according to the target prediction model.

根据本公开实施例的第四方面,提供一种基于邻域特征的帧内解码装置,包括:第二梯度分析模块,被配置为对待解码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型;第二失真计算模块,被配置为基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待解码块的邻域;所述第三邻域为所述第二邻域的邻域;第二预测模型确定模块,被配置为根据所述失真值确定目标预测模型;解码模块,被配置为根据所述目标预测模型对所述待解码块进行解码。According to a fourth aspect of an embodiment of the present disclosure, there is provided an intra-frame decoding device based on neighborhood features, comprising: a second gradient analysis module, configured to perform gradient feature analysis on reference pixels in a first neighborhood of a block to be decoded, and determine a prediction model set; the prediction model set includes at least two prediction models; a second distortion calculation module, configured to predict reference pixels in a second neighborhood through reference pixels in a third neighborhood based on the prediction model set, and determine distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is a neighborhood of the block to be decoded; the third neighborhood is a neighborhood of the second neighborhood; a second prediction model determination module, configured to determine a target prediction model according to the distortion value; and a decoding module, configured to decode the block to be decoded according to the target prediction model.

根据本公开实施例的第五方面,提供一种电子设备,其特征在于,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述可执行指令,以实现任一项所述的基于邻域特征的帧内编码方法或基于邻域特征的帧内解码方法。According to the fifth aspect of an embodiment of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement any one of the intra-frame encoding method based on neighborhood features or the intra-frame decoding method based on neighborhood features.

根据本公开实施例的第六方面,提供一种计算机可读存储介质,当所述计算机可读存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行任一项所述的基于邻域特征的帧内编码方法或基于邻域特征的帧内解码方法。According to the sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the intra-frame encoding methods based on neighborhood features or the intra-frame decoding methods based on neighborhood features.

根据本公开实施例的第七方面,提供一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现任一项所述的基于邻域特征的帧内编码方法或基于邻域特征的帧内解码方法。According to the seventh aspect of the embodiments of the present disclosure, a computer program product is provided, comprising a computer program/instruction, characterized in that when the computer program/instruction is executed by a processor, it implements any one of the intra-frame encoding methods based on neighborhood features or the intra-frame decoding methods based on neighborhood features.

本公开实施例提供的基于邻域特征的帧内编解码方法,对待编码块的第一邻域进行梯度特征分析,对预测模型进行初筛确定预测模型集合;基于预测模型集合,通过第三邻域对第二邻域进行预测,确定各个预测模型所对应的失真值;根据失真值确定目标预测模型,进而对待编码块进行编码。通过该方法,一方面通过第一邻域的梯度特征进行预测模型的初筛,形成预测模式集合;另一方面通过第二、第三邻域扩大参考邻域范围,确定更匹配的预测模型。同时,通过该方法编码端无需进行预测模型信息编码,而是基于解码端隐式预测预测模式,节省了预测模式编码信息所占用的码率,极大降低了帧内预测模式的编码码率。The intra-frame encoding and decoding method based on neighborhood features provided by the embodiment of the present disclosure performs gradient feature analysis on the first neighborhood of the coding block, preliminarily screens the prediction model to determine a prediction model set; based on the prediction model set, the second neighborhood is predicted through the third neighborhood to determine the distortion value corresponding to each prediction model; the target prediction model is determined according to the distortion value, and then the coding block is encoded. Through this method, on the one hand, the prediction model is preliminarily screened through the gradient features of the first neighborhood to form a prediction model set; on the other hand, the reference neighborhood range is expanded through the second and third neighborhoods to determine a more matching prediction model. At the same time, through this method, the encoding end does not need to encode the prediction model information, but implicitly predicts the prediction mode based on the decoding end, which saves the code rate occupied by the prediction mode encoding information and greatly reduces the encoding code rate of the intra-frame prediction mode.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

图1示出了可以应用本公开实施例的方法的示例性系统架构的示意图。FIG. 1 is a schematic diagram showing an exemplary system architecture to which the method according to an embodiment of the present disclosure can be applied.

图2是根据一示例性实施例示出的一种基于邻域特征的帧内编码方法的流程图。Fig. 2 is a flow chart showing an intra-frame coding method based on neighborhood features according to an exemplary embodiment.

图3是根据一示例性实施例示出的梯度特征分析过程的流程图一。Fig. 3 is a flowchart 1 showing a gradient feature analysis process according to an exemplary embodiment.

图4是根据一示例性实施例示出的梯度特征分析过程的流程图二。Fig. 4 is a second flowchart of a gradient feature analysis process according to an exemplary embodiment.

图5是根据一示例性实施例示出的梯度特征分析过程的示意图。Fig. 5 is a schematic diagram showing a gradient feature analysis process according to an exemplary embodiment.

图6是根据一示例性实施例示出的失真计算过程的流程图。Fig. 6 is a flowchart showing a distortion calculation process according to an exemplary embodiment.

图7是根据一示例性实施例示出的失真计算过程的示意图。Fig. 7 is a schematic diagram showing a distortion calculation process according to an exemplary embodiment.

图8是根据一示例性实施例示出的待编码块编码过程的流程图。Fig. 8 is a flowchart showing a process of encoding a block to be encoded according to an exemplary embodiment.

图9是根据一示例性实施例示出的一种基于邻域特征的帧内解码方法的流程图。Fig. 9 is a flowchart showing an intra-frame decoding method based on neighborhood features according to an exemplary embodiment.

图10是根据一示例性实施例示出的一种基于邻域特征的帧内编码装置的框图。Fig. 10 is a block diagram showing an intra-frame encoding apparatus based on neighborhood features according to an exemplary embodiment.

图11是根据一示例性实施例示出的一种基于邻域特征的帧内解码装置的框图。Fig. 11 is a block diagram showing an intra-frame decoding apparatus based on neighborhood features according to an exemplary embodiment.

图12是根据一示例性实施例示出了适于用来实现本公开示例性实施例的电子设备的结构示意图。FIG. 12 is a schematic diagram showing the structure of an electronic device suitable for implementing the exemplary embodiments of the present disclosure according to an exemplary embodiment.

具体实施方式DETAILED DESCRIPTION

现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施例;相反,提供这些实施例使得本公开将全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。在图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

本公开所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本公开的各方面。The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

附图仅为本公开的示意性图解,图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在至少一个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in at least one hardware module or integrated circuit, or implemented in different networks and/or processor devices and/or microcontroller devices.

附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和步骤,也不是必须按所描述的顺序执行。例如,有的步骤还可以分解,而有的步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

本说明书中,用语“一个”、“一”、“该”、“所述”和“至少一个”用以表示存在至少一个要素/组成部分/等;用语“包含”、“包括”和“具有”用以表示开放式的包括在内的意思并且是指除了列出的要素/组成部分/等之外还可存在另外的要素/组成部分/等;用语“第一”、“第二”和“第三”等仅作为标记使用,不是对其对象的数量限制。In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of at least one element/component/etc.; the terms "comprising", "including" and "having" are used to express an open-ended inclusion and mean that additional elements/components/etc. may exist in addition to the listed elements/components/etc.; the terms "first", "second" and "third" etc. are used only as labels and are not intended to limit the quantity of their objects.

图1示出了可以应用本公开实施例的方法的示例性系统架构的示意图。FIG. 1 is a schematic diagram showing an exemplary system architecture to which the method according to an embodiment of the present disclosure can be applied.

如图1所示,该系统架构可以包括服务器101、网络102、终端设备103、终端设备104和终端设备105。网络102用以在终端设备103、终端设备104或终端设备105和服务器101之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Fig. 1, the system architecture may include a server 101, a network 102, a terminal device 103, a terminal device 104, and a terminal device 105. The network 102 is used to provide a medium for a communication link between the terminal device 103, the terminal device 104, or the terminal device 105 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

服务器101可以是提供各种服务的服务器,例如对用户利用终端设备103、终端设备104或终端设备105所进行操作的装置提供支持的后台管理服务器。后台管理服务器可以对接收到的请求等数据进行分析等处理,并将处理结果反馈给终端设备103、终端设备104或终端设备105。The server 101 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal device 103, the terminal device 104, or the terminal device 105. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device 103, the terminal device 104, or the terminal device 105.

终端设备103、终端设备104和终端设备105可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、可穿戴智能设备、虚拟现实设备、增强现实设备等,但并不局限于此。Terminal device 103, terminal device 104 and terminal device 105 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a wearable smart device, a virtual reality device, an augmented reality device, etc., but are not limited thereto.

应该理解,图1中的终端设备103、终端设备104、终端设备105、网络102和服务器101的数目仅仅是示意性的,服务器101可以是一个实体的服务器,还可以为多个服务器组成的服务器集群,还可以是云端服务器,根据实际需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices 103, terminal devices 104, terminal devices 105, networks 102 and servers 101 in Figure 1 are merely schematic. Server 101 can be a physical server, a server cluster composed of multiple servers, or a cloud server. According to actual needs, it can have any number of terminal devices, networks and servers.

下面,将结合附图及实施例对本公开示例实施例中的方法的各个步骤进行更详细的说明。Below, each step of the method in the exemplary embodiment of the present disclosure will be described in more detail with reference to the accompanying drawings and embodiments.

图2是根据一示例性实施例示出的一种基于邻域特征的帧内编码方法的流程图。图2实施例提供的方法应用于客户端,可以由任意的电子设备来执行,例如上述图1中的终端设备、或图1中的服务器、或图1中的终端设备和服务器联合执行,但本公开对此不作限定。Fig. 2 is a flow chart of a method for intra-frame coding based on neighborhood features according to an exemplary embodiment. The method provided in the embodiment of Fig. 2 is applied to a client and can be executed by any electronic device, such as the terminal device in Fig. 1, or the server in Fig. 1, or the terminal device and the server in Fig. 1 jointly, but the present disclosure does not limit this.

在步骤S210中,对待编码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型。In step S210, gradient feature analysis is performed on reference pixels in a first neighborhood of a block to be encoded to determine a prediction model set; the prediction model set includes at least two prediction models.

相关技术中,帧内预测中最关键的两个问题是预测模型的建立和预测模式的编码。预测模型的建立,是通过对参考信息进行分析,确定相匹配的预测模式。预测模式的编码,是指对编码端所选择的预测模式信息进行编码。由于,解码端缺乏编码端所选择的预测模式信息,因此需要在编码端确定预测模式后,对该预测模式信息进行编码,解码端根据该解码后的预测模式信息执行相应的预测过程。虽然,预测模式增多可以带来预测效率的提升,但同时也会增加对预测模式信息进行编码所占用的码率。因此,如何对预测模式进行编码,也决定了最终的编码效率。本公开实施例提供了一种基于邻域特征的帧内编码方法,以解决上述相关技术问题。In the related art, the two most critical issues in intra-frame prediction are the establishment of a prediction model and the encoding of a prediction mode. The establishment of a prediction model is to determine a matching prediction mode by analyzing reference information. The encoding of a prediction mode refers to encoding the prediction mode information selected by the encoding end. Since the decoding end lacks the prediction mode information selected by the encoding end, it is necessary to encode the prediction mode information after the prediction mode is determined at the encoding end, and the decoding end performs the corresponding prediction process according to the decoded prediction mode information. Although an increase in prediction modes can improve prediction efficiency, it will also increase the bit rate occupied by encoding the prediction mode information. Therefore, how to encode the prediction mode also determines the final coding efficiency. The disclosed embodiment provides an intra-frame coding method based on neighborhood features to solve the above-mentioned related technical problems.

本公开实施例中,由于一定范围内的像素和当前待预测像素之间通常具有较强的相关性,为了利用这种相关性,可以对邻域范围的像素进行特征分析,将特征分析的结果应用于当前块的预测过程,增加预测先验,提升预测效率。基于此,本公开首先针对当前待编码块确定与之相关的第一邻域。邻域,是指与该待编码块相邻接的区域。由于,视频编解码标准中通常是从图像帧的左上角向右下角进行编解码。因此,已重建完成的参考像素通常位于待编码块的左侧和上侧。参见图5,本公开中基于该待编码块选定其左侧和上侧邻近的一定行列数的参考像素作为该第一邻域。应当指出,根据视频编解码算法不同,其所选定的第一邻域也可以基于其他方式进行选定,本公开并不做限定。同样,本公开也不对该第一邻域所选定的行列数量进行限定。该第一邻域中的参考像素为基于编码算法已完成重建的像素。In the embodiment of the present disclosure, since there is usually a strong correlation between the pixels within a certain range and the current pixel to be predicted, in order to utilize this correlation, feature analysis can be performed on the pixels within the neighborhood range, and the results of the feature analysis can be applied to the prediction process of the current block to increase the prediction prior and improve the prediction efficiency. Based on this, the present disclosure first determines the first neighborhood related to the current block to be encoded. The neighborhood refers to the area adjacent to the block to be encoded. Since the video encoding and decoding standard usually encodes and decodes from the upper left corner to the lower right corner of the image frame. Therefore, the reconstructed reference pixels are usually located on the left and upper sides of the block to be encoded. Referring to Figure 5, the present disclosure selects a certain number of rows and columns of reference pixels adjacent to the left and upper sides of the block to be encoded as the first neighborhood based on the block to be encoded. It should be noted that according to different video encoding and decoding algorithms, the selected first neighborhood can also be selected based on other methods, which is not limited by the present disclosure. Similarly, the present disclosure does not limit the number of rows and columns selected by the first neighborhood. The reference pixels in the first neighborhood are pixels that have been reconstructed based on the encoding algorithm.

本公开实施例中,基于所选定第一邻域,对该第一邻域中的参考像素进行梯度特征分析。该梯度特征分析,是基于各个像素的梯度特征进行分析。通过该梯度特征分析,可以对像素之间的相关性进行分析,进而确定邻域区域的纹理方向。考虑到邻域纹理和当前待编码块纹理之间具有连续性,因此可以对当前待编码块的纹理方向进行预测。In the disclosed embodiment, based on the selected first neighborhood, a gradient feature analysis is performed on the reference pixels in the first neighborhood. The gradient feature analysis is performed based on the gradient features of each pixel. Through the gradient feature analysis, the correlation between pixels can be analyzed to determine the texture direction of the neighborhood area. Considering the continuity between the neighborhood texture and the texture of the current block to be encoded, the texture direction of the current block to be encoded can be predicted.

如前所述,目前视频编解码标准中提供了多种预测模式可供选择。例如,H.266/VVC标准中,已扩展至65种预测模式。各个预测模式分别与不同的纹理方向角度相对应,根据待编码块的纹理方向角度,选择相匹配的预测模式,可以获得精确的预测结果。这些标准中可供选定的各个待定预测模式,形成待定预测模式集合。As mentioned above, the current video coding standards provide a variety of prediction modes to choose from. For example, the H.266/VVC standard has been expanded to 65 prediction modes. Each prediction mode corresponds to a different texture direction angle. According to the texture direction angle of the block to be encoded, a matching prediction mode can be selected to obtain an accurate prediction result. The various pending prediction modes available for selection in these standards form a pending prediction mode set.

本公开实施例中,通过前述对第一邻域中的参考像素进行梯度特征分析,获得该第一邻域的纹理方向,进而从该待定预测模式集合中选择出若干个与该纹理方向匹配度较高的预测模式,形成预测模型集合。该预测模式集合中包括至少两个预测模型。In the disclosed embodiment, by performing the gradient feature analysis on the reference pixels in the first neighborhood, the texture direction of the first neighborhood is obtained, and then a number of prediction modes with a high degree of matching with the texture direction are selected from the pending prediction mode set to form a prediction model set. The prediction mode set includes at least two prediction models.

应当指出,邻域的梯度特征和当前待编码块的梯度特征并不一定是完全一致的,其仅能反映当前待编码块纹理方向的可能性,而不是绝对一一对应的确定关系。因此,仅凭借邻域的梯度特征确定最终的目标预测模型存在一定的误差,这可能降低最终预测结果的准确性,进而影响编码效率。本公开中,并不基于邻域的梯度特征直接选定目标预测模式,而是基于邻域的梯度特征选择若干可能得预测模式,相当于对预测模式进行了一轮初筛,形成预测模式集合,以供后续步骤进行更准确地预测模式选择。It should be pointed out that the gradient features of the neighborhood and the gradient features of the current block to be encoded are not necessarily completely consistent. They can only reflect the possibility of the texture direction of the current block to be encoded, rather than an absolutely one-to-one correspondence. Therefore, there is a certain error in determining the final target prediction model based solely on the gradient features of the neighborhood, which may reduce the accuracy of the final prediction result and thus affect the coding efficiency. In the present disclosure, the target prediction mode is not directly selected based on the gradient features of the neighborhood, but a number of possible prediction modes are selected based on the gradient features of the neighborhood, which is equivalent to a preliminary screening of the prediction mode to form a prediction mode set for more accurate prediction mode selection in subsequent steps.

在步骤S220中,基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待编码块的邻域;所述第三邻域为所述第二邻域的邻域。In step S220, based on the prediction model set, reference pixels in the second neighborhood are predicted by reference pixels in the third neighborhood to determine the distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is the neighborhood of the block to be encoded; and the third neighborhood is the neighborhood of the second neighborhood.

本公开实施例中,参照前述步骤S210对于邻域的说明。参见图7,本公开中基于该待编码块701选定其左侧和上侧邻近的一定行列数的参考像素作为该第二邻域702。同样的,基于该第二邻域702选定其左侧和上侧邻近的一定行列数的参考像素作为该第三邻域703。该第二邻域702是作为该待编码块701参考的邻域。该第三邻域703是作为该第二邻域702参考的邻域。参照前述说明,该第二邻域702和第三邻域703所选定的区域范围以及选定的行列数量可以根据实际情况进行不同设置,本公开并不做限定。同时,作为该待编码块的邻域,该第一邻域和第二邻域的范围可以相同,也可以不相同。In the embodiment of the present disclosure, refer to the description of the neighborhood in the aforementioned step S210. Referring to Figure 7, in the present disclosure, a certain number of rows and columns of reference pixels adjacent to the left and upper sides of the block to be encoded 701 are selected as the second neighborhood 702. Similarly, a certain number of rows and columns of reference pixels adjacent to the left and upper sides of the second neighborhood 702 are selected as the third neighborhood 703. The second neighborhood 702 is a neighborhood for reference to the block to be encoded 701. The third neighborhood 703 is a neighborhood for reference to the second neighborhood 702. Referring to the aforementioned description, the area range selected by the second neighborhood 702 and the third neighborhood 703 and the number of rows and columns selected can be set differently according to actual conditions, and the present disclosure does not limit them. At the same time, as the neighborhood of the block to be encoded, the range of the first neighborhood and the second neighborhood may be the same or different.

本公开实施例中,该第二邻域702和第三邻域703中的参考像素均为基于编码算法已完成重建的像素。基于该第二邻域702和第三邻域703中的参考像素对该待编码块中的像素进行预测和编码重建。In the embodiment of the present disclosure, the reference pixels in the second neighborhood 702 and the third neighborhood 703 are pixels that have been reconstructed based on the coding algorithm. Based on the reference pixels in the second neighborhood 702 and the third neighborhood 703, the pixels in the block to be coded are predicted and coded and reconstructed.

本公开实施例中,由于该第三邻域是作为该第二邻域参考的邻域。因此,可以基于预测模式通过该第三邻域中参考像素对第二邻域中参考像素进行预测。本公开实施例中,基于前述步骤S210中初筛得到的预测模型集合,根据该预测模型集合中的若干预测模型分别通过该第三邻域中参考像素对第二邻域中参考像素进行预测,得到对应于第二邻域的预测像素。该预测像素与第二邻域中已完成重建的各个参考像素为一一对应关系。In the disclosed embodiment, since the third neighborhood is a neighborhood used as a reference for the second neighborhood. Therefore, the reference pixels in the second neighborhood can be predicted through the reference pixels in the third neighborhood based on the prediction mode. In the disclosed embodiment, based on the prediction model set initially screened in the aforementioned step S210, the reference pixels in the second neighborhood are predicted through the reference pixels in the third neighborhood according to several prediction models in the prediction model set, to obtain predicted pixels corresponding to the second neighborhood. The predicted pixels are in a one-to-one correspondence with each of the reference pixels that have been reconstructed in the second neighborhood.

本公开实施例中,通过比较该第二邻域的预测像素与所对应的第二邻域中的参考像素可以计算其之间的失真,得到相对应的失真值。由于,基于不同的预测模型,可以通过该第三邻域中参考像素得到不同的预测像素。因此,基于上述过程也可以计算得到对应于不同预测模式的失真值。In the disclosed embodiment, the distortion between the predicted pixel of the second neighborhood and the corresponding reference pixel in the second neighborhood can be calculated to obtain the corresponding distortion value. Since different predicted pixels can be obtained by using the reference pixel in the third neighborhood based on different prediction models, the distortion values corresponding to different prediction modes can also be calculated based on the above process.

在示例性实施例中,上述失真计算过程中,可以采用多种失真算法。例如,SATD(Sum of Absolute Transformed Differences)、SAD(Sum of Absolute Differences)、SSE(Sum of Squared Errors)等。本公开并不对具体所采用的失真算法进行限定。In an exemplary embodiment, in the above distortion calculation process, a variety of distortion algorithms may be used, such as SATD (Sum of Absolute Transformed Differences), SAD (Sum of Absolute Differences), SSE (Sum of Squared Errors), etc. The present disclosure does not limit the specific distortion algorithm used.

本公开实施例中,考虑了图像空域局部纹理的连续性,不仅基于该待编码块相邻的第二邻域,还基于该第二邻域相邻的第三邻域,进行相关失真值的计算,以进一步参与预测模式的选定。通过扩大参考邻域的范围,可以参考更多范围的信息进行预测模式的选定。但是,由于预测模式所对应的角度方向过于密集,如果直接使用该方式进行预测模式的选定,可能因为角度数量过多而存在预测失真,从而导致确定的预测模式准确度低。同时,该算法计算量较大,如果对所有预测模式都采用该方法可能带来不必要的计算开销。基于此,本公开中先通过前述步骤S210对待定预测模型集合进行初筛,选出其中若干预测模型作为该预测模型集合,在基于该预测模型集合进行该步骤S220的选定过程,可以很好的弥补该算法的不足,降低相关算法的计算复杂度。In the embodiment of the present disclosure, the continuity of the local texture of the spatial domain of the image is taken into account, and the relevant distortion value is calculated not only based on the second neighborhood adjacent to the block to be encoded, but also based on the third neighborhood adjacent to the second neighborhood, so as to further participate in the selection of the prediction mode. By expanding the range of the reference neighborhood, the prediction mode can be selected with reference to information in a wider range. However, since the angle direction corresponding to the prediction mode is too dense, if this method is directly used to select the prediction mode, there may be prediction distortion due to the excessive number of angles, resulting in low accuracy of the determined prediction mode. At the same time, the algorithm has a large amount of calculation, and if this method is used for all prediction modes, it may bring unnecessary calculation overhead. Based on this, in the present disclosure, the set of pending prediction models is first screened through the aforementioned step S210, and several prediction models are selected as the prediction model set. The selection process of step S220 is performed based on the prediction model set, which can well make up for the shortcomings of the algorithm and reduce the calculation complexity of the related algorithm.

同时,由于该步骤S220所提供的算法不再是基于原始块和预测块进行失真计算,而是转为基于第二邻域中已重建参考像素与第三邻域对第二邻域的预测像素之间的失真计算,进而基于该失真值确定最终的目标预测模式。基于此,在解码端并不需要显式的预测模式编码信息才能获悉所采用的预测模式,而是可以基于解码过程中该第二邻域和第三邻域中的参考像素,基于上述相同过程获悉待预测块所采用预测模式。因此,基于这种隐式预测避免了对预测模式的显式标识,节省了预测模式编码信息所占用的码率,极大降低了帧内预测模式的编码码率。At the same time, since the algorithm provided by step S220 is no longer based on the distortion calculation of the original block and the predicted block, but is converted to the distortion calculation between the reconstructed reference pixels in the second neighborhood and the predicted pixels of the second neighborhood by the third neighborhood, the final target prediction mode is determined based on the distortion value. Based on this, explicit prediction mode encoding information is not required at the decoding end to know the prediction mode adopted, but the prediction mode adopted by the block to be predicted can be known based on the reference pixels in the second neighborhood and the third neighborhood during the decoding process, based on the same process as above. Therefore, based on this implicit prediction, the explicit identification of the prediction mode is avoided, the code rate occupied by the prediction mode encoding information is saved, and the encoding code rate of the intra-frame prediction mode is greatly reduced.

在步骤S230中,根据所述失真值确定目标预测模型。In step S230, a target prediction model is determined according to the distortion value.

本公开实施例中,根据前述步骤S220中得到的对应于不同预测模式的失真值,可以各个预测模式的失真值进行排序,以从该预测模型集合选择合适的预测模型,确定为目标预测模式。In the disclosed embodiment, according to the distortion values corresponding to different prediction modes obtained in the aforementioned step S220, the distortion values of each prediction mode may be sorted to select a suitable prediction model from the prediction model set and determine it as the target prediction mode.

在示例性实施例中,可以根据失真值排序,将其中失真值最小的预测模型确定为该目标预测模型。In an exemplary embodiment, the prediction model with the smallest distortion value may be determined as the target prediction model according to the sorting of distortion values.

在示例性实施例中,可以根据失真值排序,从该预测模型集合选择多个预测模型确定为该目标预测模型。In an exemplary embodiment, multiple prediction models may be selected from the prediction model set according to the distortion value sorting to be determined as the target prediction model.

在步骤S240中,根据所述目标预测模型对所述待编码块进行编码。In step S240, the block to be encoded is encoded according to the target prediction model.

本公开实施例中,根据所选定的目标预测模式对该待编码块进行预测,得到相应的预测块。进而,基于该预测块进行编码,完成该待编码块的编码过程。In the disclosed embodiment, the block to be encoded is predicted according to the selected target prediction mode to obtain a corresponding prediction block, and then encoding is performed based on the prediction block to complete the encoding process of the block to be encoded.

本公开实施例中,通过重复上述对待编码块的编码过程,可以完成对整个视频帧的编码。In the embodiment of the present disclosure, by repeating the above encoding process for the block to be encoded, the encoding of the entire video frame can be completed.

本公开实施例提供的基于邻域特征的帧内编解码方法,对待编码块的第一邻域进行梯度特征分析,对预测模型进行初筛确定预测模型集合;基于预测模型集合,通过第三邻域对第二邻域进行预测,确定各个预测模型所对应的失真值;根据失真值确定目标预测模型,进而对待编码块进行编码。通过该方法,一方面通过第一邻域的梯度特征进行预测模型的初筛,形成预测模式集合;另一方面通过第二、第三邻域扩大参考邻域范围,确定更匹配的预测模型。同时,通过该方法编码端无需进行预测模型信息编码,而是基于解码端隐式预测预测模式,节省了预测模式编码信息所占用的码率,极大降低了帧内预测模式的编码码率。The intra-frame encoding and decoding method based on neighborhood features provided by the embodiment of the present disclosure performs gradient feature analysis on the first neighborhood of the coding block, preliminarily screens the prediction model to determine a prediction model set; based on the prediction model set, the second neighborhood is predicted through the third neighborhood to determine the distortion value corresponding to each prediction model; the target prediction model is determined according to the distortion value, and then the coding block is encoded. Through this method, on the one hand, the prediction model is preliminarily screened through the gradient features of the first neighborhood to form a prediction model set; on the other hand, the reference neighborhood range is expanded through the second and third neighborhoods to determine a more matching prediction model. At the same time, through this method, the encoding end does not need to encode the prediction model information, but implicitly predicts the prediction mode based on the decoding end, which saves the code rate occupied by the prediction mode encoding information and greatly reduces the encoding code rate of the intra-frame prediction mode.

图3是根据一示例性实施例示出的梯度特征分析过程的流程图一。图5是根据一示例性实施例示出的梯度特征分析过程的示意图。本公开实施例中,在图2所示基于邻域特征的帧内编码方法的基础上,前述步骤S210可以包括以下步骤。Fig. 3 is a flowchart 1 of a gradient feature analysis process according to an exemplary embodiment. Fig. 5 is a schematic diagram of a gradient feature analysis process according to an exemplary embodiment. In the disclosed embodiment, based on the intra-frame coding method based on neighborhood features shown in Fig. 2, the aforementioned step S210 may include the following steps.

在步骤S310中,在所述第一邻域中确定至少一个滑动线。In step S310, at least one sliding line is determined in the first neighborhood.

本公开实施例中,在该待编码块的第一邻域中确定至少一条滑动线。基于该滑动线进行各个参考像素的梯度特征分析。该滑动线可以是一个,也可以是多个。In the disclosed embodiment, at least one sliding line is determined in the first neighborhood of the block to be encoded. Gradient feature analysis of each reference pixel is performed based on the sliding line. The sliding line may be one or more.

在示例性实施例中,通过滑动窗口在该第一领域中滑动,以对相关参考像素进行特征分析。基于该滑动窗口滑动轨迹,确定该滑动窗口滑动的中心线为该滑动线。In an exemplary embodiment, a sliding window is slid in the first field to perform feature analysis on the relevant reference pixels. Based on the sliding trajectory of the sliding window, a center line of the sliding window is determined as the sliding line.

在示例性实施例中,以当前待编码块相邻近的上侧三行和左侧三列像素为第一邻域的参考像素。定义3X3的滑动窗口,沿该第一邻域进行滑动,则基于滑动窗口滑动的中心线可以确定一个滑动线。In an exemplary embodiment, the upper three rows and left three columns of pixels adjacent to the current block to be encoded are used as reference pixels of the first neighborhood. A 3X3 sliding window is defined and slid along the first neighborhood, and a sliding line can be determined based on the center line of the sliding window.

在示例性实施例中,参见图5,以当前待编码块相邻近的上侧四行和左侧四列像素为第一邻域的参考像素。定义3X3的滑动窗口,沿该第一邻域进行滑动,可以有两条滑动轨迹。基于该两条滑动轨迹,根据该滑动窗口滑动的中心线可以确定两个滑动线。In an exemplary embodiment, referring to FIG5 , the upper four rows and left four columns of pixels adjacent to the current block to be encoded are used as reference pixels of the first neighborhood. A 3×3 sliding window is defined, and two sliding tracks may be obtained by sliding along the first neighborhood. Based on the two sliding tracks, two sliding lines may be determined according to the center line of the sliding window.

应当指出,上述实施例仅作为本公开的示例性实施例。根据实际应用需要,可以确定不同行列数的第一邻域范围,也可以确定不同大小的滑动窗口。基于该不同范围的第一邻域和不同大小的滑动窗口,可以确定多个不同的滑动线,均应视为在本公开的保护范围之内。It should be noted that the above embodiments are only exemplary embodiments of the present disclosure. According to actual application needs, the first neighborhood ranges of different numbers of rows and columns can be determined, and sliding windows of different sizes can also be determined. Based on the first neighborhoods of different ranges and sliding windows of different sizes, multiple different sliding lines can be determined, all of which should be considered to be within the protection scope of the present disclosure.

在步骤S320中,获取所述滑动线上各个参考像素的梯度强度和梯度方向。In step S320, the gradient intensity and gradient direction of each reference pixel on the sliding line are obtained.

本公开实施例中,根据该滑动线,对各个滑动线上的参考像素分别提取其梯度特征,以获取其对应的梯度强度和梯度方向。In the disclosed embodiment, according to the sliding line, the gradient features of the reference pixels on each sliding line are respectively extracted to obtain the corresponding gradient strength and gradient direction.

在示例性实施例中,通过滑动窗口沿该滑动线在第一邻域内滑动。滑动到的每个参考像素,基于该滑动窗口利用Sobel算子(索贝尔算子)得到该像素的水平梯度Gx和垂直梯度Gy。基于该水平梯度Gx和垂直梯度Gy,计算出该像素对应的梯度强度I和梯度方向D。其中,梯度强度,用于表示该像素与相邻像素的变化幅度。梯度方向,用于表示该像素梯度的变化方向。计算公式如下:In an exemplary embodiment, a sliding window is slid along the sliding line in the first neighborhood. For each reference pixel slid to, the horizontal gradient Gx and vertical gradient Gy of the pixel are obtained based on the sliding window using the Sobel operator. Based on the horizontal gradient Gx and the vertical gradient Gy, the gradient intensity I and gradient direction D corresponding to the pixel are calculated. Among them, the gradient intensity is used to indicate the amplitude of the change between the pixel and the adjacent pixels. The gradient direction is used to indicate the direction of change of the pixel gradient. The calculation formula is as follows:

I=|Gx|+|Gy|;I=|Gx|+|Gy|;

D=arctan(Gy/Gx)。D = arctan (Gy/Gx).

在步骤S330中,对所述梯度强度和梯度方向进行统计,生成对应于所述滑动线的梯度直方图。In step S330, the gradient intensity and gradient direction are counted to generate a gradient histogram corresponding to the sliding line.

本公开实施例中,通过对该梯度强度和梯度方向进行统计,可以生成相对应的梯度直方图(Histogram ofGradient,HoG)。该梯度直方图的横轴对应于该梯度方向。如前所述,各个预测模型分别对应于一个角度方向。基于此,将前述梯度方向转换为与其最接近的预测模式角度方向。该梯度直方图的横轴坐标分别对应于各个待定预测模式的角度方向。例如,H.266/VVC标准中包括65种预测模式,则对应于该标准所提供的预测模式,将梯度直方图的横轴坐标对应于该65种预测模式的角度方向。该梯度直方图的纵轴对应于该梯度强度。将同一角度方向所对应各个像素点的梯度强度进行累加,得到对应于该角度方向的梯度强度值。In the disclosed embodiment, by taking statistics on the gradient strength and gradient direction, a corresponding gradient histogram (Histogram of Gradient, HoG) can be generated. The horizontal axis of the gradient histogram corresponds to the gradient direction. As mentioned above, each prediction model corresponds to an angular direction. Based on this, the aforementioned gradient direction is converted to the angular direction of the prediction mode closest to it. The horizontal axis coordinates of the gradient histogram correspond to the angular directions of each pending prediction mode. For example, the H.266/VVC standard includes 65 prediction modes. Corresponding to the prediction modes provided by the standard, the horizontal axis coordinates of the gradient histogram correspond to the angular directions of the 65 prediction modes. The vertical axis of the gradient histogram corresponds to the gradient strength. The gradient strengths of each pixel point corresponding to the same angular direction are accumulated to obtain the gradient strength value corresponding to the angular direction.

在步骤S340中,根据所述梯度直方图,从待定预测模型集合中确定所述预测模型集合。其中,所述待定预测模型集合中包括至少两个待定预测模型;各个所述待定预测模型分别与所述梯度方向相对应。In step S340, the prediction model set is determined from the set of pending prediction models according to the gradient histogram, wherein the set of pending prediction models includes at least two pending prediction models, each of which corresponds to the gradient direction.

本公开实施例中,通过该梯度直方图可以统计在第一邻域中对应于不同角度方向的梯度强度值。根据该梯度直方图,可以获知对应于待定预测模型集合中各个待定预测模型的梯度强度值。该待定预测模型集合为所对应视频编解码标准所提供的预测模型集合。该待定预测模型集合中包括至少两个待定预测模型。各个待定预测模型分别与梯度方向相对应。该待定预测模型所对应的梯度强度值越大,则说明在第一邻域中该角度方向上的梯度变化强度越大。通过比较各个待定预测模型的梯度强度值,可以从中选取预定数量的预测模式,形成该预测模型集合。In the disclosed embodiment, the gradient histogram can be used to count the gradient strength values corresponding to different angular directions in the first neighborhood. According to the gradient histogram, the gradient strength values corresponding to each pending prediction model in the pending prediction model set can be known. The pending prediction model set is a prediction model set provided by the corresponding video coding standard. The pending prediction model set includes at least two pending prediction models. Each pending prediction model corresponds to a gradient direction, respectively. The larger the gradient strength value corresponding to the pending prediction model, the greater the gradient change intensity in the angular direction in the first neighborhood. By comparing the gradient strength values of each pending prediction model, a predetermined number of prediction modes can be selected therefrom to form the prediction model set.

在示例性实施例中,由于在H.265/HEVC视频编解码标准中还增加了直流预测模式(DC模式)和平面预测模式(Planar模式),这两种非角度方向相关的预测模式。基于此,在前述确定的预测模型集合基础上,还可以增加该DC模式和Planar模式两种特殊的预测模式,以构成该预测模型集合。In an exemplary embodiment, since the direct current prediction mode (DC mode) and the planar prediction mode (Planar mode) are added to the H.265/HEVC video codec standard, these two non-angle-direction-related prediction modes. Based on this, on the basis of the aforementioned determined prediction model set, two special prediction modes, the DC mode and the Planar mode, can also be added to form the prediction model set.

图4是根据一示例性实施例示出的梯度特征分析过程的流程图二。图5是根据一示例性实施例示出的梯度特征分析过程的示意图。本公开实施例中,在图3所示梯度特征分析过程的基础上,该梯度特征分析过程可以包括以下步骤。Fig. 4 is a second flowchart of a gradient feature analysis process according to an exemplary embodiment. Fig. 5 is a schematic diagram of a gradient feature analysis process according to an exemplary embodiment. In the disclosed embodiment, based on the gradient feature analysis process shown in Fig. 3, the gradient feature analysis process may include the following steps.

在步骤S410中,在所述第一邻域中确定至少一个滑动线。该至少一个滑动线中包括:第一滑动线和第二滑动线。In step S410, at least one sliding line is determined in the first neighborhood, wherein the at least one sliding line includes: a first sliding line and a second sliding line.

本公开实施例中,在该第一邻域中可以确定多个滑动线。在该多个滑动线中可以包括:第一滑动线和第二滑动线。该第一滑动线和第二滑动线可以是该多个滑动线中的任意两个滑动线。当然,在第一邻域中还可以确定多于两个滑动线。本公开实施例仅以其中两个滑动线做示例性说明。In the embodiment of the present disclosure, multiple sliding lines can be determined in the first neighborhood. The multiple sliding lines may include: a first sliding line and a second sliding line. The first sliding line and the second sliding line may be any two sliding lines in the multiple sliding lines. Of course, more than two sliding lines can also be determined in the first neighborhood. The embodiment of the present disclosure only uses two sliding lines as an example for illustration.

在示例性实施例中,如图5所示,以当前待编码块相邻近的上侧四行和左侧四列像素为第一邻域的参考像素。定义3X3的滑动窗口,沿该第一邻域进行滑动,可以有两条滑动轨迹。基于该两条滑动轨迹,根据该滑动窗口滑动的中心线可以确定两个滑动线,分别为该第一滑动线和第二滑动线。In an exemplary embodiment, as shown in FIG5 , the upper four rows and left four columns of pixels adjacent to the current block to be encoded are used as reference pixels of the first neighborhood. A 3×3 sliding window is defined, and two sliding tracks may be formed by sliding along the first neighborhood. Based on the two sliding tracks, two sliding lines may be determined according to the center line of the sliding window, namely the first sliding line and the second sliding line.

在步骤S420中,分别获取第一滑动线和第二滑动线上各个参考像素的梯度强度和梯度方向。In step S420, the gradient strength and gradient direction of each reference pixel on the first sliding line and the second sliding line are obtained respectively.

本公开实施例中,根据该第一滑动线和第二滑动线分别获取该滑动线上各个参考像素的梯度强度和梯度方向。两个滑动线分别独立进行该像素梯度特征分析过程。由于,该梯度特征分析过程与前述步骤S320相类似,在此就不再赘述。In the embodiment of the present disclosure, the gradient strength and gradient direction of each reference pixel on the sliding line are obtained according to the first sliding line and the second sliding line. The two sliding lines perform the pixel gradient feature analysis process independently. Since the gradient feature analysis process is similar to the aforementioned step S320, it will not be repeated here.

在步骤S430中,对所述梯度强度和梯度方向进行统计,生成第一梯度直方图和第二梯度直方图。In step S430, the gradient strength and gradient direction are counted to generate a first gradient histogram and a second gradient histogram.

本公开实施例中,针对第一滑动线所获取各个参考像素的梯度强度和梯度方向,可以生成对应于第一滑动线的第一梯度直方图HoG1。针对第二滑动线所获取各个参考像素的梯度强度和梯度方向,可以生成对应于第二滑动线的第二梯度直方图HoG2。In the disclosed embodiment, for the gradient strength and gradient direction of each reference pixel obtained by the first sliding line, a first gradient histogram HoG1 corresponding to the first sliding line can be generated. For the gradient strength and gradient direction of each reference pixel obtained by the second sliding line, a second gradient histogram HoG2 corresponding to the second sliding line can be generated.

应当指出,该第一梯度直方图HoG1和第二梯度直方图HoG2的横轴均与各个待定预测模式的角度方向相对应,因此是一致的。该第一梯度直方图HoG1和第二梯度直方图HoG2的纵轴,分别独立统计所对应滑动线上各个参考像素的梯度强度值。It should be noted that the horizontal axes of the first gradient histogram HoG1 and the second gradient histogram HoG2 correspond to the angle directions of each pending prediction mode, and therefore are consistent. The vertical axes of the first gradient histogram HoG1 and the second gradient histogram HoG2 independently count the gradient intensity values of each reference pixel on the corresponding sliding line.

在步骤S440中,根据第一梯度直方图和第二梯度直方图,从待定预测模型集合中确定所述预测模型集合。In step S440, the prediction model set is determined from the pending prediction model set according to the first gradient histogram and the second gradient histogram.

本公开实施例中,根据第一梯度直方图和第二梯度直方图,从待定预测模型集合中确定若干预测模型,以形成该预测模型集合。In the disclosed embodiment, a plurality of prediction models are determined from the set of pending prediction models according to the first gradient histogram and the second gradient histogram to form the set of prediction models.

在示例性实施例中,根据该第一梯度直方图,从待定预测模型集合中确定第一预测模型集合。根据该第二梯度直方图,从待定预测模型集合中确定第二预测模型集合。该第一预测模型集合和第二预测模型集合的确定过程与前述步骤S340相类似,在此就不再赘述。分别基于两个滑动线获得所对应的第一预测模型集合和第二预测模型集合后,根据该第一预测模型集合和第二预测模型集合,确定该预测模型集合。由于,第一预测模型集合和第二预测模型集合中可能有部分预测模式是重合的,因此可以基于该第一预测模型集合和第二预测模型集合的并集,确定该预测模型集合。In an exemplary embodiment, the first prediction model set is determined from the pending prediction model set according to the first gradient histogram. The second prediction model set is determined from the pending prediction model set according to the second gradient histogram. The process of determining the first prediction model set and the second prediction model set is similar to the aforementioned step S340 and will not be repeated here. After obtaining the corresponding first prediction model set and second prediction model set based on two sliding lines respectively, the prediction model set is determined according to the first prediction model set and the second prediction model set. Since some prediction modes in the first prediction model set and the second prediction model set may overlap, the prediction model set can be determined based on the union of the first prediction model set and the second prediction model set.

在示例性实施例中,该第一预测模型集合和第二预测模型集合中可以选取不同数量的预测模型。该第一预测模型集合中包括M个预测模型。所述第一预测模型集合中包括N个预测模型。其中,M大于N。该第一预测模型集合所对应的第一滑动线比第二预测模型集合所对应的第二滑动线距离该待编码块更近。如图5所示,两个滑动线距离该待编码块的距离不同。由于,可以认为距离待编码块的距离越近,其与待编码块的相关性越高。因此,可以基于较近的滑动线选取更多个预测模型,较远的滑动线选取更少个预测模型。例如,根据第一梯度直方图HoG1选取排序前6的预测模型构成第一预测模型集合,根据第二梯度直方图HoG2选取排序前4的预测模型构成第二预测模型集合。In an exemplary embodiment, different numbers of prediction models can be selected from the first prediction model set and the second prediction model set. The first prediction model set includes M prediction models. The first prediction model set includes N prediction models. Among them, M is greater than N. The first sliding line corresponding to the first prediction model set is closer to the block to be encoded than the second sliding line corresponding to the second prediction model set. As shown in Figure 5, the two sliding lines are at different distances from the block to be encoded. Since it can be considered that the closer the distance to the block to be encoded, the higher its correlation with the block to be encoded. Therefore, more prediction models can be selected based on closer sliding lines, and fewer prediction models can be selected based on farther sliding lines. For example, according to the first gradient histogram HoG1, the top 6 prediction models are selected to form the first prediction model set, and according to the second gradient histogram HoG2, the top 4 prediction models are selected to form the second prediction model set.

在示例性实施例中,由于该第一梯度直方图HoG1和第二梯度直方图HoG2的横轴均与各个待定预测模式的角度方向相对应。因此,可以将该该第一梯度直方图HoG1和第二梯度直方图HoG2进行叠加,将对应横坐标的梯度强度值进行叠加,得到叠加后梯度直方图。该叠加后梯度直方图可以综合反映两个滑动线上所统计的各个参考像素的梯度特征。根据该叠加后梯度直方图,从待定预测模型集合中确定该预测模型集合。该预测模型集合的确定过程与前述步骤S340相类似,在此就不再赘述。In an exemplary embodiment, since the horizontal axes of the first gradient histogram HoG1 and the second gradient histogram HoG2 correspond to the angular directions of each pending prediction mode. Therefore, the first gradient histogram HoG1 and the second gradient histogram HoG2 can be superimposed, and the gradient intensity values of the corresponding horizontal coordinates can be superimposed to obtain a superimposed gradient histogram. The superimposed gradient histogram can comprehensively reflect the gradient characteristics of each reference pixel counted on the two sliding lines. According to the superimposed gradient histogram, the prediction model set is determined from the pending prediction model set. The determination process of the prediction model set is similar to the aforementioned step S340, which will not be repeated here.

本公开实施例提供的基于邻域特征的帧内编解码方法,并不基于邻域的梯度特征直接选定目标预测模式,而是基于邻域的梯度特征选择若干可能得预测模式,相当于对预测模式进行了一轮初筛,形成预测模式集合,以供后续步骤进行更准确地预测模式选择。这样,可以避免仅凭借邻域的梯度特征确定最终的目标预测模型所存在的误差问题。同时,该方法支持对第一邻域确定多个滑动线,分别对邻域的梯度特征进行分析,从而大大扩大了梯度特征分析的参考范围,提高最终预测模型的准确性。The intra-frame encoding and decoding method based on neighborhood features provided by the embodiment of the present disclosure does not directly select the target prediction mode based on the gradient features of the neighborhood, but selects several possible prediction modes based on the gradient features of the neighborhood, which is equivalent to a preliminary screening of the prediction mode to form a prediction mode set for more accurate prediction mode selection in subsequent steps. In this way, the error problem of determining the final target prediction model solely by relying on the gradient features of the neighborhood can be avoided. At the same time, the method supports determining multiple sliding lines for the first neighborhood, and analyzing the gradient features of the neighborhood respectively, thereby greatly expanding the reference range of the gradient feature analysis and improving the accuracy of the final prediction model.

图6是根据一示例性实施例示出的失真计算过程的流程图。图7是根据一示例性实施例示出的失真计算过程的示意图。本公开实施例中,在图2所示基于邻域特征的帧内编码方法的基础上,前述步骤S220可以包括以下步骤。Fig. 6 is a flow chart of a distortion calculation process according to an exemplary embodiment. Fig. 7 is a schematic diagram of a distortion calculation process according to an exemplary embodiment. In the disclosed embodiment, based on the intra-frame coding method based on neighborhood features shown in Fig. 2, the aforementioned step S220 may include the following steps.

在步骤S610中,根据所述待编码块确定所述第二邻域。In step S610, the second neighborhood is determined according to the block to be encoded.

本公开实施例中,如图7所示,根据该待编码块701确定与其相邻的预设区域范围为该第二邻域702。如前所述,可以选定该待编码块701左侧和上侧邻近的一定行列数的参考像素作为该第二邻域702。该第二邻域702中的参考像素均为基于编码算法已完成重建的像素。In the embodiment of the present disclosure, as shown in FIG7 , a preset area range adjacent to the block to be encoded 701 is determined as the second neighborhood 702. As mentioned above, a certain number of rows and columns of reference pixels adjacent to the left and upper sides of the block to be encoded 701 can be selected as the second neighborhood 702. The reference pixels in the second neighborhood 702 are all pixels that have been reconstructed based on the encoding algorithm.

在步骤S620中,根据所述第二邻域确定所述第三邻域。In step S620, the third neighborhood is determined according to the second neighborhood.

本公开实施例中,如图7所示,根据该第二邻域702确定与其相邻的预设区域范围为该第三邻域703。如前所述,可以选定该第二邻域702左侧和上侧邻近的一定行列数的参考像素作为该第三邻域703。该第三邻域703中的参考像素均为基于编码算法已完成重建的像素。In the embodiment of the present disclosure, as shown in FIG7 , the preset area range adjacent to the second neighborhood 702 is determined as the third neighborhood 703. As mentioned above, a certain number of rows and columns of reference pixels adjacent to the left and upper sides of the second neighborhood 702 can be selected as the third neighborhood 703. The reference pixels in the third neighborhood 703 are all pixels that have been reconstructed based on the encoding algorithm.

在步骤S630中,分别基于所述预测模型集合中各个预测模型,根据所述第三邻域中参考像素对所述第二邻域中参考像素进行预测,得到对应于第二邻域的预测像素。In step S630, based on each prediction model in the prediction model set, the reference pixels in the second neighborhood are predicted according to the reference pixels in the third neighborhood to obtain predicted pixels corresponding to the second neighborhood.

本公开实施例中,由于该第三邻域是作为该第二邻域参考的邻域。因此,可以基于预测模式通过该第三邻域中参考像素对第二邻域中参考像素进行预测。该预测过程与基于第二邻域中参考像素对当前待编码块进行预测是一样的。考虑了图像空域局部纹理的连续性,因此可以基于第二邻域与第三邻域的预测失真情况,推导待编码块与第二邻域的预测失真情况。In the disclosed embodiment, since the third neighborhood is a neighborhood used as a reference for the second neighborhood. Therefore, the reference pixels in the second neighborhood can be predicted based on the prediction mode through the reference pixels in the third neighborhood. The prediction process is the same as predicting the current block to be encoded based on the reference pixels in the second neighborhood. The continuity of the local texture in the spatial domain of the image is taken into account, so the prediction distortion of the block to be encoded and the second neighborhood can be derived based on the prediction distortion of the second neighborhood and the third neighborhood.

本公开实施例中,基于前述初筛得到的预测模型集合,根据该预测模型集合中的若干预测模型分别通过该第三邻域中参考像素对第二邻域中参考像素进行预测,得到对应于第二邻域的预测像素。该预测像素与第二邻域中已完成重建的各个参考像素为一一对应关系。In the disclosed embodiment, based on the prediction model set obtained by the preliminary screening, reference pixels in the second neighborhood are predicted by several prediction models in the prediction model set through reference pixels in the third neighborhood, to obtain predicted pixels corresponding to the second neighborhood. The predicted pixels are in one-to-one correspondence with each of the reconstructed reference pixels in the second neighborhood.

在步骤S640中,计算所述第二邻域的预测像素与对应的第二邻域的参考像素之间的失真,得到所述预测模型集合中各个预测模型所对应的失真值。In step S640, the distortion between the predicted pixel of the second neighborhood and the corresponding reference pixel of the second neighborhood is calculated to obtain the distortion value corresponding to each prediction model in the prediction model set.

本公开实施例中,通过比较该第二邻域的预测像素与所对应的第二邻域中的参考像素可以计算其之间的失真,得到相对应的失真值。由于,基于不同的预测模型,可以通过该第三邻域中参考像素得到不同的预测像素。因此,基于上述过程也可以计算得到对应于不同预测模式的失真值。In the disclosed embodiment, the distortion between the predicted pixel of the second neighborhood and the corresponding reference pixel in the second neighborhood can be calculated to obtain the corresponding distortion value. Since different predicted pixels can be obtained by using the reference pixel in the third neighborhood based on different prediction models, the distortion values corresponding to different prediction modes can also be calculated based on the above process.

在示例性实施例中,上述失真计算过程中,可以采用多种失真算法。例如,SATD(Sum of Absolute Transformed Differences)、SAD(Sum of Absolute Differences)、SSE(Sum of Squared Errors)等。本公开并不对具体所采用的失真算法进行限定。In an exemplary embodiment, in the above distortion calculation process, a variety of distortion algorithms may be used, such as SATD (Sum of Absolute Transformed Differences), SAD (Sum of Absolute Differences), SSE (Sum of Squared Errors), etc. The present disclosure does not limit the specific distortion algorithm used.

在示例性实施例中,RT为第二邻域中已重建参考像素模板,pT m为每种预测模式对应该第二邻域对应像素模板的预测结果。其中,m代表不同的预测模式。基于对应的RT和pT m可以以SATD为失真评价准则,计算预测模型集合中各个预测模型所对应的失真值,进而对各个预测模型进行排序。In an exemplary embodiment, RT is a reconstructed reference pixel template in the second neighborhood, and pTm is a prediction result of each prediction mode corresponding to the corresponding pixel template in the second neighborhood. Wherein, m represents different prediction modes. Based on the corresponding RT and pTm , SATD can be used as a distortion evaluation criterion to calculate the distortion value corresponding to each prediction model in the prediction model set, and then sort the prediction models.

本公开实施例中,考虑了图像空域局部纹理的连续性,不仅基于该待编码块相邻的第二邻域,还基于该第二邻域相邻的第三邻域,进行相关失真值的计算,以进一步参与预测模式的选定。通过扩大参考邻域的范围,可以参考更多范围的信息进行预测模式的选定。但是,由于预测模式所对应的角度方向过于密集,如果直接使用该方式进行预测模式的选定,可能因为角度数量过多而存在预测失真,从而导致确定的预测模式准确度低。同时,该算法计算量较大,如果对所有预测模式都采用该方法可能带来不必要的计算开销。基于此,本公开中先通过前述对待定预测模型集合进行初筛,选出其中若干预测模型作为该预测模型集合,再基于该预测模型集合进行上述失真计算过程,可以很好的弥补该算法的不足,降低相关算法的计算复杂度。In the disclosed embodiment, the continuity of the local texture in the spatial domain of the image is taken into account, and the relevant distortion value is calculated not only based on the second neighborhood adjacent to the block to be encoded, but also based on the third neighborhood adjacent to the second neighborhood, so as to further participate in the selection of the prediction mode. By expanding the range of the reference neighborhood, the prediction mode can be selected with reference to information in a wider range. However, since the angle direction corresponding to the prediction mode is too dense, if this method is directly used to select the prediction mode, there may be prediction distortion due to the excessive number of angles, resulting in low accuracy of the determined prediction mode. At the same time, the algorithm has a large amount of calculation, and if this method is used for all prediction modes, it may bring unnecessary calculation overhead. Based on this, in the present disclosure, the above-mentioned set of pending prediction models is first screened, and several prediction models are selected as the prediction model set, and then the above-mentioned distortion calculation process is performed based on the prediction model set, which can well make up for the shortcomings of the algorithm and reduce the calculation complexity of the related algorithms.

同时,由于该失真计算过程不再是基于原始块和预测块进行失真计算,而是转为基于第二邻域中已重建参考像素与第三邻域对第二邻域的预测像素之间的失真计算,进而基于该失真值确定最终的目标预测模式。基于此,在解码端并不需要显式的预测模式编码信息才能获悉所采用的预测模式,而是可以基于解码过程中该第二邻域和第三邻域中的参考像素,基于上述相同过程获悉待预测块所采用预测模式。因此,基于这种隐式预测避免了对预测模式的显式标识,节省了预测模式编码信息所占用的码率,极大降低了帧内预测模式的编码码率。At the same time, since the distortion calculation process is no longer based on the original block and the predicted block, but is converted to the distortion calculation between the reconstructed reference pixels in the second neighborhood and the predicted pixels of the third neighborhood to the second neighborhood, the final target prediction mode is determined based on the distortion value. Based on this, explicit prediction mode encoding information is not required at the decoding end to know the prediction mode adopted, but the prediction mode adopted by the block to be predicted can be known based on the reference pixels in the second neighborhood and the third neighborhood during the decoding process, based on the same process as above. Therefore, based on this implicit prediction, the explicit identification of the prediction mode is avoided, the code rate occupied by the prediction mode encoding information is saved, and the encoding code rate of the intra-frame prediction mode is greatly reduced.

图8是根据一示例性实施例示出的待编码块编码过程的流程图。本公开实施例中,在图2所示基于邻域特征的帧内编码方法的基础上,前述步骤S240可以包括以下步骤。Fig. 8 is a flow chart showing a process of encoding a block to be encoded according to an exemplary embodiment. In the embodiment of the present disclosure, based on the intra-frame encoding method based on neighborhood features shown in Fig. 2, the aforementioned step S240 may include the following steps.

在步骤S810中,根据所述第一预测模型对所述待编码块进行编码,得到第一预测块。In step S810, the block to be encoded is encoded according to the first prediction model to obtain a first prediction block.

如前所述,可以根据失真值排序,从该预测模型集合选择多个预测模型确定为该目标预测模型。基于此,该目标预测模型中可以至少包括:第一预测模型和第二预测模型。该第一预测模型和第二预测模型可以是由预测模型集合中选定的任意预测模型。As mentioned above, multiple prediction models can be selected from the prediction model set according to the distortion value sorting to determine the target prediction model. Based on this, the target prediction model can at least include: a first prediction model and a second prediction model. The first prediction model and the second prediction model can be any prediction model selected from the prediction model set.

本公开实施例中,根据所选定的第一预测模型对该待编码块进行预测,得到相应的第一预测块。In the disclosed embodiment, the block to be encoded is predicted according to the selected first prediction model to obtain a corresponding first prediction block.

在步骤S820中,根据所述第二预测模型对所述待编码块进行编码,得到第二预测块。In step S820, the block to be encoded is encoded according to the second prediction model to obtain a second prediction block.

本公开实施例中,根据所选定的第二预测模型对该待编码块进行预测,得到相应的第二预测块。In the disclosed embodiment, the block to be encoded is predicted according to the selected second prediction model to obtain a corresponding second prediction block.

在步骤S830中,根据所述第一预测块和第二预测块,生成所述待编码块的编码块。In step S830, a coding block of the block to be coded is generated according to the first prediction block and the second prediction block.

本公开实施例中,基于该第一预测块和第二预测块进行合并预测,生成该待编码块的编码块。通过该方法,可以不仅局限于基于单个预测模型对待编码块进行预测编码,而是通过多个预测模型对待编码块进行预测编码。In the embodiment of the present disclosure, a merging prediction is performed based on the first prediction block and the second prediction block to generate a coding block of the block to be coded. By this method, it is not limited to predicting and coding the block to be coded based on a single prediction model, but predicting and coding the block to be coded based on multiple prediction models.

在示例性实施例中,可以为所选定的多个预测模型设定不同的权重值。基于该权重值,对第一预测块和第二预测块进行加权预测,得到该编码块。通过设定不同的权重值,可以调整多个预测模型之间的权重比例,从而更精准的进行加权预测编码。参见公式如下:In an exemplary embodiment, different weight values can be set for the selected multiple prediction models. Based on the weight values, the first prediction block and the second prediction block are weighted predicted to obtain the coding block. By setting different weight values, the weight ratio between the multiple prediction models can be adjusted, so as to perform weighted prediction coding more accurately. See the formula as follows:

P=a·P1+b·P2P=a·P1+b·P2

其中,P为编码块,P1为第一预测块,P2为第二预测块,a为第一预测模型的权重值,b为第二预测模型的权重值。Among them, P is the coding block, P1 is the first prediction block, P2 is the second prediction block, a is the weight value of the first prediction model, and b is the weight value of the second prediction model.

在示例性实施例中,该第一预测模型和第二预测模型的权重值可以为预先设定的权重值。In an exemplary embodiment, the weight values of the first prediction model and the second prediction model may be preset weight values.

在示例性实施例中,该第一预测模型和第二预测模型的权重值,可以根据前述计算得到的对应失真值确定。失真值越小的预测模型,对应的权重值越大;失真值越大的预测模型,对应的权重值越小。例如,设定预测模型的权重值为其失真值的倒数。In an exemplary embodiment, the weight values of the first prediction model and the second prediction model can be determined according to the corresponding distortion values obtained by the above calculation. The smaller the distortion value of the prediction model, the larger the corresponding weight value; the larger the distortion value of the prediction model, the smaller the corresponding weight value. For example, the weight value of the prediction model is set to the inverse of its distortion value.

在示例性实施例中,该第一预测模型和第二预测模型的权重值,可以根据前述计算得到的对应梯度强度值确定。梯度强度值越小的预测模型,对应的权重值越小;梯度强度值越大的预测模型,对应的权重值越大。例如,可以设定预测模型的权重值与其对应梯度强度值之间的线性比例关系。In an exemplary embodiment, the weight values of the first prediction model and the second prediction model can be determined according to the corresponding gradient strength values obtained by the above calculation. The smaller the gradient strength value of the prediction model, the smaller the corresponding weight value; the larger the gradient strength value of the prediction model, the larger the corresponding weight value. For example, a linear proportional relationship between the weight value of the prediction model and its corresponding gradient strength value can be set.

在示例性实施例中,该第一预测模型和第二预测模型的权重值,可以根据前述计算得到的对应失真值和梯度强度值确定。通过设计权重值与其对应失真值和梯度强度值的函数关系,可以确定该权重值。该具体函数关系在此不做具体限定。In an exemplary embodiment, the weight values of the first prediction model and the second prediction model can be determined according to the corresponding distortion value and gradient strength value obtained by the above calculation. The weight value can be determined by designing a functional relationship between the weight value and its corresponding distortion value and gradient strength value. The specific functional relationship is not specifically limited here.

本公开实施例提供的基于邻域特征的帧内编解码方法,通过多个预测模型组成目标预测模型,降低了单个预测模型产生预测误差的可能性,提高了最终预测块的准确性。同时,该方法提供了多种预测模型权重值的设置方案,可以适用于多种应用场景。The intra-frame encoding and decoding method based on neighborhood features provided by the embodiment of the present disclosure uses multiple prediction models to form a target prediction model, thereby reducing the possibility of a single prediction model generating prediction errors and improving the accuracy of the final prediction block. At the same time, the method provides a variety of prediction model weight value setting schemes, which can be applied to a variety of application scenarios.

图9是根据一示例性实施例示出的一种基于邻域特征的帧内解码方法的流程图。图9实施例提供的方法应用于客户端,可以由任意的电子设备来执行,例如上述图1中的终端设备、或图1中的服务器、或图1中的终端设备和服务器联合执行,但本公开对此不作限定。Fig. 9 is a flow chart of a method for intra-frame decoding based on neighborhood features according to an exemplary embodiment. The method provided in the embodiment of Fig. 9 is applied to a client and can be executed by any electronic device, such as the terminal device in Fig. 1 above, or the server in Fig. 1, or the terminal device and the server in Fig. 1 jointly, but the present disclosure does not limit this.

在步骤S910中,对待解码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型。In step S910, gradient feature analysis is performed on reference pixels in a first neighborhood of a block to be decoded to determine a prediction model set; the prediction model set includes at least two prediction models.

在步骤S920中,基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待解码块的邻域;所述第三邻域为所述第二邻域的邻域。In step S920, based on the prediction model set, reference pixels in the second neighborhood are predicted by reference pixels in the third neighborhood to determine the distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is the neighborhood of the block to be decoded; and the third neighborhood is the neighborhood of the second neighborhood.

在步骤S930中,根据所述失真值确定目标预测模型。In step S930, a target prediction model is determined according to the distortion value.

在步骤S940中,根据所述目标预测模型对所述待解码块进行解码。In step S940, the block to be decoded is decoded according to the target prediction model.

本公开实施例中,解码端可以采用与编码端相同的帧内预测处理流程来对编码视频帧进行解码。解码器首先确定待解码块的第一邻域。该邻域范围的确定规则与编码端相同,因此可以基于编码端相同的第一邻域中的参考像素进行梯度特征分析,进而确定预测模型集合。由于,与编码端采用相同策略,因此在解码端所选取的预测模型集合也与编码端相同。同理,解码端基于与编码端相同策略选定该第二邻域和第三邻域。并且,该算法不再是基于原始块和预测块进行失真计算,而是转为基于第二邻域中已重建参考像素与第三邻域对第二邻域的预测像素之间的失真计算,进而基于该失真值确定最终的目标预测模式。通过该目标预测模型对待解码块进行解码,可以解码成为原视频块。本公开中,通过在解码端采用与编码端相同的算法策略,可以使解码端可以完全还原编码端的逆向过程,从而实现解码。同时,大大简化终端视频编解码的设计结构,降低相关视频编解码算法实现成本。基于这一设计思想,前述关于编码端相关实施例所公开的内容,均可参照作为解码端实施例内容,在此不再熬述。In the embodiment of the present disclosure, the decoding end can use the same intra-frame prediction processing flow as the encoding end to decode the encoded video frame. The decoder first determines the first neighborhood of the block to be decoded. The determination rule of the neighborhood range is the same as that of the encoding end, so the gradient feature analysis can be performed based on the reference pixels in the same first neighborhood of the encoding end, and then the prediction model set is determined. Since the same strategy is adopted as the encoding end, the prediction model set selected at the decoding end is also the same as the encoding end. Similarly, the decoding end selects the second neighborhood and the third neighborhood based on the same strategy as the encoding end. In addition, the algorithm is no longer based on the original block and the predicted block for distortion calculation, but is converted to the distortion calculation between the reconstructed reference pixels in the second neighborhood and the predicted pixels of the third neighborhood for the second neighborhood, and then the final target prediction mode is determined based on the distortion value. The block to be decoded is decoded by the target prediction model, and it can be decoded into the original video block. In the present disclosure, by adopting the same algorithm strategy as the encoding end at the decoding end, the decoding end can completely restore the reverse process of the encoding end, thereby realizing decoding. At the same time, the design structure of the terminal video codec is greatly simplified, and the implementation cost of the related video codec algorithm is reduced. Based on this design concept, the contents disclosed in the aforementioned embodiments related to the encoding end can all be referred to as the contents of the decoding end embodiments and will not be repeated here.

本公开实施例中,在解码端并不需要显式的预测模式编码信息才能获悉所采用的预测模式,而是可以基于解码过程中该第二邻域和第三邻域中的参考像素,基于上述相同过程获悉待预测块所采用预测模式。因此,基于这种隐式预测避免了对预测模式的显式标识,节省了预测模式编码信息所占用的码率,极大降低了帧内预测模式的编码码率。同时,由于与编码端采用相同的解码策略,可以大大简化终端视频编解码的设计结构,降低相关视频编解码算法实现成本。In the disclosed embodiment, explicit prediction mode coding information is not required at the decoding end to learn the prediction mode used, but the prediction mode used by the block to be predicted can be learned based on the reference pixels in the second neighborhood and the third neighborhood during the decoding process, based on the same process as above. Therefore, based on this implicit prediction, the explicit identification of the prediction mode is avoided, the bit rate occupied by the prediction mode coding information is saved, and the encoding bit rate of the intra-frame prediction mode is greatly reduced. At the same time, since the same decoding strategy is adopted as the encoding end, the design structure of the terminal video codec can be greatly simplified, and the implementation cost of the related video codec algorithm can be reduced.

下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

图10是根据一示例性实施例示出的一种基于邻域特征的帧内编码装置的框图。参照图10,该基于邻域特征的帧内编码装置1000可以包括:第一梯度分析模块1010、第一失真计算模块1020、第一预测模型确定模块1030和编码模块1040。Fig. 10 is a block diagram of an intra-frame encoding device based on neighborhood features according to an exemplary embodiment. Referring to Fig. 10 , the intra-frame encoding device 1000 based on neighborhood features may include: a first gradient analysis module 1010, a first distortion calculation module 1020, a first prediction model determination module 1030 and an encoding module 1040.

第一梯度分析模块1010,被配置为对待编码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型。The first gradient analysis module 1010 is configured to perform gradient feature analysis on reference pixels in a first neighborhood of the block to be encoded to determine a prediction model set; the prediction model set includes at least two prediction models.

第一失真计算模块1020,被配置为基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待编码块的邻域;所述第三邻域为所述第二邻域的邻域。The first distortion calculation module 1020 is configured to predict the reference pixels in the second neighborhood through the reference pixels in the third neighborhood based on the prediction model set, and determine the distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is the neighborhood of the block to be encoded; and the third neighborhood is the neighborhood of the second neighborhood.

第一预测模型确定模块1030,被配置为根据所述失真值确定目标预测模型。The first prediction model determination module 1030 is configured to determine a target prediction model according to the distortion value.

编码模块1040,被配置为根据所述目标预测模型对所述待编码块进行编码。The encoding module 1040 is configured to encode the block to be encoded according to the target prediction model.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为在所述第一邻域中确定至少一个滑动线;获取所述滑动线上各个参考像素的梯度强度和梯度方向;对所述梯度强度和梯度方向进行统计,生成对应于所述滑动线的梯度直方图;根据所述梯度直方图,从待定预测模型集合中确定所述预测模型集合;其中,所述待定预测模型集合中包括至少两个待定预测模型;各个所述待定预测模型分别与所述梯度方向相对应。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is further configured to determine at least one sliding line in the first neighborhood; obtain the gradient strength and gradient direction of each reference pixel on the sliding line; perform statistics on the gradient strength and gradient direction to generate a gradient histogram corresponding to the sliding line; determine the prediction model set from the set of pending prediction models according to the gradient histogram; wherein the set of pending prediction models includes at least two pending prediction models; and each of the pending prediction models corresponds to the gradient direction, respectively.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为通过滑动窗口在所述第一邻域中滑动对所述参考像素进行梯度特征分析;确定所述滑动窗口滑动的中心线为所述滑动线。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is further configured to perform gradient feature analysis on the reference pixel by sliding a sliding window in the first neighborhood; and determine a center line of the sliding window as the sliding line.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为所述至少一个滑动线包括第一滑动线和第二滑动线;所述对所述梯度强度和梯度方向进行统计,生成对应于所述滑动线的梯度直方图,包括:对所述第一滑动线的所述梯度强度和梯度方向进行统计,生成对应于所述第一滑动线的第一梯度直方图;对所述第二滑动线的所述梯度强度和梯度方向进行统计,生成对应于所述第二滑动线的第二梯度直方图。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is further configured such that the at least one sliding line includes a first sliding line and a second sliding line; the statistics of the gradient strength and gradient direction to generate a gradient histogram corresponding to the sliding line includes: statistics of the gradient strength and gradient direction of the first sliding line to generate a first gradient histogram corresponding to the first sliding line; statistics of the gradient strength and gradient direction of the second sliding line to generate a second gradient histogram corresponding to the second sliding line.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为根据所述第一梯度直方图,从所述待定预测模型集合中确定第一预测模型集合;根据所述第二梯度直方图,从所述待定预测模型集合中确定第二预测模型集合;根据所述第一预测模型集合和第二预测模型集合,确定所述预测模型集合。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is also configured to determine a first prediction model set from the set of pending prediction models based on the first gradient histogram; determine a second prediction model set from the set of pending prediction models based on the second gradient histogram; and determine the prediction model set based on the first prediction model set and the second prediction model set.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为所述第一预测模型集合中包括M个预测模型,所述第一预测模型集合中包括N个预测模型;其中,M大于N;所述第一滑动线比第二滑动线距离所述待编码块更近。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is also configured so that the first prediction model set includes M prediction models, and the first prediction model set includes N prediction models; wherein M is greater than N; and the first sliding line is closer to the block to be encoded than the second sliding line.

在本公开的一些示例性实施例中,该第一梯度分析模块1010,还被配置为将所述第一梯度直方图和第二梯度直方图进行叠加,得到叠加后梯度直方图;根据所述叠加后梯度直方图,从所述待定预测模型集合中确定所述预测模型集合。In some exemplary embodiments of the present disclosure, the first gradient analysis module 1010 is further configured to superimpose the first gradient histogram and the second gradient histogram to obtain a superimposed gradient histogram; and determine the prediction model set from the pending prediction model set based on the superimposed gradient histogram.

在本公开的一些示例性实施例中,该第一失真计算模块1 020,还被配置为根据所述待编码块确定所述第二邻域;根据所述第二邻域确定所述第三邻域;分别基于所述预测模型集合中各个预测模型,根据所述第三邻域中参考像素对所述第二邻域中参考像素进行预测,得到对应于第二邻域的预测像素;计算所述第二邻域的预测像素与对应的第二邻域的参考像素之间的失真,得到所述预测模型集合中各个预测模型所对应的失真值。In some exemplary embodiments of the present disclosure, the first distortion calculation module 1020 is further configured to determine the second neighborhood according to the block to be encoded; determine the third neighborhood according to the second neighborhood; predict the reference pixels in the second neighborhood according to the reference pixels in the third neighborhood based on each prediction model in the prediction model set, to obtain predicted pixels corresponding to the second neighborhood; calculate the distortion between the predicted pixels of the second neighborhood and the corresponding reference pixels of the second neighborhood, to obtain the distortion values corresponding to each prediction model in the prediction model set.

在本公开的一些示例性实施例中,该编码模块1040,还被配置为所述目标预测模型至少包括第一预测模型和第二预测模型;所述第一预测模型和第二预测模型由所述预测模型集合中选定;根据所述第一预测模型对所述待编码块进行编码,得到第一预测块;根据所述第二预测模型对所述待编码块进行编码,得到第二预测块;根据所述第一预测块和第二预测块,生成所述待编码块的编码块。In some exemplary embodiments of the present disclosure, the encoding module 1040 is also configured that the target prediction model includes at least a first prediction model and a second prediction model; the first prediction model and the second prediction model are selected from the prediction model set; the block to be encoded is encoded according to the first prediction model to obtain a first prediction block; the block to be encoded is encoded according to the second prediction model to obtain a second prediction block; and a coding block of the block to be encoded is generated based on the first prediction block and the second prediction block.

在本公开的一些示例性实施例中,该编码模块1040,还被配置为根据所述预测模型对应的失真值和/或梯度强度,确定所述第一预测模型和第二预测模型对应的权重值;基于所述权重值,对所述第一预测块和第二预测块进行加权预测,得到所述编码块。In some exemplary embodiments of the present disclosure, the encoding module 1040 is also configured to determine the weight values corresponding to the first prediction model and the second prediction model according to the distortion value and/or gradient strength corresponding to the prediction model; based on the weight value, perform weighted prediction on the first prediction block and the second prediction block to obtain the encoding block.

图11是根据一示例性实施例示出的一种基于邻域特征的帧内解码装置的框图。参照图11,该基于邻域特征的帧内解码装置1100可以包括:第二梯度分析模块1110、第二失真计算模块1 120、第二预测模型确定模块1130和解码模块1 140。Fig. 11 is a block diagram of an intra-frame decoding device based on neighborhood features according to an exemplary embodiment. Referring to Fig. 11 , the intra-frame decoding device based on neighborhood features 1100 may include: a second gradient analysis module 1110, a second distortion calculation module 1120, a second prediction model determination module 1130 and a decoding module 1140.

第二梯度分析模块1110,被配置为对待解码块的第一邻域中参考像素进行梯度特征分析,确定预测模型集合;所述预测模型集合中包括至少两个预测模型。The second gradient analysis module 1110 is configured to perform gradient feature analysis on reference pixels in a first neighborhood of the block to be decoded to determine a prediction model set; the prediction model set includes at least two prediction models.

第二失真计算模块1120,被配置为基于所述预测模型集合,通过第三邻域中参考像素对第二邻域中参考像素进行预测,确定所述预测模型集合中各个预测模型所对应的失真值;其中,所述第二邻域为所述待解码块的邻域;所述第三邻域为所述第二邻域的邻域。The second distortion calculation module 1120 is configured to predict the reference pixels in the second neighborhood through the reference pixels in the third neighborhood based on the prediction model set, and determine the distortion values corresponding to each prediction model in the prediction model set; wherein the second neighborhood is the neighborhood of the block to be decoded; and the third neighborhood is the neighborhood of the second neighborhood.

第二预测模型确定模块1130,被配置为根据所述失真值确定目标预测模型。The second prediction model determination module 1130 is configured to determine a target prediction model according to the distortion value.

解码模块1140,被配置为根据所述目标预测模型对所述待解码块进行解码。The decoding module 1140 is configured to decode the block to be decoded according to the target prediction model.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

下面参照图12来描述根据本公开的这种实施例的电子设备1200。图12显示的电子设备1200仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。The electronic device 1200 according to this embodiment of the present disclosure is described below with reference to Fig. 12. The electronic device 1200 shown in Fig. 12 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.

如图12所示,电子设备1200以通用计算设备的形式表现。电子设备1200的组件可以包括但不限于:上述至少一个处理单元1210、上述至少一个存储单元1220、连接不同系统组件(包括存储单元1220和处理单元1210)的总线1230、显示单元1240。As shown in FIG12 , the electronic device 1200 is presented in the form of a general-purpose computing device. The components of the electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one storage unit 1220, a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210), and a display unit 1240.

其中,存储单元存储有程序代码,程序代码可以被处理单元1210执行,使得处理单元1210执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施例的步骤。例如,处理单元1210可以执行如图2所示的各个步骤。The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1210 can execute the steps shown in FIG. 2.

又如,电子设备可以实现如图2所示的各个步骤。For another example, the electronic device can implement the steps shown in FIG. 2 .

存储单元1220可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)1221和/或高速缓存存储单元1222,还可以进一步包括只读存储单元(ROM)1223。The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1221 and/or a cache memory unit 1222 , and may further include a read-only memory unit (ROM) 1223 .

存储单元1220还可以包括具有一组(至少一个)程序模块1225的程序/实用工具1224,这样的程序模块1225包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 1220 may also include a program/utility 1224 having a set (at least one) of program modules 1225, such program modules 1225 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

总线1230可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。Bus 1230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

电子设备1200也可以与一个或多个外部设备1270(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1200交互的设备通信,和/或与使得该电子设备1200能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1250进行。并且,电子设备1200还可以通过网络适配器1260与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1260通过总线1230与电子设备1200的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1200使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 1200 may also communicate with one or more external devices 1270 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and/or communicate with any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input/output (I/O) interface 1250. In addition, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and/or public networks, such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and/or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施例的方法。Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

在示例性实施例中,还提供了一种包括指令的计算机可读存储介质,例如包括指令的存储器,上述指令可由装置的处理器执行以完成上述方法。可选地,计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of the device to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

在示例性实施例中,还提供一种计算机程序产品,包括计算机程序/指令,计算机程序/指令被处理器执行时实现上述实施例中的方法。In an exemplary embodiment, a computer program product is also provided, including a computer program/instruction, and when the computer program/instruction is executed by a processor, the method in the above embodiment is implemented.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (15)

1. An intra-frame encoding method based on a neighborhood feature, comprising:
performing gradient feature analysis on reference pixels in a first neighborhood of a block to be coded to determine a prediction model set, wherein the prediction model set comprises at least two prediction models;
based on the prediction model set, predicting reference pixels in a second neighborhood through reference pixels in a third neighborhood, and determining distortion values corresponding to each prediction model in the prediction model set, wherein the second neighborhood is the neighborhood of the block to be encoded;
determining a target prediction model according to the distortion value;
And encoding the block to be encoded according to the target prediction model.
2. The method of claim 1, wherein the performing gradient feature analysis on the reference pixels in the first neighborhood of the block to be encoded to determine the set of prediction models comprises:
Determining at least one sliding line in the first neighborhood;
Acquiring gradient strength and gradient direction of each reference pixel on the sliding line;
Counting the gradient strength and the gradient direction to generate a gradient histogram corresponding to the sliding line;
Determining a prediction model set from a set of undetermined prediction models according to the gradient histogram;
the set of the undetermined prediction models comprises at least two undetermined prediction models, and each undetermined prediction model corresponds to the gradient direction.
3. The method of claim 2, wherein the at least one sliding line comprises a first sliding line and a second sliding line;
The step of counting the gradient intensity and the gradient direction to generate a gradient histogram corresponding to the sliding line comprises the following steps:
Counting the gradient intensity and the gradient direction of the first sliding line, and generating a first gradient histogram corresponding to the first sliding line;
and counting the gradient intensity and the gradient direction of the second sliding line, and generating a second gradient histogram corresponding to the second sliding line.
4. A method according to claim 3, wherein said determining said set of predictive models from a set of predictive models to be determined from said gradient histogram comprises:
determining a first prediction model set from the undetermined prediction model sets according to the first gradient histogram;
Determining a second prediction model set from the undetermined prediction model sets according to the second gradient histogram;
And determining the prediction model set according to the first prediction model set and the second prediction model set.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
The first prediction model set comprises M prediction models, the first prediction model set comprises N prediction models, M is larger than N, and the first sliding line is closer to the block to be encoded than the second sliding line.
6. A method according to claim 3, wherein said determining said set of predictive models from a set of predictive models to be determined from said gradient histogram comprises:
Superposing the first gradient histogram and the second gradient histogram to obtain a superposed gradient histogram;
and determining the prediction model set from the undetermined prediction model set according to the superimposed gradient histogram.
7. The method according to claim 1, wherein the predicting, based on the prediction model set, the reference pixel in the second neighborhood by the reference pixel in the third neighborhood, and determining the distortion value corresponding to each prediction model in the prediction model set, includes:
determining the second neighborhood according to the block to be coded;
Determining the third neighborhood according to the second neighborhood;
predicting the reference pixels in the second neighborhood according to the reference pixels in the third neighborhood based on each prediction model in the prediction model set respectively to obtain prediction pixels corresponding to the second neighborhood;
and calculating the distortion between the predicted pixels of the second neighborhood and the corresponding reference pixels of the second neighborhood to obtain distortion values corresponding to each prediction model in the prediction model set.
8. The method of claim 1, wherein the target prediction model comprises at least a first prediction model and a second prediction model, the first prediction model and the second prediction model selected from the set of prediction models;
The encoding the block to be encoded according to the target prediction model includes:
Coding the block to be coded according to the first prediction model to obtain a first prediction block;
Coding the block to be coded according to the second prediction model to obtain a second prediction block;
and generating the coding block of the block to be coded according to the first prediction block and the second prediction block.
9. The method of claim 8, wherein generating the encoded block of the block to be encoded from the first and second prediction blocks comprises:
determining weight values corresponding to the first prediction model and the second prediction model according to the distortion values and/or gradient strength corresponding to the prediction models;
And carrying out weighted prediction on the first prediction block and the second prediction block based on the weight value to obtain the coding block.
10. An intra-frame decoding method based on a neighborhood feature, comprising:
performing gradient feature analysis on reference pixels in a first neighborhood of a block to be decoded to determine a prediction model set, wherein the prediction model set comprises at least two prediction models;
based on the prediction model set, predicting reference pixels in a second neighborhood through reference pixels in a third neighborhood, and determining distortion values corresponding to each prediction model in the prediction model set, wherein the second neighborhood is the neighborhood of the block to be decoded;
determining a target prediction model according to the distortion value;
and decoding the block to be decoded according to the target prediction model.
11. An intra-coding apparatus based on neighborhood characteristics, comprising:
the first gradient analysis module is configured to perform gradient feature analysis on reference pixels in a first neighborhood of a block to be coded and determine a prediction model set, wherein the prediction model set comprises at least two prediction models;
the first distortion calculation module is configured to predict reference pixels in a second neighborhood through reference pixels in a third neighborhood based on the prediction model set, and determine distortion values corresponding to each prediction model in the prediction model set;
A first predictive model determination module configured to determine a target predictive model from the distortion value;
and the encoding module is configured to encode the block to be encoded according to the target prediction model.
12. An intra decoding apparatus based on a neighborhood feature, comprising:
the second gradient analysis module is configured to perform gradient feature analysis on reference pixels in a first neighborhood of the block to be decoded and determine a prediction model set, wherein the prediction model set comprises at least two prediction models;
The second distortion calculation module is configured to predict reference pixels in a second neighborhood through reference pixels in a third neighborhood based on the prediction model set, and determine distortion values corresponding to each prediction model in the prediction model set;
A second predictive model determination module configured to determine a target predictive model from the distortion value;
and the decoding module is configured to decode the block to be decoded according to the target prediction model.
13. An electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the executable instructions to implement the neighborhood feature based intra-coding method of any of claims 1 to 9 or the neighborhood feature based intra-decoding method of claim 10.
14. A computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the neighborhood feature-based intra-coding method of any one of claims 1 to 9 or the neighborhood feature-based intra-decoding method of claim 10.
15. A computer program product comprising computer program/instructions which, when executed by a processor, implement the neighborhood feature based intra-coding method of any one of claims 1 to 9 or the neighborhood feature based intra-decoding method of claim 10.
CN202411427210.9A 2024-10-12 2024-10-12 Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features Pending CN119299702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411427210.9A CN119299702A (en) 2024-10-12 2024-10-12 Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411427210.9A CN119299702A (en) 2024-10-12 2024-10-12 Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features

Publications (1)

Publication Number Publication Date
CN119299702A true CN119299702A (en) 2025-01-10

Family

ID=94158700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411427210.9A Pending CN119299702A (en) 2024-10-12 2024-10-12 Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features

Country Status (1)

Country Link
CN (1) CN119299702A (en)

Similar Documents

Publication Publication Date Title
US12177472B2 (en) Image encoding method and apparatus, and image decoding method and apparatus
US10455229B2 (en) Prediction mode selection method, apparatus and device
CN104427345A (en) Motion vector acquisition method, acquisition device, video codec and method thereof
WO2016054937A1 (en) Three-dimensional image coding method, three-dimensional image decoding method and related device
CN110692241B (en) Diverse motion using multiple global motion models
CN111246212B (en) Geometric partitioning mode prediction method and device based on encoding and decoding end, storage medium and terminal
US20220030233A1 (en) Interpolation filtering method and apparatus for intra-frame prediction, medium, and electronic device
CN117528069A (en) Displacement vector prediction method, device and equipment
CN104333758A (en) Depth map prediction method, pixel detection method and related devices
CN119299702A (en) Intra-frame encoding and decoding method, device, equipment and storage medium based on neighborhood features
WO2024051757A1 (en) Information processing method and apparatus, electronic device and computer readable medium
WO2021056215A1 (en) Motion estimation method and system, and storage medium
CN112565789B (en) Video decoding and encoding method, device, computer readable medium and electronic equipment
CN110446050A (en) Intra-frame prediction method, device, equipment and computer readable storage medium
CN103916672A (en) Data coding and decoding method, related device and system
US20250037320A1 (en) Optimal sub-mesh encoding order for initial vertex selection in position coding
HK40041013A (en) Video decoding and encoding method, apparatus, computer readable medium, and electronic device
HK40041013B (en) Video decoding and encoding method, apparatus, computer readable medium, and electronic device
CN103826134B (en) Image intra-frame prediction method and device
CN119676440A (en) Motion vector list construction method, device, electronic device and program product
CN115278237A (en) Video intra-frame coding method, encoder and medium
CN119996655A (en) Video information processing method, system, electronic device and storage medium
CN115883825A (en) Video processing method and device, electronic equipment and storage medium
CN119402643A (en) Intra-frame prediction method, device, electronic device and computer program product
CN119402675A (en) Decoding error block processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination