Movatterモバイル変換


[0]ホーム

URL:


CN116055730A - Intra-frame prediction method, device and storage medium - Google Patents

Intra-frame prediction method, device and storage medium
Download PDF

Info

Publication number
CN116055730A
CN116055730ACN202211730156.6ACN202211730156ACN116055730ACN 116055730 ACN116055730 ACN 116055730ACN 202211730156 ACN202211730156 ACN 202211730156ACN 116055730 ACN116055730 ACN 116055730A
Authority
CN
China
Prior art keywords
reference line
samples
prediction
current block
line
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
CN202211730156.6A
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.)
Chongqing Zhongxing Micro Artificial Intelligence Chip Technology Co ltd
Vimicro Corp
Original Assignee
Chongqing Zhongxing Micro Artificial Intelligence Chip Technology Co ltd
Vimicro Corp
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 Chongqing Zhongxing Micro Artificial Intelligence Chip Technology Co ltd, Vimicro CorpfiledCriticalChongqing Zhongxing Micro Artificial Intelligence Chip Technology Co ltd
Priority to CN202211730156.6ApriorityCriticalpatent/CN116055730A/en
Publication of CN116055730ApublicationCriticalpatent/CN116055730A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The application provides an intra prediction method, an intra prediction device and a storage medium. The method comprises the following steps: obtaining reference samples on a plurality of reference lines of the current block, wherein the plurality of reference lines comprise a first reference line, a second reference line and a third reference line, and the reference samples on the first reference line, the second reference line and the third reference line are respectively obtained based on sample filling of adjacent rows or adjacent columns of the current block; under the condition that the prediction mode of the current block is an angle mode, median filtering is carried out on reference samples on the first reference line, the second reference line and the third reference line to obtain a fourth reference line; and performing intra-frame prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line to obtain a prediction sample of the current block. The intra-frame prediction method provided by the application can effectively avoid the problem that intra-frame prediction encounters noise, reduce pixel residual errors and improve compression rate.

Description

Translated fromChinese
帧内预测方法、装置及存储介质Intra prediction method, device and storage medium

技术领域technical field

本申请涉及图像处理技术领域,具体涉及一种帧内预测方法、装置及存储介质。The present application relates to the technical field of image processing, and in particular to an intra prediction method, device and storage medium.

背景技术Background technique

随着互联网技术的快速发展,视频技术已被广泛应用在各行各业。例如,如可视会议、网上购物、视频教学、远程医疗、网上聊天、可视咨询等业务。由于视频文件传输的数据量较大,需要采用数据压缩技术,以压缩形式进行存储、传输,既节约了存储空间,又提高了通信干线的传输效率,同时也可使计算机实时处理音频、视频信息,以保证播放出高质量的视频、音频节目。With the rapid development of Internet technology, video technology has been widely used in various industries. For example, services such as video conferencing, online shopping, video teaching, telemedicine, online chat, and visual consultation. Due to the large amount of data transmitted by video files, it is necessary to use data compression technology to store and transmit in compressed form, which not only saves storage space, but also improves the transmission efficiency of communication trunk lines, and also enables computers to process audio and video information in real time , to ensure that high-quality video and audio programs are played.

视频编解码是一种常见的是视频处理技术,其采用算法将视频数据的冗余信息去除,对图像进行压缩、存储及传输,再将视频进行解码及格式转换,以达到带宽和存储容量的要求。其中,帧内预测编码是指在当前帧中利用相邻的已重构块的边界像素作为参考像素来预测当前块的像素,从而达到去除空间冗余的目的,特别是当帧间预测的使用受限时,帧内预测保证了视频压缩的效率。Video codec is a common video processing technology, which uses algorithms to remove redundant information of video data, compresses, stores and transmits images, and then decodes and converts video formats to achieve maximum bandwidth and storage capacity. Require. Among them, intra-frame prediction coding refers to using the boundary pixels of adjacent reconstructed blocks as reference pixels in the current frame to predict the pixels of the current block, so as to achieve the purpose of removing spatial redundancy, especially when inter-frame prediction is used When limited, intra prediction guarantees the efficiency of video compression.

然而,由于数字图像在其形成、传输记录的过程中经常会受到很多噪声的污染,在进行帧内预测时,采用的参考像素有可能会遇到噪点,使得当前像素的预测值与实际值偏差较大,进而导致像素残差较大,压缩率偏低。However, since digital images are often polluted by a lot of noise in the process of formation, transmission and recording, the reference pixels used in intra prediction may encounter noise, which makes the predicted value of the current pixel deviate from the actual value. Larger, which in turn leads to larger pixel residuals and lower compression ratio.

发明内容Contents of the invention

有鉴于此,本申请的实施例提供一种帧内预测方法、装置及存储介质,旨在减小像素残差,提高压缩率。In view of this, the embodiments of the present application provide an intra prediction method, device and storage medium, aiming at reducing pixel residuals and improving compression ratio.

本申请的第一方面提供了一种帧内预测方法,包括:获取当前块的多个参考线上的参考样本,多个参考线包括第一参考线、第二参考线和第三参考线,其中,第一参考线、第二参考线和第三参考线上的参考样本分别是基于当前块的相邻行或相邻列的样本填充得到的;在当前块的预测模式为角度模式的情况下,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线;根据角度模式对应的预测角度和第四参考线对当前块执行帧内预测,得到当前块的预测样本。The first aspect of the present application provides an intra-frame prediction method, including: acquiring reference samples on multiple reference lines of the current block, where the multiple reference lines include a first reference line, a second reference line, and a third reference line, Among them, the reference samples on the first reference line, the second reference line and the third reference line are respectively obtained based on the sample filling of the adjacent row or adjacent column of the current block; when the prediction mode of the current block is the angle mode Next, perform median filtering on the reference samples on the first reference line, the second reference line, and the third reference line to obtain the fourth reference line; perform intra-frame processing on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line Prediction, get the prediction sample of the current block.

在本申请某些实施例中,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线,包括:当多个参考线为多个参考行时,分别对至少一列的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本;当多个参考线为多个参考列时,分别对至少一行的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本。In some embodiments of the present application, median filtering is performed on the reference samples on the first reference line, the second reference line, and the third reference line to obtain the fourth reference line, including: when multiple reference lines are multiple reference lines When rowing, perform median filtering on the reference samples on the first reference line, the reference samples on the second reference line, and the reference samples on the third reference line of at least one column respectively, to obtain at least one median filtering result, based on at least one The median filtering result obtains the reference samples on the fourth reference line; when the multiple reference lines are multiple reference columns, the reference samples on the first reference line of at least one row, the reference samples on the second reference line, and the first Median filtering is performed on the reference samples on the three reference lines to obtain at least one median filtering result, and the reference samples on the fourth reference line are obtained based on the at least one median filtering result.

在本申请某些实施例中,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线,还包括:当多个参考线为多个参考行时,获取位于相同列的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本;当多个参考线为多个参考列时,获取位于相同行的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本。In some embodiments of the present application, median filtering is performed on the reference samples on the first reference line, the second reference line, and the third reference line to obtain the fourth reference line, which further includes: when the multiple reference lines are multiple When referring to the row, obtain the average value of the reference samples on at least two of the first reference line, the second reference line and the third reference line in the same column, and use the obtained average value as the value on the fourth reference line Reference samples; when multiple reference lines are multiple reference columns, obtain the average value of the reference samples on at least two of the first reference line, the second reference line and the third reference line in the same row, and The resulting average is used as a reference sample on the fourth reference line.

在本申请某些实施例中,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线,包括:使用第一参考线、第二参考线及第三参考线中的任何一个参考线上的参考样本作为第四参考线上的参考样本。In some embodiments of the present application, median filtering is performed on the reference samples on the first reference line, the second reference line, and the third reference line to obtain the fourth reference line, including: using the first reference line, the second reference line The reference sample on any one of the reference line and the third reference line is used as the reference sample on the fourth reference line.

在本申请某些实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别为0、1、3、2。In some embodiments of the present application, the index values of the first reference line, the second reference line, the third reference line and the fourth reference line are 0, 1, 3, and 2, respectively.

在本申请某些实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别使用二进制值00、01、10、11指示。In some embodiments of the present application, the index values of the first reference line, the second reference line, the third reference line, and the fourth reference line are indicated bybinary values 00, 01, 10, and 11, respectively.

在本申请某些实施例中,方法还包括:在率失真优化过程,分别遍历第一参考线、第二参考线、第三参考线和第四参考线,以确定每一种角度模式对应的一个最优参考线。In some embodiments of the present application, the method further includes: during the rate-distortion optimization process, respectively traversing the first reference line, the second reference line, the third reference line, and the fourth reference line to determine the corresponding An optimal reference line.

本申请的第二方面提供了一种编码方法,包括:基于第一方面提供的帧内预测方法对待编码图像进行帧内预测,得到待编码图像中当前块的帧内预测样本;基于帧内预测得到的帧内预测样本进行后续编码处理,得到待编码图像对应的编码数据。The second aspect of the present application provides an encoding method, including: performing intra prediction on the image to be encoded based on the intra prediction method provided in the first aspect to obtain an intra prediction sample of the current block in the image to be encoded; based on the intra prediction The obtained intra-frame prediction samples are subjected to subsequent encoding processing to obtain encoded data corresponding to the image to be encoded.

本申请的第三方面提供了一种解码方法,包括:接收编码端发送的编码数据;基于第一方面提供的帧内预测方法对编码数据进行帧内预测,得到当前块的帧内预测样本。A third aspect of the present application provides a decoding method, including: receiving encoded data sent by an encoding end; performing intra prediction on the encoded data based on the intra prediction method provided in the first aspect, to obtain an intra prediction sample of a current block.

本申请的第四方面提供了一种帧内预测装置,包括:获取模块,用于获取当前块的多个参考线上的参考样本,多个参考线包括第一参考线、第二参考线和第三参考线,其中,第一参考线、第二参考线和第三参考线上的参考样本分别是基于当前块的相邻行或相邻列的样本填充得到的;滤波模块,用于在所述当前块的预测模式为角度模式的情况下,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线;预测模块,用于根据角度模式对应的预测角度和第四参考线对当前块执行帧内预测,得到当前块的预测样本。The fourth aspect of the present application provides an intra-frame prediction device, including: an acquisition module, configured to acquire reference samples on multiple reference lines of the current block, the multiple reference lines include a first reference line, a second reference line, and The third reference line, wherein, the reference samples on the first reference line, the second reference line and the third reference line are respectively obtained based on the sample filling of adjacent rows or adjacent columns of the current block; the filtering module is used for When the prediction mode of the current block is an angle mode, perform median filtering on the reference samples on the first reference line, the second reference line, and the third reference line to obtain a fourth reference line; the prediction module is used to obtain the fourth reference line according to The prediction angle corresponding to the angle mode and the fourth reference line perform intra prediction on the current block to obtain prediction samples of the current block.

本申请的第五方面提供了一种电子设备,包括:存储器,用于存储计算机指令;一个或多个处理器,用于执行所述计算机指令,以实现第一方面提供的帧内预测方法、或第二方面提供的编码方法、或第三方面提供的解码方法。A fifth aspect of the present application provides an electronic device, including: a memory for storing computer instructions; one or more processors for executing the computer instructions to implement the intra prediction method provided in the first aspect, Or the encoding method provided by the second aspect, or the decoding method provided by the third aspect.

本申请的第六方面提供了一种计算机可读存储介质,存储有计算机指令,当计算机指令被处理器执行时,实现本申请的第一方面提供的帧内预测方法、或者本申请的第二方面提供的编码方法、或者本申请的第三方面提供的解码方法。The sixth aspect of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the intra prediction method provided in the first aspect of the present application, or the second aspect of the present application is implemented. The encoding method provided in the aspect, or the decoding method provided in the third aspect of the present application.

本申请所提供的帧内预测技术方案,在所述当前块的预测模式为角度模式的情况下,将第一参考线、第二参考线和第三参考线上的参考样本进行中值滤波,得到第四参考线,并根据角度模式对应的预测角度和第四参考线对当前块进行帧内预测,由于第四参考线上的参考样本包括多个不同参考线上的参考样本的中值,可以有效避免帧内预测遇到噪点的问题,减小像素残差,提高压缩率。In the intra prediction technical solution provided by this application, when the prediction mode of the current block is an angle mode, median filtering is performed on the reference samples on the first reference line, the second reference line and the third reference line, Obtain the fourth reference line, and perform intra-frame prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line, since the reference samples on the fourth reference line include median values of reference samples on multiple different reference lines, It can effectively avoid the problem of intra-frame prediction encountering noise, reduce pixel residuals, and improve compression ratio.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能构成对本申请的限定。It should be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the application.

附图说明Description of drawings

为了使本申请实施例的目的、技术方案及优点更加明确,以下将结合附图进一步详细介绍本申请的实施例。应当理解,附图构成说明书的一部分,与本申请的实施例共同用于解释本申请,并不构成对本申请的限定。除另有说明的情况外,在附图中,相同的符号和编号通常代表相同的步骤或部件。In order to make the purpose, technical solutions, and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be understood that the drawings constitute a part of the description, and are used together with the embodiments of the application to explain the application, and do not constitute a limitation to the application. In the drawings, the same symbols and numbers generally represent the same steps or components unless otherwise stated.

图1所示为本申请一实施例提供的帧内预测方法的流程示意图。FIG. 1 is a schematic flowchart of an intra prediction method provided by an embodiment of the present application.

图2所示为帧内预测模式的示意图。FIG. 2 is a schematic diagram of an intra prediction mode.

图3a所示为本申请一实施例提供的填充有参考样本的多个参考线的示意图。Fig. 3a is a schematic diagram of multiple reference lines filled with reference samples provided by an embodiment of the present application.

图3b所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。Fig. 3b is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application.

图3c所示为intraPredAngle查询表格。Figure 3c shows the intraPredAngle query form.

图4a所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。Fig. 4a is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application.

图4b所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。Fig. 4b is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application.

图5所示为本申请实施例提供的一示例性帧内预测方法的流程示意图。FIG. 5 is a schematic flowchart of an exemplary intra prediction method provided by an embodiment of the present application.

图6所示为本申请实施例提供的另一示例性帧内预测方法的流程示意图。FIG. 6 is a schematic flowchart of another exemplary intra prediction method provided by the embodiment of the present application.

图7a所示为本申请实施例提供的一种示例性的填充有参考样本的第一参考线的示意图。Fig. 7a is a schematic diagram of an exemplary first reference line filled with reference samples according to an embodiment of the present application.

图7b所示为本申请实施例提供的一示例性的填充有参考样本的第二参考线的示意图。Fig. 7b is a schematic diagram of an exemplary second reference line filled with reference samples provided by the embodiment of the present application.

图7c所示为本申请实施例提供的一示例性的填充有参考样本的第三参考线的示意图。Fig. 7c is a schematic diagram of an exemplary third reference line filled with reference samples provided by the embodiment of the present application.

图8所示为本申请一实施例提供的帧内预测装置的结构示意图。FIG. 8 is a schematic structural diagram of an intra prediction device provided by an embodiment of the present application.

图9所示为本申请一实施例提供的一种示例性的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an exemplary electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

帧内预测技术是利用同一帧中相邻像素的相关性,利用当前变换块相邻区域的重建像素预测当前变换块中像素的技术。通过帧内预测之后,再将预测残差通过后续的变换、量化和熵编码等模块进一步处理生成最终的码流,可以有效地去除视频的空间冗余。The intra-frame prediction technology is a technology that uses the correlation of adjacent pixels in the same frame to predict the pixels in the current transformation block by using the reconstructed pixels in the adjacent area of the current transformation block. After intra-frame prediction, the prediction residual is further processed through subsequent modules such as transformation, quantization, and entropy coding to generate the final code stream, which can effectively remove the spatial redundancy of the video.

H.266,也被称为多功能视频编码(Versatile Video Coding,简称VVC)是最新一代视频编码标准。在VVC中,帧内预测模式包括65个角度模式、Planar模式以及DC模式,共67个传统模式。为了提高预测的精度,进一步利用相邻块和当前块的空间相关性,VVC中采用了多参考行(MRL)技术。在进行帧内预测时,除了可以使用相邻第一行作为参考采样,还可以使用相邻第二行以及第四行作为参考采样。H.266, also known as Versatile Video Coding (VVC for short) is the latest generation of video coding standards. In VVC, the intra prediction mode includes 65 angle modes, Planar mode and DC mode, a total of 67 traditional modes. In order to improve the accuracy of prediction and further utilize the spatial correlation between adjacent blocks and the current block, multiple reference lines (MRL) technology is adopted in VVC. When intra-frame prediction is performed, in addition to using the adjacent first row as a reference sample, the adjacent second row and fourth row may also be used as reference samples.

然而,由于数字图像在其形成、传输记录的过程中经常会受到很多噪声的污染。经发明人长期的研究发现,在进行帧内预测时,仅仅采用一个参考线上的参考像素对当前块进行预测有可能会遇到噪点,使得当前像素的预测值与实际值偏差较大,进而导致像素残差值较大,压缩率偏低的问题。However, digital images are often polluted by a lot of noise in the process of their formation, transmission and recording. After long-term research by the inventors, it is found that when performing intra-frame prediction, only using a reference pixel on the reference line to predict the current block may encounter noise, which makes the predicted value of the current pixel deviate from the actual value, and then This leads to the problem that the pixel residual value is large and the compression rate is low.

示例性方法exemplary method

下面将结合本申请实施例中的附图,对本申请的实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。本领域普通技术人员基于本申请中的实施例获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.

图1所示为本申请一实施例提供的帧内预测方法的流程示意图。该方法可以由视频编码器执行或视频解码器执行。该方法描述为一系列的步骤或操作,应当理解的是,该方法可以以各种顺序执行和/或同时发生,不限于图1所示的执行顺序。具有多个图像帧的视频数据流使用视频编码器或视频解码器时,可以采用如下步骤的方法对当前块进行帧内预测。如图1所示,该方法可以包括如下内容。FIG. 1 is a schematic flowchart of an intra prediction method provided by an embodiment of the present application. The method can be performed by a video encoder or by a video decoder. The method is described as a series of steps or operations. It should be understood that the method may be executed in various orders and/or concurrently, and is not limited to the execution order shown in FIG. 1 . When a video data stream with multiple image frames uses a video encoder or a video decoder, the following steps may be used to perform intra-frame prediction on the current block. As shown in Fig. 1, the method may include the following contents.

S110:获取当前块的多个参考线上的参考样本,多个参考线包括第一参考线、第二参考线和第三参考线,其中,第一参考线、第二参考线和第三参考线上的参考样本分别是基于当前块的相邻行或相邻列的样本填充得到的。S110: Obtain reference samples on multiple reference lines of the current block, where the multiple reference lines include a first reference line, a second reference line, and a third reference line, wherein the first reference line, the second reference line, and the third reference line The reference samples on the line are respectively filled based on the samples of adjacent rows or adjacent columns of the current block.

在对图像执行帧内预测的过程,以块为单位进行。可以根据预测模式将编码块(或预测块)分割成变换块,包括但不限于递归或非递归的四叉树拆分和预定义模式拆分等,本申请实施例对变换块的分割形式不进行限定。当前块(或变换块)可以具有不同的尺寸,例如,16×16,8×8,4×4等。当前块(或变换块)可以是正方形也可以是矩形,本申请实施例对当前块的形状和尺寸不进行限定。In the process of performing intra prediction on an image, it is performed in units of blocks. The coding block (or prediction block) can be divided into transformation blocks according to the prediction mode, including but not limited to recursive or non-recursive quadtree splitting and predefined mode splitting, etc. The embodiment of the present application does not change the splitting form of the transform block To limit. The current block (or transform block) may have different sizes, eg, 16x16, 8x8, 4x4, etc. The current block (or transformation block) may be a square or a rectangle, and the embodiment of the present application does not limit the shape and size of the current block.

在帧内预测中,利用邻近当前块的已完成重构的样本来对当前块执行预测,其中用于帧内预测的相邻的样本称为参考样本。In intra prediction, prediction is performed on the current block using reconstructed samples adjacent to the current block, where the adjacent samples used for intra prediction are called reference samples.

具体地,获取当前块的多个参考线的参考样本,多个参考线包括第一参考线、第二参考线和第三参考线。在一实施例中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一行,第二行以及第四行上的样本通过填充得到的。在一实施例中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一列,第二列以及第四列上的样本填充得到的。Specifically, reference samples of multiple reference lines of the current block are acquired, and the multiple reference lines include a first reference line, a second reference line, and a third reference line. In an embodiment, the reference samples on the first reference line, the second reference line, and the third reference line are obtained by padding based on samples on the first row, the second row, and the fourth row adjacent to the current block, respectively. . In an embodiment, the reference samples on the first reference line, the second reference line and the third reference line are respectively filled based on the samples on the first column, the second column and the fourth column adjacent to the current block.

可选地,在一实施例中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一行,第二行以及第三行上的样本填充得到的。在一实施例中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一列,第二列以及第三列上的样本填充得到的。Optionally, in an embodiment, the reference samples on the first reference line, the second reference line and the third reference line are respectively based on the samples on the first row, the second row and the third row adjacent to the current block filled to get. In an embodiment, the reference samples on the first reference line, the second reference line and the third reference line are respectively filled based on the samples on the first column, the second column and the third column adjacent to the current block.

S120:在当前块的预测模式为角度模式的情况下,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线。S120: When the prediction mode of the current block is the angle mode, perform median filtering on the reference samples on the first reference line, the second reference line and the third reference line to obtain a fourth reference line.

在当前块的预测模式为角度模式的情况下,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线。第四参考线的参考样本由第一参考线、第二参考线及第三参考线上的参考样本的中值进行填充得到的。中值又称中位数,是指将统计总体当中的各个变量值按大小顺序排列起来,形成一个数列,处于变量数列中间位置的变量值就称为中位数。通过这种方式,在一些情况下,第四参考线上的参考样本可以包括第一参考线、第二参考线及第三参考线上的样本。When the prediction mode of the current block is the angle mode, median filtering is performed on the reference samples on the first reference line, the second reference line and the third reference line to obtain the fourth reference line. The reference samples on the fourth reference line are obtained by filling the median values of the reference samples on the first reference line, the second reference line and the third reference line. The median, also known as the median, refers to the arrangement of the variable values in the statistical population in order of size to form a series, and the variable value in the middle of the variable series is called the median. In this way, in some cases, the reference samples on the fourth reference line may include samples on the first reference line, the second reference line, and the third reference line.

S130:根据角度模式对应的预测角度和第四参考线对当前块执行帧内预测,得到当前块的预测样本。S130: Perform intra prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line, to obtain prediction samples of the current block.

针对一角度模式下,采用第四参考线作为该角度模式的参考线,基于角度模式对应的预测角度和第四参考线上的参考样本,对当前块进行预测得到当前块的预测样本。其中,该角度模式可以是多种角度模式中的任何一个。For an angle mode, the fourth reference line is used as the reference line of the angle mode, and based on the prediction angle corresponding to the angle mode and the reference samples on the fourth reference line, the current block is predicted to obtain the prediction samples of the current block. Wherein, the angle mode can be any one of various angle modes.

本实施例提供的帧内预测方法,在原有的第一参考线、第二参考线及第三参考线的基础上增加了一个第四参考线,采用第一参考线、第二参考线及第三参考线的参考样本的中值填充为第四参考线的参考样本。通过这种方式,当采用第四参考线的参考样本对当前块进行预测时,当前块的预测样本不仅是采用某一个参考线的参考样本,而是采用了多个参考线的参考样本的中值,从而有效地避免了帧内预测遇到噪点的问题,有利于减少噪声,提高图像质量。另外,还可以减小像素残差,提高压缩率。In the intra prediction method provided in this embodiment, a fourth reference line is added on the basis of the original first reference line, second reference line and third reference line, and the first reference line, the second reference line and the The median of the reference samples for the third reference line is filled as the reference sample for the fourth reference line. In this way, when the reference sample of the fourth reference line is used to predict the current block, the prediction sample of the current block is not only the reference sample of a certain reference line, but the middle of the reference samples of multiple reference lines. value, thus effectively avoiding the problem of intra-frame prediction encountering noise, which is conducive to reducing noise and improving image quality. In addition, it can also reduce the pixel residual and improve the compression rate.

图2所示为帧内预测模式的示意图。FIG. 2 is a schematic diagram of an intra prediction mode.

如图2所示,根据H.266/VVC视频编码标准,针对亮度分量的帧内预测模式增加到67种,包括planar模式、DC模式以及65种角度模式。在进行帧内预测时,需要在多个帧内预测模式中确定当前块的最佳预测模式。对每一种候选的预测模式进行遍历,计算预测值,然后,根据实际值与预测值的差值得到残差值,将残差值最小的预测模式作为最佳预测模式,最后,采用最佳预测模式对当前块进行帧内预测。As shown in FIG. 2 , according to the H.266/VVC video coding standard, there are 67 intra-frame prediction modes for luma components, including planar mode, DC mode and 65 angle modes. When intra-frame prediction is performed, it is necessary to determine the best prediction mode of the current block among multiple intra-frame prediction modes. Traverse each candidate prediction mode, calculate the prediction value, and then obtain the residual value according to the difference between the actual value and the predicted value, and use the prediction mode with the smallest residual value as the best prediction mode, and finally, use the best The prediction mode performs intra prediction on the current block.

图3a所示为本申请一实施例提供的填充有参考样本的多个参考线的示意图。图3b所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。Fig. 3a is a schematic diagram of multiple reference lines filled with reference samples provided by an embodiment of the present application. Fig. 3b is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application.

如图3a所示,下面以帧内模式的编号值大于或等于34的垂直类模式为例,对多个参考线上的参考样本的填充过程进行说明。其中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一行,第二行以及第四行上的样本通过填充得到的。其中,第一参考线、第二参考线及第三参考线的索引号取值分别为0、1、3。As shown in FIG. 3 a , the filling process of reference samples on multiple reference lines will be described below by taking the vertical mode whose number value of the intra mode is greater than or equal to 34 as an example. Wherein, the reference samples on the first reference line, the second reference line and the third reference line are respectively based on the first row adjacent to the current block, and the samples on the second row and the fourth row are obtained by padding. Wherein, the index numbers of the first reference line, the second reference line and the third reference line take values of 0, 1, and 3 respectively.

参考线上的各个位置处的参考样本的填充可以基于如下公式:The filling of reference samples at various positions on the reference line can be based on the following formula:

ref[x]=p[-1-refIdx+x][-1-refIdx],x=0..nTbW+refIdx+1ref[x]=p[-1-refIdx+x][-1-refIdx], x=0..nTbW+refIdx+1

其中,nTbW为当前块的宽度,refldx为参考线的索引号。Among them, nTbW is the width of the current block, and refldx is the index number of the reference line.

特别的,对于编号34-49的角度模式,需要将左侧的相邻列的样本投影到上侧参考线的左侧,以扩展上侧的参考线的参考样本,其扩展的样本的填充过程基于如下公式:In particular, for the angle modes numbered 34-49, it is necessary to project the samples of the adjacent columns on the left to the left of the upper reference line to expand the reference samples of the upper reference line, and the filling process of the expanded samples Based on the following formula:

ref[x]=p[-1-refIdx][-1-refIdx+Min((x*invAngle+256)>>9,nTbH)],x=-nTbH..-1ref[x]=p[-1-refIdx][-1-refIdx+Min((x*invAngle+256)>>9,nTbH)], x=-nTbH..-1

其中,nTbH为当前块的高度,invAngle基于如下公式:Among them, nTbH is the height of the current block, and invAngle is based on the following formula:

Figure BDA0004031263640000061
Figure BDA0004031263640000061

上述公式中的IntraPreAngle可以通过查询图4所示的表格可得,图4所示的表格也可以参考H.266编码标准中Table24-specification of intraPreAngle的内容。IntraPreAngle in the above formula can be obtained by querying the table shown in Figure 4, and the table shown in Figure 4 can also refer to the content of Table24-specification of intraPreAngle in the H.266 coding standard.

另外,其它还没有填充的参考像素,则通过以下公式求得。In addition, other reference pixels that have not been filled can be obtained by the following formula.

ref[x]=p[-1-refIdx+x][-1-refIdx],x=nTbW+2+refIdx..refW+refIdxref[x]=p[-1-refIdx+x][-1-refIdx], x=nTbW+2+refIdx..refW+refIdx

ref[refW+refIdx+x]=p[-1+refW][-1-refIdx],x=1..(Max(1,nTbW/nTbH)*refIdx+1)ref[refW+refIdx+x]=p[-1+refW][-1-refIdx], x=1..(Max(1,nTbW/nTbH)*refIdx+1)

其中,refW为邻居样本的宽度,refW=2*nTbW。Wherein, refW is the width of neighbor samples, refW=2*nTbW.

基于以上所述的参考样本的填充过程,将当前块相邻的第一行的样本填充为第一参考线上的参考样本,将当前块相邻的第二行的样本填充为第二参考线上的参考样本,将当前块相邻的第四行的样本填充为第三参考线上的参考样本。Based on the filling process of the reference samples described above, the samples of the first row adjacent to the current block are filled as the reference samples on the first reference line, and the samples of the second row adjacent to the current block are filled as the second reference line The reference samples on the above, the samples of the fourth row adjacent to the current block are filled as the reference samples on the third reference line.

如图3b所示,下面以帧内模式的编号值小于34的水平类模式为例,对多个参考线上的参考样本的填充过程进行说明。其中,第一参考线、第二参考线和第三参考线上的参考样本分别基于与当前块相邻的第一列,第二列以及第四列上的样本通过填充得到的。其中,第一参考线、第二参考线及第三参考线的索引号取值分别为0、1、3。As shown in FIG. 3 b , the filling process of reference samples on multiple reference lines will be described below by taking the horizontal mode whose number value of the intra mode is less than 34 as an example. Wherein, the reference samples on the first reference line, the second reference line and the third reference line are respectively based on the first column adjacent to the current block, and the samples on the second column and the fourth column are obtained by padding. Wherein, the index numbers of the first reference line, the second reference line and the third reference line take values of 0, 1, and 3 respectively.

参考线上的各个位置处的参考样本的填充基于如下公式:The filling of the reference samples at various positions on the reference line is based on the following formula:

ref[x]=p[-1-refIdx][-1-refIdx+x],x=0..nTbH+refIdx+1ref[x]=p[-1-refIdx][-1-refIdx+x], x=0..nTbH+refIdx+1

其中,nTbH为当前块的高度,refldx为参考线的索引号。Among them, nTbH is the height of the current block, and refldx is the index number of the reference line.

特别的,对于编号19-33的角度模式,需要将上侧的相邻行的样本投影到左侧参考线的上侧,以扩展左侧的参考线的参考样本,其扩展的样本的填充过程基于如下公式:In particular, for the angle modes numbered 19-33, it is necessary to project the samples of the adjacent rows on the upper side to the upper side of the left reference line to expand the reference samples of the left reference line, and the filling process of the expanded samples Based on the following formula:

ref[x]=p[-1-refIdx+Min((x*invAngle+256)>>9,nTbW)][-1-refIdx],with x=-nTbW..-1ref[x]=p[-1-refIdx+Min((x*invAngle+256)>>9,nTbW)][-1-refIdx],with x=-nTbW..-1

其中,nTbW为当前块的宽度,invAngle基于如下公式:Among them, nTbW is the width of the current block, and invAngle is based on the following formula:

Figure BDA0004031263640000071
Figure BDA0004031263640000071

上述公式中的IntraPreAngle可以通过查询图3c所示的表格可得,图3c所示的表格参考H.266编码标准中Table24-specification of intraPreAngle的内容。The IntraPreAngle in the above formula can be obtained by querying the table shown in Figure 3c. The table shown in Figure 3c refers to the content of Table24-specification of intraPreAngle in the H.266 coding standard.

另外,其它还没有填充的参考像素,则通过以下公式求得。In addition, other reference pixels that have not been filled can be obtained by the following formula.

ref[x]=p[-1-refIdx][-1-refIdx+x],with x=nTbH+2+refIdx..refH+refIdxref[x]=p[-1-refIdx][-1-refIdx+x], with x=nTbH+2+refIdx..refH+refIdx

ref[refH+refIdx+x]=p[-1-refIdx][-1+refH],x=1..(Max(1,nTbH/nTbW)*refIdx+1)ref[refH+refIdx+x]=p[-1-refIdx][-1+refH], x=1..(Max(1,nTbH/nTbW)*refIdx+1)

其中,refH为邻居样本的高度,refH=2*nTbH。Among them, refH is the height of the neighbor sample, refH=2*nTbH.

基于以上所述的参考样本的填充过程,将当前块相邻的第一列的样本填充为第一参考线上的参考样本,将当前块相邻的第二列的样本填充为第二参考线上的参考样本,将当前块相邻的第四列的样本填充为第三参考线上的参考样本。Based on the filling process of the reference samples described above, the samples of the first column adjacent to the current block are filled as the reference samples on the first reference line, and the samples of the second column adjacent to the current block are filled as the second reference line The reference samples on the above, the samples of the fourth column adjacent to the current block are filled as the reference samples on the third reference line.

可选地,在一些实施例中,可以将当前块相邻的第一行的样本填充为第一参考线上的参考样本,将当前块相邻的第二行的样本填充为第二参考线上的参考样本,将当前块相邻的第三行的样本填充为第三参考线上的参考样本。Optionally, in some embodiments, the samples of the first row adjacent to the current block can be filled as the reference samples on the first reference line, and the samples of the second row adjacent to the current block can be filled as the second reference line The reference samples on the above, the samples of the third row adjacent to the current block are filled as the reference samples on the third reference line.

可选地,在一些实施例中,可以将当前块相邻的第一列的样本填充为第一参考线上的参考样本,将当前块相邻的第二列的样本填充为第二参考线上的参考样本,将当前块相邻的第三列的样本填充为第三参考线上的参考样本。Optionally, in some embodiments, the samples of the first column adjacent to the current block may be filled as reference samples on the first reference line, and the samples of the second column adjacent to the current block may be filled as the second reference line The reference samples on the above, the samples of the third column adjacent to the current block are filled as the reference samples on the third reference line.

在一实施例中,在执行S120过程中,当多个参考线为多个参考行时,分别对至少一列的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本。In one embodiment, during the execution of S120, when the multiple reference lines are multiple reference rows, at least one column of reference samples on the first reference line, reference samples on the second reference line, and third reference The reference samples on the line are subjected to median filtering to obtain at least one median filtering result, and the reference samples on the fourth reference line are obtained based on the at least one median filtering result.

具体地,当第一参考线、第二参考线及第三参考线为当前块的多个行时,对一列的第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,可以得到第四参考线上该列位置处的一个中值滤波结果。对多列的第一参考线、第二参考线及第三参考线上的参考样本分别进行中值滤波,可以得到第四参考线上该多个列位置处的多个中值滤波结果。基于一个或多个中值滤波结果填充到第四参考线上对应列的位置处,得到第四参考线上的参考样本。Specifically, when the first reference line, the second reference line, and the third reference line are multiple rows of the current block, the reference samples on the first reference line, the second reference line, and the third reference line of a column are processed value filtering, a median filtering result at the column position on the fourth reference line can be obtained. Median filtering is performed on the reference samples on the first reference line, the second reference line, and the third reference line of multiple columns respectively, and multiple median filtering results at the positions of the multiple columns on the fourth reference line can be obtained. Based on the one or more median filtering results, the position of the corresponding column on the fourth reference line is filled to obtain the reference samples on the fourth reference line.

在一实施例中,在执行S120过程中,当多个参考线为多个参考列时,对至少一行的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本。In one embodiment, during the execution of S120, when the multiple reference lines are multiple reference columns, at least one row of reference samples on the first reference line, reference samples on the second reference line, and third reference line Median filtering is performed on the reference samples above to obtain at least one median filtering result, and the reference samples on the fourth reference line are obtained based on the at least one median filtering result.

具体地,当第一参考线、第二参考线及第三参考线为当前块的多个列时,对一行的第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,可以得到第四参考线上该行位置处的一个中值滤波结果。对多行的第一参考线、第二参考线及第三参考线上的参考样本分别进行中值滤波,可以得到第四参考线上该多个行位置处的多个中值滤波结果。基于一个或多个中值滤波结果填充到第四参考线上对应行的位置处,得到第四参考线上的参考样本。Specifically, when the first reference line, the second reference line, and the third reference line are multiple columns of the current block, the reference samples on the first reference line, the second reference line, and the third reference line of a row are processed value filtering, a median filtering result at the row position on the fourth reference line can be obtained. Median filtering is performed on the reference samples on the first reference line, the second reference line, and the third reference line of multiple rows respectively, and multiple median filtering results at the positions of the multiple rows on the fourth reference line can be obtained. Based on the one or more median filtering results, the positions of the corresponding rows on the fourth reference line are filled to obtain the reference samples on the fourth reference line.

图4a所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。图4b所示为本申请另一实施例提供的填充有参考样本的多个参考线的示意图。如图4a和图4b所示,将位于同一列的第一参考线上的样本ref0[1]、第二参考线上的样本ref1[1]、及第三参考线上的样本ref3[1]进行中值滤波,将得到的中值结果填充到第四参考线上该列的位置处,也即,ref2[1]=median{ref0[1],ref1[1],ref3[1]}。其中,第一参考线上的参考样本是基于当前块相邻第一行的样本填充的,第二参考线上的参考样本是基于当前块相邻第二行的样本填充的,第三参考线上的参考样本是基于当前块相邻第四行的样本填充的,第四参考线为将第一参考线、第二参考线及第三参考线进行中值滤波后得到的,即,ref2[x]=median{ref0[x],ref1[x],ref3[x]}。Fig. 4a is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application. Fig. 4b is a schematic diagram of multiple reference lines filled with reference samples provided by another embodiment of the present application. As shown in Figure 4a and Figure 4b, the sample ref0[1] on the first reference line, the sample ref1[1] on the second reference line, and the sample ref3[1] on the third reference line in the same column Perform median filtering, and fill the obtained median result into the position of the column on the fourth reference line, that is, ref2[1]=median{ref0[1], ref1[1], ref3[1]}. Among them, the reference samples on the first reference line are filled based on the samples of the first row adjacent to the current block, the reference samples on the second reference line are filled based on the samples of the second row adjacent to the current block, and the third reference line The reference samples above are filled based on the samples of the fourth row adjacent to the current block, and the fourth reference line is obtained by performing median filtering on the first reference line, the second reference line and the third reference line, that is, ref2[ x] = median {ref0[x], ref1[x], ref3[x]}.

在一实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别为0、1、3、2。In one embodiment, the index values of the first reference line, the second reference line, the third reference line and the fourth reference line are 0, 1, 3, and 2, respectively.

在第一参考线、第二参考线及第三参考线的索引值分别为0、1、3时,通过对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,将得到的中值滤波结果填充到索引值为2的参考线上,得到第四参考线及第四参考线上的参考样本。例如,将第四参考线的索引值设置为2,则第四参考线上的参考样本为ref2[x]=median{ref0[x],ref1[x],ref3[x]}。When the index values of the first reference line, the second reference line, and the third reference line are 0, 1, and 3 respectively, the median value of the reference samples on the first reference line, the second reference line, and the third reference line Filtering, filling the obtained median filtering result on the reference line with an index value of 2 to obtain the fourth reference line and the reference samples on the fourth reference line. For example, if the index value of the fourth reference line is set to 2, then the reference samples on the fourth reference line are ref2[x]=median{ref0[x],ref1[x],ref3[x]}.

在只有第一参考线、第二参考线及第三参考线的情况下,这三种情况需要至少2bit码字表示其索引值。将第一参考线、第二参考线、第三参考线及第四参考线分别用索引值0、1、2、3来指示,这四种情况下也可以只用2bit码字来表示其索引值,因此在增加了一个第四参考线的情况下,也无需引入额外的码字。In the case of only the first reference line, the second reference line and the third reference line, these three cases require at least 2-bit codewords to represent their index values. The first reference line, the second reference line, the third reference line and the fourth reference line are indicated byindex values 0, 1, 2, and 3 respectively. In these four cases, only 2-bit codewords can be used to represent the index value, so in the case of adding a fourth reference line, there is no need to introduce additional codewords.

在一实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别使用二进制值00、01、10、11指示。通过这种方式,无需引入额外的码字代价。In one embodiment, the index values of the first reference line, the second reference line, the third reference line and the fourth reference line are indicated bybinary values 00, 01, 10, and 11, respectively. In this way, no additional codeword penalty needs to be introduced.

在一实施例中,在执行S120的过程中,第四参考线上的参考样本还可以通过以下方法获得。In an embodiment, during the process of executing S120, the reference samples on the fourth reference line may also be obtained by the following method.

当多个参考线为多个参考行时,获取位于相同列的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本;当多个参考线为多个参考列时,获取位于相同行的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本。When multiple reference lines are multiple reference rows, obtain the average value of the reference samples on at least two of the first reference line, the second reference line, and the third reference line in the same column, and the obtained average value as a reference sample on the fourth reference line; when multiple reference lines are multiple reference columns, obtain at least two reference lines among the first reference line, the second reference line and the third reference line in the same row The average value of the reference sample of , and the obtained average value is used as the reference sample on the fourth reference line.

具体地,当多个参考线为多个参考行时,可以计算一列的第一参考线、第二参考线及第三参考线上的参考样本的平均值,将得到的平均值填充到第四参考线上该列的位置处。当多个参考线为多个参考列时,可以计算一行的第一参考线、第二参考线及第三参考线上的参考样本的平均值,将得到的平均值填充到第四参考线上该行的位置处。Specifically, when the multiple reference lines are multiple reference rows, the average value of the reference samples on the first reference line, the second reference line, and the third reference line of a column can be calculated, and the obtained average value can be filled into the fourth at the position of the column on the reference line. When multiple reference lines are multiple reference columns, you can calculate the average value of the reference samples on the first reference line, the second reference line, and the third reference line of a row, and fill the obtained average value on the fourth reference line at the position of the row.

例如,当多个参考线为多个参考行时,在一列的多个参考线中只有两个参考线上填充了参考样本的情况下,则计算该列的两个参考样本的平均值,将得到的平均值填充到第四参考线上该列的位置处。当多个参考线为多个参考列时,在一行的多个参考线中只有两个参考线上填充了参考样本的情况下,则计算该行的两个参考样本的平均值,将得到的平均值填充到第四参考线上该行的位置处。For example, when the multiple reference lines are multiple reference rows, and only two of the multiple reference lines in a column are filled with reference samples, then the average value of the two reference samples in the column is calculated, which will be The resulting average value is filled into the position of the column on the fourth reference line. When the multiple reference lines are multiple reference columns, and only two of the multiple reference lines in a row are filled with reference samples, then calculate the average value of the two reference samples in the row, and the obtained The average value is filled to the position of the row on the fourth reference line.

进一步地,在执行S120的过程中,第四参考线上的参考样本还可以通过以下方法获得:Further, in the process of executing S120, the reference sample on the fourth reference line can also be obtained by the following method:

使用第一参考线、第二参考线及第三参考线中的任何一个参考线上的参考样本作为第四参考线上的参考样本。A reference sample on any one of the first reference line, the second reference line and the third reference line is used as the reference sample on the fourth reference line.

具体地,当多个参考线为多个参考行时,可以直接将位于相同列上的第一参考线、第二参考线或第三参考线上的参考样本复制到第四参考线该列的位置处,以填充为第四参考线的样本。Specifically, when the multiple reference lines are multiple reference rows, the reference samples on the first reference line, the second reference line or the third reference line located on the same column can be directly copied to the fourth reference line in the same column. position to fill as a sample of the fourth reference line.

当多个参考线为多个参考列时,可以直接将位于相同行上的第一参考线、第二参考线或第三参考线上的参考样本复制到第四参考线该行的位置处,以填充为第四参考线的样本。When multiple reference lines are multiple reference columns, you can directly copy the reference sample on the first reference line, the second reference line or the third reference line on the same row to the position of the fourth reference line in this row, Sample with fill as the fourth reference line.

在一实施例中,图1所示的方法还包括:在率失真优化过程,分别遍历第一参考线、第二参考线、第三参考线和第四参考线,以确定每一种角度模式对应的一个最优参考线。In an embodiment, the method shown in FIG. 1 further includes: during the rate-distortion optimization process, respectively traversing the first reference line, the second reference line, the third reference line and the fourth reference line to determine each angle mode Corresponding to an optimal reference line.

率失真优化是视频编解码的一种关键技术,拉格朗日优化方法是视频率失真中最常见的优化工具。在率失真优化过程中,计算包括失真和码率的拉格朗日代价,选择代价最小的模式作为最后的编码模式。其中,代价公式表示如下:Rate-distortion optimization is a key technology of video codec, and Lagrangian optimization method is the most common optimization tool in video rate-distortion. In the rate-distortion optimization process, calculate the Lagrangian cost including distortion and code rate, and select the mode with the smallest cost as the final encoding mode. Among them, the cost formula is expressed as follows:

J_MODE=D+λ_MODE*RateJ_MODE=D+λ_MODE*Rate

其中,D表示不同编码模式的失真Distortion,λ_MODE表示拉格朗日因子,Rate表示采用不同编码模式消耗的比特数。Among them, D represents the distortion Distortion of different coding modes, λ_MODE represents the Lagrangian factor, and Rate represents the number of bits consumed by using different coding modes.

具体地,针对帧内预测模式集中的一个角度模式,遍历当前块相邻的多个参考线,根据率失真优化过程,从第一参考线、第二参考线、第三参考线及第四参考线中选择率失真代价最小的一个参考线作为当前角度模式对应的最优参考线。Specifically, for an angle mode in the intra prediction mode set, traverse multiple reference lines adjacent to the current block, and according to the rate-distortion optimization process, from the first reference line, the second reference line, the third reference line and the fourth reference line Among the lines, a reference line with the smallest rate-distortion cost is selected as the optimal reference line corresponding to the current angle mode.

在一实施例中,帧内预测模式集为最可能模式(MPM)列表。In one embodiment, the set of intra prediction modes is a Most Probable Mode (MPM) list.

MPM列表中的预测模式是由当前块左方和上方的块中的预测模式推导得出的。由于当前预测模式与其周围的预测模式之间有很强的相关性,MPM列表中的预测模式有很高的选中概率。The prediction modes in the MPM list are derived from the prediction modes in the blocks to the left and above the current block. Due to the strong correlation between the current prediction mode and its surrounding prediction modes, the prediction modes in the MPM list have a high probability of being selected.

图5所示为本申请实施例提供的一示例性帧内预测方法的流程示意图。该方法可以由视频编码器执行。应当理解的是,该方法可以以各种顺序执行和/或同时发生,不限于图1所示的执行顺序。具有多个图像帧的视频数据流使用视频编码器时,可以采用如下步骤的方法对当前块进行帧内预测。图5所示实施例为图1实施例的例子,为避免重复,相同之处不再赘述。如图5所示,该实施例以针对亮度分量的帧内预测为例,进行详细的说明。该帧内预测方法包括如下内容。FIG. 5 is a schematic flowchart of an exemplary intra prediction method provided by an embodiment of the present application. The method can be performed by a video encoder. It should be understood that the method may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 1 . When a video data stream with multiple image frames uses a video encoder, the following steps may be used to perform intra-frame prediction on the current block. The embodiment shown in FIG. 5 is an example of the embodiment in FIG. 1 , to avoid repetition, similarities are not repeated here. As shown in FIG. 5 , in this embodiment, the intra prediction for the luma component is taken as an example to describe in detail. The intra prediction method includes the following contents.

S510:针对当前块,遍历67种亮度模型,得到预测模式候选列表。S510: For the current block, traverse 67 types of brightness models to obtain a prediction mode candidate list.

具体地,首先,可以对模式0、模式1、以及大于或等于2的编号为偶数的预测模式进行遍历。对上述每一种预测模式,采用当前块相邻的第一行或第一列作为参考线进行预测,使用实际值减去预测值求得残差值,并根据残差值计算得到SATD。基于SATD值从小到大的排序将每一种预测模式进行排序,选择前面N个预测模式为可能性较大的预测模式,组成预测模式候选列表。其中N由numModesForFullRD变量确定,与预测单元尺寸有关。Specifically, first,mode 0,mode 1, and even-numbered prediction modes greater than or equal to 2 may be traversed. For each of the above prediction modes, the first row or first column adjacent to the current block is used as a reference line for prediction, the actual value is subtracted from the predicted value to obtain the residual value, and the SATD is calculated based on the residual value. Based on the sorting of SATD values from small to large, each prediction mode is sorted, and the first N prediction modes are selected as more likely prediction modes to form a prediction mode candidate list. Among them, N is determined by the numModesForFullRD variable, which is related to the prediction unit size.

然后,针对N个预测模式中的角度模式,继续遍历其相邻的角度模式,采用当前块相邻的第一行或第一列作为参考线进行预测,计算每个角度模式对应的SATD。根据SATD的排序,更新预测模式候选列表中的N个预测模式。Then, for the angle mode in the N prediction modes, continue to traverse its adjacent angle modes, use the first row or first column adjacent to the current block as a reference line for prediction, and calculate the SATD corresponding to each angle mode. The N prediction modes in the prediction mode candidate list are updated according to the sorting of the SATD.

S520:遍历MPM列表中的预测模式,针对MPM列表中的每一种角度模式,遍历第一参考线、第二参考线、第三参考线以及第四参考线,得到M种预测模式。其中,第四参考线为基于第一参考线、第二参考线及第三参考线进行中值滤波,得到的中值滤波参考线。S520: Traverse the prediction modes in the MPM list, and for each angle mode in the MPM list, traverse the first reference line, the second reference line, the third reference line and the fourth reference line to obtain M prediction modes. Wherein, the fourth reference line is a median filtering reference line obtained by performing median filtering based on the first reference line, the second reference line and the third reference line.

具体地,对MPM列表中的每一种角度模式,分别以第一参考线、第二参考线、第三参考线以及第四参考线做参考线,计算当前块的预测样本。选择率失真代价(RDCost)较小的前M种预测模式,增加到上述的包括N个预测模式的预测模式候选列表中。其中,M由变量numCand确定,M取值为1或者2。同时,根据率失真代价确定了每一种角度模式下对应的最优参考线。Specifically, for each angle mode in the MPM list, the prediction samples of the current block are calculated using the first reference line, the second reference line, the third reference line and the fourth reference line as reference lines respectively. The first M prediction modes with smaller rate-distortion cost (RDCost) are selected and added to the above-mentioned prediction mode candidate list including N prediction modes. Among them, M is determined by the variable numCand, and the value of M is 1 or 2. At the same time, the optimal reference line corresponding to each angle mode is determined according to the rate-distortion cost.

S530:基于N+M种预测模式确定最佳预测模式。S530: Determine the best prediction mode based on the N+M prediction modes.

对在S510和S520得到的N+M种预测模式进行精细的RDO流程。对预测模式候选列表中的这N+M种预测模式进行完整的重建回路,变换、量化、反量化、反变换,计算得到每一种预测模式的原始像素值与重构像素值的误差平方和(SSE)。基于RDO代价公式,得到RDCost最小的预测模式,作为最佳预测模式,即最终的亮度预测模式。其中,RDO代价公式中的D使用SSE,Rate包括编码预测模式和残差变换系数所消耗的比特数。A refined RDO process is performed on the N+M prediction modes obtained in S510 and S520. Perform a complete reconstruction loop on the N+M prediction modes in the prediction mode candidate list, transform, quantize, inverse quantize, and inverse transform, and calculate the sum of squared errors between the original pixel value and the reconstructed pixel value of each prediction mode (SSE). Based on the RDO cost formula, the prediction mode with the smallest RDCost is obtained as the best prediction mode, that is, the final brightness prediction mode. Among them, D in the RDO cost formula uses SSE, and Rate includes the number of bits consumed by encoding prediction modes and residual transform coefficients.

根据本申请实施例提供的帧内预测方法,将得到的中值滤波参考线加入到RDO过程,进行最佳预测模式的选择。采用中值滤波参考线作为当前块的参考线时,当前块中的待预测像素的预测样本有可能分别来自多个不同参考线上的参考样本,从而降低了遇到噪点的可能性,有利于减少噪声,提高图像质量。According to the intra prediction method provided by the embodiment of the present application, the obtained median filtering reference line is added to the RDO process to select the best prediction mode. When the median filtering reference line is used as the reference line of the current block, the prediction samples of the pixels to be predicted in the current block may come from reference samples on multiple different reference lines, thereby reducing the possibility of encountering noise, which is beneficial to Reduce noise and improve image quality.

图6所示为本申请实施例提供的另一示例性帧内预测方法的流程示意图。该方法可以由视频编码器执行或视频解码器执行。如图6所示,该帧内预测方法包括如下内容。FIG. 6 is a schematic flowchart of another exemplary intra prediction method provided by the embodiment of the present application. The method can be performed by a video encoder or by a video decoder. As shown in FIG. 6, the intra prediction method includes the following contents.

S610:获取第一参考线、第二参考线、第三参考线以及第四参考线的参考样本。S610: Acquire reference samples of the first reference line, the second reference line, the third reference line and the fourth reference line.

对一个4x4的当前块进行帧内预测,其邻居样本用p[x][y]表示,其中,x=-1-refIdx,y=-1-refIdx..refH,表示当前块左侧的参考列,以及x=-refIdx..refW-1,y=-1-refIdx,表示当前块上侧的参考行,refIdx表示多个参考线的索引号,取值0、1、3分别表示第一参考线、第二参考线、第三参考线,refW表示邻居像素的宽度,refW=8,refH表示邻居像素的高度,refH=8。Intra prediction is performed on a 4x4 current block, and its neighbor samples are represented by p[x][y], where x=-1-refIdx, y=-1-refIdx..refH, representing the reference on the left side of the current block column, and x=-refIdx..refW-1, y=-1-refIdx, represent the reference row on the upper side of the current block, refIdx represents the index numbers of multiple reference lines, and thevalues 0, 1, and 3 represent the first The reference line, the second reference line, and the third reference line, refW represents the width of neighboring pixels, refW=8, refH represents the height of neighboring pixels, refH=8.

图7a所示为本申请实施例提供的一示例性的填充有参考样本的第一参考线的示意图。图7b所示为本申请实施例提供的一示例性的填充有参考样本的第二参考线的示意图。图7c所示为本申请实施例提供的一示例性的填充有参考样本的第三参考线的示意图。Fig. 7a is a schematic diagram of an exemplary first reference line filled with reference samples according to the embodiment of the present application. Fig. 7b is a schematic diagram of an exemplary second reference line filled with reference samples provided by the embodiment of the present application. Fig. 7c is a schematic diagram of an exemplary third reference line filled with reference samples provided by the embodiment of the present application.

具体地,以垂直类模式34(135°角)为例,采用图3a实施例中提供的公式对第一参考线、第二参考线及第三参考线的参考样本进行填充,填充参考样本之后的第一参考线、第二参考线及第三参考线请参见图7a,图7b及图7c。为避免重复,此处不再具体展开说明。Specifically, taking the vertical pattern 34 (135° angle) as an example, the formula provided in the embodiment of FIG. 3a is used to fill the reference samples of the first reference line, the second reference line and the third reference line. After filling the reference samples Please refer to FIG. 7a, FIG. 7b and FIG. 7c for the first reference line, the second reference line and the third reference line. To avoid repetition, no detailed description is given here.

将第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到中值滤波参考线,将得到的中值滤波参考线作为第四参考线。其中,第一参考线、第二参考线及第三参考线采用索引值分别表示为0、1、3,将得到的中值滤波参考线的索引值表示为2。Perform median filtering on the reference samples on the first reference line, the second reference line and the third reference line to obtain a median filtering reference line, and use the obtained median filtering reference line as a fourth reference line. Wherein, the index values of the first reference line, the second reference line and the third reference line are represented as 0, 1, and 3 respectively, and the index value of the obtained median filtering reference line is represented as 2.

具体地,参见图4a和图4b,第四参考线上的参考样本ref2[-4]至参考样本ref2[9]是由参考线0、参考线1、参考线3相同列对应位置的参考样本的中值填充,即ref2[x]=median{ref0[x],ref1[x],ref3[x]}。对于第一参考线、第二参考线、及第三参考线相同列对应位置处的参考样本不足以计算中值的位置,可以计算其中两个参考样本的平均值进行填充,例如,ref2[10]=(ref1[10]+ref3[10])/2;还可以直接复制其中一个参考样本进行填充,例如ref2[12]=ref3[12]。Specifically, referring to Fig. 4a and Fig. 4b, reference sample ref2[-4] to reference sample ref2[9] on the fourth reference line are reference samples corresponding to positions in the same column asreference line 0,reference line 1, andreference line 3 Fill the median of , that is, ref2[x]=median{ref0[x],ref1[x],ref3[x]}. For the positions where the reference samples at the corresponding positions of the same column of the first reference line, the second reference line, and the third reference line are not enough to calculate the median value, the average value of the two reference samples can be calculated for filling, for example, ref2[10 ]=(ref1[10]+ref3[10])/2; it is also possible to directly copy one of the reference samples for filling, for example, ref2[12]=ref3[12].

通过上述方式,完成第一参考线、第二参考线、第三参考线及第四参考线的参考样本的填充。Through the above method, the filling of the reference samples of the first reference line, the second reference line, the third reference line and the fourth reference line is completed.

S620:在预测模式为第一角度模式的情况下,根据第一角度模式的预测角度,计算当前像素投影到第四参考线上对应的参考样本位置的偏移值。S620: If the prediction mode is the first angle mode, calculate an offset value of the corresponding reference sample position projected from the current pixel onto the fourth reference line according to the prediction angle of the first angle mode.

完成参考样本的填充之后,根据角度偏移值intraPredAngle得到索引变量iIdx和乘法因子iFact。其中,iFact表示的是从待预测像素投影到参考样本的两个整数参考样本间的参考样本的位置(以32点为单位),iIdx表示当前像素投影到第四参考线上对应的参考样本位置的偏移值。After filling the reference samples, the index variable iIdx and the multiplication factor iFact are obtained according to the angle offset value intraPredAngle. Among them, iFact represents the position of the reference sample between two integer reference samples projected from the pixel to be predicted to the reference sample (in units of 32 points), and iIdx represents the corresponding reference sample position of the current pixel projected onto the fourth reference line offset value.

对于垂直类角度模式,索引变量iIdx和乘法因子iFact的计算公式如下:For the vertical angle mode, the calculation formula of the index variable iIdx and the multiplication factor iFact is as follows:

iIdx=(((y+1+refIdx)*intraPredAngle)>>5)+refIdxiIdx=(((y+1+refIdx)*intraPredAngle)>>5)+refIdx

iFact=((y+1+refIdx)*intraPredAngle)&31iFact=((y+1+refIdx)*intraPredAngle)&31

其中,y表示当前需要预测的当前块里的像素的纵坐标,y=0..nTbH–1。Wherein, y represents the ordinate of the pixel in the current block that needs to be predicted currently, y=0..nTbH−1.

对于水平类角度模式,索引变量iIdx和乘法因子iFact的计算公式如下:For the horizontal angle mode, the calculation formula of the index variable iIdx and the multiplication factor iFact is as follows:

iIdx=(((x+1+refIdx)*intraPredAngle)>>5)+refIdxiIdx=(((x+1+refIdx)*intraPredAngle)>>5)+refIdx

iFact=((x+1+refIdx)*intraPredAngle)&31iFact=((x+1+refIdx)*intraPredAngle)&31

其中,x表示当前需要预测的当前块里的像素的横坐标,x=0..nTbW–1,>>用于表示比特右移操作。Wherein, x represents the abscissa of the pixel in the current block that needs to be predicted currently, x=0..nTbW–1, >> is used to represent a bit right shift operation.

S630:根据当前像素投影到第四参考线上对应的参考样本位置的偏移值获取当前块的预测样本。S630: Acquire prediction samples of the current block according to the offset value of the current pixel projected onto the corresponding reference sample position on the fourth reference line.

根据上述计算得到的iIdx和iFact计算当前块的每个待预测像素的预测样本。The prediction sample of each pixel to be predicted in the current block is calculated according to the iIdx and iFact obtained through the above calculation.

对于第一角度模式为垂直类模式,针对亮度分量,预测样本的计算公式如下:For the first angle mode is the vertical mode, for the luminance component, the calculation formula for predicting samples is as follows:

Figure BDA0004031263640000131
Figure BDA0004031263640000131

其中,x=0..nTbW-1,y=0..nTbH–1,用于表示待预测的当前块里的像素点的坐标。fT[i]为插值滤波系数,可以参考H.266标准文档里的规定;PredSamples[x][y]为帧内预测角度模式下,参考线refIdx下的预测样本。在该实施例中,参考线refIdx取值为2。Wherein, x=0..nTbW-1, y=0..nTbH-1, which are used to indicate the coordinates of the pixels in the current block to be predicted. fT[i] is the interpolation filter coefficient, which can refer to the regulations in the H.266 standard document; PredSamples[x][y] is the prediction sample under the reference line refIdx in the intra prediction angle mode. In this embodiment, the value of the reference line refIdx is 2.

针对色度分量,如果iFact!=0,预测样本的计算公式如下:For chroma components, if iFact! = 0, the calculation formula for predicting samples is as follows:

predSamples[x][y]=((32–iFact)*ref[x+iIdx+1]+iFact*ref[x+iIdx+2]+16)>>5predSamples[x][y]=((32–iFact)*ref[x+iIdx+1]+iFact*ref[x+iIdx+2]+16)>>5

针对色度分量,如果iFact=0,预测样本的计算公式如下:For the chrominance component, if iFact=0, the calculation formula of the predicted sample is as follows:

predSamples[x][y]=ref[x+iIdx+1]predSamples[x][y]=ref[x+iIdx+1]

对于第一角度模式为水平类模式,针对亮度分量,预测样本的计算公式如下:For the first angle mode is the horizontal mode, for the luminance component, the calculation formula for predicting samples is as follows:

Figure BDA0004031263640000132
Figure BDA0004031263640000132

针对色度分量,如果iFact!=0,预测样本的计算公式如下:For chroma components, if iFact! = 0, the calculation formula for predicting samples is as follows:

predSamples[x][y]=((32–iFact)*ref[y+iIdx+1]+iFact*ref[y+iIdx+2]+16)>>5predSamples[x][y]=((32–iFact)*ref[y+iIdx+1]+iFact*ref[y+iIdx+2]+16)>>5

针对色度分量,如果iFact=0,预测样本的计算公式如下:For the chrominance component, if iFact=0, the calculation formula of the predicted sample is as follows:

predSamples[x][y]=ref[y+iIdx+1]predSamples[x][y]=ref[y+iIdx+1]

本申请实施例还提供了一种编码方法,该编码方法包括:基于上述任一实施例的帧内预测方法对待编码图像进行帧内预测,得到待编码图像中当前块的帧内预测样本;基于帧内预测得到的帧内预测样本进行后续编码处理,得到待编码图像对应的编码数据。本申请实施例提供的编码方法,有利于减少噪声,提高图像质量,以及减小像素残差,提高压缩率。The embodiment of the present application also provides an encoding method, the encoding method includes: performing intra prediction on the image to be encoded based on the intra prediction method in any of the above embodiments, and obtaining an intra prediction sample of the current block in the image to be encoded; based on The intra-frame prediction samples obtained by the intra-frame prediction are subjected to subsequent encoding processing to obtain encoded data corresponding to the image to be encoded. The encoding method provided by the embodiment of the present application is beneficial to reduce noise, improve image quality, reduce pixel residuals, and improve compression rate.

本申请实施例还提供了一种解码方法,该解码方法包括:接收编码端发送的编码数据;基于上述图1或图6实施例提供的帧内预测方法对编码数据进行帧内预测,得到当前块的帧内预测样本。本申请实施例提供的解码方法,有利于减少噪声,提高图像质量。The embodiment of the present application also provides a decoding method, the decoding method includes: receiving the encoded data sent by the encoding end; performing intra-frame prediction on the encoded data based on the intra-frame prediction method provided in the embodiment of FIG. 1 or FIG. 6 to obtain the current Intra prediction samples for the block. The decoding method provided by the embodiment of the present application is beneficial to reduce noise and improve image quality.

示例性装置Exemplary device

图8所示为本申请一实施例提供的帧内预测装置800的结构示意图。如图8所示,本申请实施例提供的帧内预测装置800可以包括获取模块810、滤波模块820、及预测模块830。FIG. 8 is a schematic structural diagram of an intra prediction device 800 provided by an embodiment of the present application. As shown in FIG. 8 , the intra prediction apparatus 800 provided by the embodiment of the present application may include anacquisition module 810 , afiltering module 820 , and aprediction module 830 .

获取模块810用于获取当前块的多个参考线上的参考样本,多个参考线包括第一参考线、第二参考线和第三参考线,其中,第一参考线、第二参考线和第三参考线上的参考样本分别是基于当前块的相邻行或相邻列的样本填充得到的。滤波模块820用于当前块的预测模式为角度模式的情况下,对第一参考线、第二参考线及第三参考线上的参考样本进行中值滤波,得到第四参考线。预测模块830用于根据角度模式对应的预测角度和第四参考线对当前块执行帧内预测,得到当前块的预测样本。The acquiringmodule 810 is configured to acquire reference samples on multiple reference lines of the current block, the multiple reference lines include a first reference line, a second reference line and a third reference line, wherein the first reference line, the second reference line and The reference samples on the third reference line are respectively filled based on samples of adjacent rows or adjacent columns of the current block. Thefiltering module 820 is used to perform median filtering on the reference samples on the first reference line, the second reference line and the third reference line to obtain the fourth reference line when the prediction mode of the current block is the angle mode. Theprediction module 830 is configured to perform intra-frame prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line, to obtain prediction samples of the current block.

本实施例提供的帧内预测装置,在原有的第一参考线、第二参考线及第三参考线的基础上增加第四参考线,采用第一参考线、第二参考线及第三参考线的参考样本的中值填充为第四参考线的参考样本。通过这种方式,采用第四参考线的参考样本对当前块进行预测时,当前块的预测样本不仅是采用某一个参考线的参考样本,而是采用了多个参考线的参考样本的中值,从而有效地避免了遇到噪点的问题,有利于减少噪声,提高图像质量。另外,还可以减小像素残差,提高压缩率。The intra prediction device provided in this embodiment adds a fourth reference line on the basis of the original first reference line, second reference line and third reference line, and adopts the first reference line, the second reference line and the third reference line The median of the line's reference samples is populated as the fourth reference line's reference samples. In this way, when the reference sample of the fourth reference line is used to predict the current block, the prediction sample of the current block is not only the reference sample of a certain reference line, but the median value of the reference samples of multiple reference lines , so as to effectively avoid the problem of encountering noise, which is beneficial to reduce noise and improve image quality. In addition, it can also reduce the pixel residual and improve the compression rate.

在一实施例中,滤波模块820还用于当多个参考线为多个参考行时,分别对至少一列的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本;当多个参考线为多个参考列时,分别对至少一行的第一参考线上的参考样本、第二参考线上的参考样本及第三参考线上的参考样本进行中值滤波,得到至少一个中值滤波结果,基于至少一个中值滤波结果得到第四参考线上的参考样本。In one embodiment, thefiltering module 820 is further configured to separately perform at least one column of reference samples on the first reference line, reference samples on the second reference line, and third reference lines when the multiple reference lines are multiple reference rows. The reference samples on the line are subjected to median filtering to obtain at least one median filtering result, and the reference samples on the fourth reference line are obtained based on at least one median filtering result; when multiple reference lines are multiple reference columns, at least Perform median filtering on the reference samples on the first reference line, the reference samples on the second reference line, and the reference samples on the third reference line in a row to obtain at least one median filtering result, and obtain the first median filtering result based on at least one median filtering result. Reference samples on four reference lines.

在一实施例中,滤波模块820还用于当多个参考线为多个参考行时,获取位于相同列的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本;当多个参考线为多个参考列时,获取位于相同行的第一参考线、第二参考线及第三参考线中的至少两个参考线上的参考样本的平均值,将得到的平均值作为第四参考线上的参考样本。In one embodiment, thefiltering module 820 is further configured to obtain at least two reference lines among the first reference line, the second reference line and the third reference line located in the same column when the multiple reference lines are multiple reference lines The average value of the reference samples on the above, and the obtained average value is used as the reference sample on the fourth reference line; when multiple reference lines are multiple reference columns, the first reference line, the second reference line and the second reference line in the same row are obtained. The average value of the reference samples on at least two reference lines in the third reference line is used as the reference sample on the fourth reference line.

在一实施例中,滤波模块820还用于使用第一参考线、第二参考线及第三参考线中的任何一个参考线上的参考样本作为第四参考线上的参考样本。In one embodiment, thefiltering module 820 is further configured to use the reference samples on any one of the first reference line, the second reference line and the third reference line as the reference samples on the fourth reference line.

在一实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别为0、1、3、2。In one embodiment, the index values of the first reference line, the second reference line, the third reference line and the fourth reference line are 0, 1, 3, and 2, respectively.

在一实施例中,第一参考线、第二参考线、第三参考线及第四参考线的索引值分别使用二进制值00、01、10、11指示。In one embodiment, the index values of the first reference line, the second reference line, the third reference line and the fourth reference line are indicated bybinary values 00, 01, 10, and 11, respectively.

在一实施例中,帧内预测装置800还包括确定模块840。确定模块840用于在率失真优化过程,分别遍历第一参考线、第二参考线、第三参考线和第四参考线,以确定每一种角度模式对应的一个最优参考线。In an embodiment, the intra prediction device 800 further includes a determination module 840 . The determination module 840 is used to respectively traverse the first reference line, the second reference line, the third reference line and the fourth reference line during the rate-distortion optimization process to determine an optimal reference line corresponding to each angle mode.

应当理解,关于本实施例所提供的帧内预测装置800中各模块的原理、功能、所采用的数据的特征、针对数据的处理方式,以及所有可选实现方式的技术效果,均可以参考示例性方法中的相应内容,在此不再一一赘述。It should be understood that for the principles, functions, characteristics of the data used, data processing methods, and technical effects of all optional implementations of the modules in the intra prediction device 800 provided in this embodiment, you can refer to the example The corresponding content in the sexual method will not be repeated here.

示例性设备exemplary device

图9所示为本申请一实施例提供的一种示例性的电子设备900的结构示意图。如图9所示,电子设备900可以包括存储器910和一个或多个处理器920。其中,存储器910中存储有计算机指令,一个或多个处理器920用于执行计算机指令,以实现如上述任一实施例提供的帧内预测方法、或编码方法、或解码方法。FIG. 9 is a schematic structural diagram of an exemplaryelectronic device 900 provided by an embodiment of the present application. As shown in FIG. 9 , anelectronic device 900 may include a memory 910 and one or more processors 920 . Wherein, the memory 910 stores computer instructions, and one or more processors 920 are configured to execute the computer instructions, so as to implement the intra prediction method, or the encoding method, or the decoding method provided by any of the above embodiments.

示例性计算机可读存储介质Exemplary computer readable storage medium

本申请的其他实施例还提供一种计算机可读存储介质,包括存储在其上的计算机指令,计算机指令在被处理器执行时,使得处理器执行实现如上述任一实施例所提供的帧内预测方法、编码方法、或解码方法。Other embodiments of the present application also provide a computer-readable storage medium, including computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes and implements the intra-frame storage medium provided by any of the above-mentioned embodiments. A prediction method, an encoding method, or a decoding method.

可选地,该计算机存储介质可以为任何有形媒介,例如:软盘、CD-ROM、DVD、硬盘驱动器或网络介质等。Optionally, the computer storage medium may be any tangible medium, such as a floppy disk, CD-ROM, DVD, hard disk drive, or network medium.

示例性计算机程序产品Exemplary computer program product

本申请的其他实施例还提供一种计算机程序产品,该计算机程序产品中包括指令,当指令被计算机设备的处理器执行时,能够使得计算机设备执行本申请上述任一实施例所提供的帧内预测方法、编码方法或者解码方法。Other embodiments of the present application also provide a computer program product, the computer program product includes instructions, and when the instructions are executed by the processor of the computer device, the computer device can execute the intra-frame processing provided by any of the above-mentioned embodiments of the present application. Prediction method, encoding method or decoding method.

本申请中涉及的装置、设备、系统的方框图仅作为示例性的例子并且不意图要求或暗示必须按照方框图示出的方式进行连接、布置、配制。本领域技术人员可以理解,这些装置、设备、系统可以按任意方式进行连接、布置、配制。诸如“包含”、“包括”、“具有”等等的词语是开放性词汇,至“包括但不限于”,且可与其互换使用,除非上下文明确指示不是如此。这里使用的词汇“诸如”指词组“诸如但不限于”,且可与其互换使用。The block diagrams of devices, devices, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. Those skilled in the art can understand that these devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "comprises," "including," "having," etc. are open-ended terms, and are used interchangeably to "including but not limited to," unless the context clearly dictates otherwise. As used herein, the word "such as" refers to and is used interchangeably with the phrase "such as but not limited to".

还需要指出的是,在本申请的装置、设备和方法中,各模块或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本申请的等效方案。It should also be pointed out that in the devices, equipment and methods of the present application, each module or each step can be decomposed and/or reassembled. These decompositions and/or recombinations should be considered equivalents of this application.

提供所公开的方面的以上描述以使本领域的任何技术人员能够做出或者使用本申请。对这些方面的各种修改对于本领域技术人员而言是非常显而易见的,并且在此定义的一般原理可以应用于其他方面而不脱离本申请的范围。因此,本申请并不意图被限制到上述方面,而是按照与在此公开的原理及新颖的特征一致的最宽范围。The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the application is not intended to be limited to the above aspects but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

以上说明是为了对本申请的技术方案进行例示和描述。此外,此描述并不意图将本申请的实施例限制在上述公开的形式范围之内。尽管上述内容中已经讨论了多个示例方面和实施例,但是本领域技术人员可以基于上述内容轻易得到其他变型、修改、改变、添加和子组合。The above description is for the purpose of illustrating and describing the technical solution of the present application. Furthermore, this description is not intended to limit the embodiments of the present application to the forms disclosed above. Although a number of example aspects and embodiments have been discussed above, other variations, modifications, changes, additions and sub-combinations can readily be made by those skilled in the art based on the above.

以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换等,均应包含在本申请的保护范围之内。The above is only a preferred embodiment of the application, and is not intended to limit the application. Any modifications, equivalent replacements, etc. made within the spirit and principles of the application shall be included in the protection scope of the application. within.

Claims (12)

1. An intra prediction method, comprising:
Obtaining reference samples on a plurality of reference lines of a current block, wherein the plurality of reference lines comprise a first reference line, a second reference line and a third reference line, and the reference samples on the first reference line, the second reference line and the third reference line are respectively obtained based on sample filling of adjacent rows or adjacent columns of the current block;
under the condition that the prediction mode of the current block is an angle mode, median filtering is carried out on the reference samples on the first reference line, the second reference line and the third reference line to obtain a fourth reference line;
and performing intra-frame prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line to obtain a prediction sample of the current block.
2. The method of claim 1, wherein median filtering the reference samples on the first, second, and third reference lines to obtain a fourth reference line comprises:
when the plurality of reference lines are a plurality of reference lines, median filtering is respectively carried out on the reference samples on the first reference line, the reference samples on the second reference line and the reference samples on the third reference line of at least one column to obtain at least one median filtering result, and the reference samples on the fourth reference line are obtained based on the at least one median filtering result;
When the plurality of reference lines are a plurality of reference columns, median filtering is respectively carried out on the reference samples on the first reference line, the reference samples on the second reference line and the reference samples on the third reference line which are positioned in at least one row, at least one median filtering result is obtained, and the reference samples on the fourth reference line are obtained based on the at least one median filtering result.
3. The method of claim 2, wherein median filtering the reference samples on the first, second, and third reference lines to obtain a fourth reference line, further comprises:
when the plurality of reference lines are a plurality of reference rows, acquiring average values of reference samples on at least two reference lines in the first reference line, the second reference line and the third reference line which are positioned in the same column, and taking the acquired average values as the reference samples on the fourth reference line;
when the plurality of reference lines are a plurality of reference columns, obtaining an average value of reference samples on at least two reference lines in the first reference line, the second reference line and the third reference line which are positioned in the same row, and taking the obtained average value as the reference sample on the fourth reference line.
4. The method of claim 2, wherein median filtering the reference samples on the first, second, and third reference lines to obtain a fourth reference line, further comprises:
a reference sample on any one of the first reference line, the second reference line, and the third reference line is used as a reference sample on the fourth reference line.
5. The method of claim 1, wherein the index values of the first reference line, the second reference line, the third reference line, and the fourth reference line are 0, 1, 3, and 2, respectively.
6. The method of claim 5, wherein index values of the first reference line, the second reference line, the third reference line, and the fourth reference line are indicated using binary values 00, 01, 10, 11, respectively.
7. The method according to claim 1, wherein the method further comprises:
and in the rate distortion optimization process, traversing the first reference line, the second reference line, the third reference line and the fourth reference line respectively to determine an optimal reference line corresponding to each angle mode.
8. A method of encoding, comprising:
performing intra-frame prediction on an image to be coded based on the intra-frame prediction method according to any one of claims 1-7 to obtain intra-frame prediction samples of a current block in the image to be coded;
and carrying out subsequent coding processing on the intra-frame prediction sample obtained based on the intra-frame prediction to obtain coded data corresponding to the image to be coded.
9. A decoding method, comprising:
receiving coded data sent by a coding end;
intra-prediction is performed on the encoded data based on the intra-prediction method of any of claims 1-6 to obtain intra-prediction samples for the current block.
10. An intra prediction apparatus, comprising:
an obtaining module, configured to obtain reference samples on a plurality of reference lines of a current block, where the plurality of reference lines includes a first reference line, a second reference line, and a third reference line, and the reference samples on the first reference line, the second reference line, and the third reference line are respectively obtained based on sample filling of adjacent rows or adjacent columns of the current block;
the filtering module is used for carrying out median filtering on the reference samples on the first reference line, the second reference line and the third reference line under the condition that the prediction mode of the current block is an angle mode, so as to obtain a fourth reference line;
And the prediction module is used for performing intra-frame prediction on the current block according to the prediction angle corresponding to the angle mode and the fourth reference line to obtain a prediction sample of the current block.
11. An electronic device, comprising:
a memory for storing computer instructions;
one or more processors configured to execute the computer instructions to implement the intra prediction method of any one of claims 1 to 7 or the encoding method of claim 8 or the decoding method of claim 9.
12. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the intra prediction method of any one of claims 1 to 7 or the encoding method of claim 8 or the decoding method of claim 9.
CN202211730156.6A2022-12-302022-12-30Intra-frame prediction method, device and storage mediumPendingCN116055730A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211730156.6ACN116055730A (en)2022-12-302022-12-30Intra-frame prediction method, device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211730156.6ACN116055730A (en)2022-12-302022-12-30Intra-frame prediction method, device and storage medium

Publications (1)

Publication NumberPublication Date
CN116055730Atrue CN116055730A (en)2023-05-02

Family

ID=86117632

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211730156.6APendingCN116055730A (en)2022-12-302022-12-30Intra-frame prediction method, device and storage medium

Country Status (1)

CountryLink
CN (1)CN116055730A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2019078629A1 (en)*2017-10-182019-04-25한국전자통신연구원Image encoding/decoding method and device, and recording medium having bitstream stored therein
CA3115194A1 (en)*2018-10-062020-04-09Huawei Technologies Co., Ltd.Method and apparatus for intra prediction using an interpolation filter
CN111654696A (en)*2020-04-242020-09-11北京大学 An intra-frame multi-reference line prediction method, device, storage medium and terminal
KR20210003604A (en)*2019-07-022021-01-12한국전자통신연구원Method and apparatus for intra prediction

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2019078629A1 (en)*2017-10-182019-04-25한국전자통신연구원Image encoding/decoding method and device, and recording medium having bitstream stored therein
CN115037931A (en)*2017-10-182022-09-09韩国电子通信研究院Image encoding/decoding method and apparatus, and recording medium storing bit stream
CA3115194A1 (en)*2018-10-062020-04-09Huawei Technologies Co., Ltd.Method and apparatus for intra prediction using an interpolation filter
KR20210003604A (en)*2019-07-022021-01-12한국전자통신연구원Method and apparatus for intra prediction
CN111654696A (en)*2020-04-242020-09-11北京大学 An intra-frame multi-reference line prediction method, device, storage medium and terminal

Similar Documents

PublicationPublication DateTitle
US12231640B2 (en)Video decoding method, video encoding method, and related apparatuses
CN101584218B (en) Encoding and decoding method and device based on intra-frame prediction
CN118714296A (en) Image encoding/decoding method and image data transmission method
CN112565751B (en)Video decoding method and device, computer readable medium and electronic equipment
KR20200091848A (en)Method for intra prediction and apparatus thereof
CN119788855A (en) Transformation method, encoder, decoder and storage medium
CN114615504B (en)Video decoding method, video encoding method, device and equipment
CN112543337B (en)Video decoding method, device, computer readable medium and electronic equipment
CN102447896B (en) Image residual block processing method, device and system
CN114079772B (en)Video decoding method and device, computer readable medium and electronic equipment
WO2022037464A1 (en)Video decoding method and apparatus, video coding method and apparatus, device, and storage medium
CN105791868A (en)Video coding method and equipment
CN116055730A (en)Intra-frame prediction method, device and storage medium
CN114286095B (en)Video decoding method, device and equipment
CN114286096A (en) Video decoding method, device and device
CN115499647B (en) Multi-transformation kernel selection method, encoding and decoding method, electronic device and storage medium
CN114079773B (en)Video decoding method and device, computer readable medium and electronic equipment
WO2025118926A1 (en)Video encoding method and apparatus, video decoding method and apparatus, and medium and electronic device
WO2025118925A1 (en)Video encoding method and apparatus, video decoding method and apparatus, medium and electronic device
HK40064588B (en)Video decoding method, device, computer-readable medium and electronic equipment
HK40040679B (en)Video decoding method and apparatus, computer readable medium, and electronic device
HK40064588A (en)Video decoding method, device, computer-readable medium and electronic equipment
WO2025190013A1 (en)Video encoding method and video decoding method, apparatus, computer readable medium, and electronic device
WO2024174253A1 (en)Intra prediction method and apparatus based on interpolation filtering, video encoding method and apparatus, video decoding method and apparatus, and system
HK40064956A (en)Video decoding method, apparatus, computer-readable medium and electronic device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp