WO2026166360A1 - Adaptive loop filtering-based video encoding method, apparatus and device - Google Patents
Adaptive loop filtering-based video encoding method, apparatus and deviceInfo
- Publication number
- WO2026166360A1 WO2026166360A1 PCT/CN2026/074681 CN2026074681W WO2026166360A1 WO 2026166360 A1 WO2026166360 A1 WO 2026166360A1 CN 2026074681 W CN2026074681 W CN 2026074681W WO 2026166360 A1 WO2026166360 A1 WO 2026166360A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image frame
- encoded
- adaptive loop
- loop filtering
- information
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/136—Incoming video signal characteristics or properties
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/30—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/80—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
- H04N19/82—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本申请要求在2025年02月07日提交中国专利局,申请号为202510137501.2的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 202510137501.2, filed on February 7, 2025, the entire contents of which are incorporated herein by reference.
本申请实施例涉及视频编码技术领域,尤其涉及一种基于自适应环路滤波的视频编码方法、装置及设备。This application relates to the field of video coding technology, and in particular to a video coding method, apparatus and device based on adaptive loop filtering.
自适应环路滤波(ALF,Adaptive Loop Filter)技术被应用于视频编码中,该技术基于维纳滤波的原理,通过原始图像和重建图像信息建立维纳霍夫方程求解具有最小均方误差的滤波器系数,实现减小重建误差,提升图像质量的效果。Adaptive Loop Filter (ALF) technology is applied in video coding. Based on the principle of Wiener filtering, this technology establishes the Wiener-Hoff equation using information from the original and reconstructed images to solve for the filter coefficients with the minimum mean square error, thereby reducing reconstruction error and improving image quality.
自适应滤波基于图像的统计特性和最小均方误差准则,假设输入图像由期望图像和噪声组成,然后通过调整滤波器的参数来最小化期望图像与输出图像之间的均方误差,通过不断调整滤波器的参数,使得输出图像接近于期望图像,从而达到去噪、增强或修复的效果。但是自适应环路滤波的计算在整个编码过程中的时间占比非常高,自适应环路滤波处理耗费了大量的计算资源,严重影响了视频编码的效率。Adaptive filtering is based on the statistical properties of images and the minimum mean square error criterion. It assumes the input image consists of a desired image and noise, and then minimizes the mean square error between the desired and output images by adjusting the filter parameters. By continuously adjusting the filter parameters, the output image is made closer to the desired image, thus achieving denoising, enhancement, or restoration. However, the computation of adaptive loop filtering accounts for a very high percentage of the overall encoding process, consuming significant computational resources and severely impacting the efficiency of video coding.
本申请实施例提供一种基于自适应环路滤波的视频编码方法、装置及设备,以解决相关技术中自适应环路滤波的计算在整个编码过程中的时间占比非常高,自适应环路滤波处理耗费了大量的计算资源,视频编码的效率较低的技术问题,可跳过部分自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,有效提高视频编码的效率。This application provides a video coding method, apparatus, and device based on adaptive loop filtering to address the technical problem in related technologies where the computation of adaptive loop filtering accounts for a very high proportion of the time in the entire coding process, and the adaptive loop filtering process consumes a large amount of computing resources, resulting in low video coding efficiency. It can skip part of the adaptive loop filtering process, reduce the computing resources consumed by the adaptive loop filtering process, and effectively improve the efficiency of video coding.
在第一方面,本申请实施例提供了一种基于自适应环路滤波的视频编码方法,包括:In a first aspect, embodiments of this application provide a video coding method based on adaptive loop filtering, comprising:
确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息;Determine the absolute values and information of the transform residuals and/or motion vector information of multiple image blocks in the image frame to be encoded;
在所述待编码图像帧的时域分层层级大于预设层级的情况下,根据所述变换残差绝对值和信息和/或所述运动矢量信息确定所述待编码图像帧是否为静止图像帧;If the temporal layering level of the image frame to be encoded is greater than the preset level, it is determined whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and/or the motion vector information.
在所述待编码图像帧为静止图像帧的情况下,对所述待编码图像帧进行不采用自适应环路滤波的编码处理。When the image frame to be encoded is a still image frame, the image frame to be encoded is encoded without adaptive loop filtering.
在第二方面,本申请实施例提供了一种基于自适应环路滤波的视频编码装置,包括信息确定模块、静止判断模块和编码处理模块,其中:In a second aspect, embodiments of this application provide a video encoding apparatus based on adaptive loop filtering, including an information determination module, a stillness determination module, and an encoding processing module, wherein:
所述信息确定模块,配置为确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息;The information determination module is configured to determine the absolute value of the transformation residual and information and/or motion vector information of multiple image blocks in the image frame to be encoded;
所述静止判断模块,配置为在所述待编码图像帧的时域分层层级大于预设层级的情况下,根据所述变换残差绝对值和信息和/或所述运动矢量信息确定所述待编码图像帧是否为静止图像帧;The stillness determination module is configured to determine whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and/or the motion vector information when the temporal layering level of the image frame to be encoded is greater than a preset level.
所述编码处理模块,配置为在所述待编码图像帧为静止图像帧的情况下,对所述待编码图像帧进行不采用自适应环路滤波的编码处理。The encoding processing module is configured to perform encoding processing on the image frame to be encoded without adaptive loop filtering when the image frame to be encoded is a still image frame.
在第三方面,本申请实施例提供了一种基于自适应环路滤波的视频编码设备,包括:存储器以及一个或多个处理器;In a third aspect, embodiments of this application provide a video encoding device based on adaptive loop filtering, including: a memory and one or more processors;
所述存储器,用于存储一个或多个程序;The memory is used to store one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的基于自适应环路滤波的视频编码方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the video coding method based on adaptive loop filtering as described in the first aspect.
在第四方面,本申请实施例提供了一种存储计算机可执行指令的非易失性存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如第一方面所述的基于自适应环路滤波的视频编码方法。In a fourth aspect, embodiments of this application provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the video coding method based on adaptive loop filtering as described in the first aspect.
在第五方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行如第一方面所述的基于自适应环路滤波的视频编码方法。In a fifth aspect, embodiments of this application provide a computer program product comprising a computer program stored in a computer-readable storage medium, wherein at least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the video coding method based on adaptive loop filtering as described in the first aspect.
本申请实施例通过确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息,在待编码图像帧的时域分层层级大于预设层级时,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,并在待编码图像帧为静止图像帧时,对待编码图像帧进行不采用自适应环路滤波的编码处理,跳过部分效果较差的自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,有效提高视频编码的效率。This application embodiment determines the absolute value and information of the transform residuals and/or motion vector information of multiple image blocks in the image frame to be encoded. When the temporal layer level of the image frame to be encoded is greater than a preset level, it determines whether the image frame to be encoded is a still image frame based on the absolute value and information of the transform residuals and/or motion vector information. When the image frame to be encoded is a still image frame, it performs encoding processing on the image frame to be encoded without adaptive loop filtering, skipping some of the less effective adaptive loop filtering processing, reducing the computational resources consumed by adaptive loop filtering processing, and effectively improving the efficiency of video encoding.
图1是本申请实施例提供的一种基于自适应环路滤波的视频编码方法的流程图;Figure 1 is a flowchart of a video coding method based on adaptive loop filtering provided in an embodiment of this application;
图2是一种时域分层划分示意图;Figure 2 is a schematic diagram of temporal domain hierarchical partitioning;
图3是本申请实施例提供的另一种基于自适应环路滤波的视频编码方法的流程图;Figure 3 is a flowchart of another video coding method based on adaptive loop filtering provided in an embodiment of this application;
图4是本申请实施例提供的一种基于自适应环路滤波的视频编码装置的结构示意图;Figure 4 is a schematic diagram of a video encoding device based on adaptive loop filtering provided in an embodiment of this application;
图5是本申请实施例提供的一种基于自适应环路滤波的视频编码设备的结构示意图。Figure 5 is a schematic diagram of the structure of a video encoding device based on adaptive loop filtering provided in an embodiment of this application.
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时上述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。上述处理可以对应于方法、函数、规程、子例程、子程序等等。To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but additional steps not included in the drawings may also be present. The above processes can correspond to methods, functions, procedures, subroutines, subroutines, etc.
本申请提供的基于自适应环路滤波的视频编码方法可应用于视频编码场景,旨在根据待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息确定是否跳过部分效果较差的自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,提高视频编码的效率。The video coding method based on adaptive loop filtering provided in this application can be applied to video coding scenarios. It aims to determine whether to skip some poorly performing adaptive loop filtering processes based on the absolute value and information of the transform residuals of multiple image blocks in the image frame to be encoded and/or motion vector information, thereby reducing the computational resources consumed by adaptive loop filtering and improving the efficiency of video coding.
在现有的视频编码方案中,经常会对待编码图像进行自适应滤波处理,使得输出图像接近于期望图像,从而达到去噪、增强或修复的效果。但是自适应环路滤波的计算在整个编码过程中的时间占比非常高,自适应环路滤波处理耗费了大量的计算资源,严重影响了视频编码的效率。基于此,提供本申请实施例的一种基于自适应环路滤波的视频编码方法,以解决现有自适应环路滤波的计算在整个编码过程中的时间占比非常高,自适应环路滤波处理耗费了大量的计算资源,视频编码的效率较低的技术问题。In existing video coding schemes, adaptive filtering is often applied to the image to be encoded to make the output image closer to the desired image, thereby achieving the effects of noise reduction, enhancement, or restoration. However, the computation of adaptive loop filtering accounts for a very high proportion of the entire encoding process, consuming a large amount of computational resources and seriously affecting the efficiency of video coding. Therefore, this application provides a video coding method based on adaptive loop filtering to solve the technical problems of high computational time consumption and low efficiency in existing adaptive loop filtering methods.
图1给出了本申请实施例提供的一种基于自适应环路滤波的视频编码方法的流程图,本申请实施例提供的基于自适应环路滤波的视频编码方法可以由基于自适应环路滤波的视频编码装置来执行,该基于自适应环路滤波的视频编码装置可以通过硬件和/或软件的方式实现,并集成在基于自适应环路滤波的视频编码设备中。Figure 1 shows a flowchart of a video coding method based on adaptive loop filtering provided in an embodiment of this application. The video coding method based on adaptive loop filtering provided in this embodiment of the application can be executed by a video coding device based on adaptive loop filtering. The video coding device based on adaptive loop filtering can be implemented by hardware and/or software and integrated into a video coding device based on adaptive loop filtering.
下述以基于自适应环路滤波的视频编码装置执行基于自适应环路滤波的视频编码方法为例进行描述。参考图1,该基于自适应环路滤波的视频编码方法包括:The following description uses an adaptive loop filtering-based video coding device to illustrate the adaptive loop filtering-based video coding method. Referring to Figure 1, the adaptive loop filtering-based video coding method includes:
S110:确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息。S110: Determine the absolute values of the transform residuals and information and/or motion vector information of multiple image blocks in the image frame to be encoded.
示例性的,依次获取待编码视频中各个图像帧进行编码处理,对于当前需要进行编码处理的待编码图像帧,将待编码图像帧划分为多个图像块,并确定各个图像块对应的变换残差绝对值和信息(SATD,sum of absolute transformed differences,对图像进行编码或预编码后,原始图像与变换后的图像之间的残差绝对值的和)和/或运动矢量信息(MV,Motion Vecto,即当前帧的某个图像块相对于参考帧的运动距离)。For example, each image frame in the video to be encoded is sequentially acquired and encoded. For the current image frame to be encoded, the image frame to be encoded is divided into multiple image blocks, and the absolute value of the transform residual (SATD, sum of absolute transformed differences, the sum of the absolute values of the residuals between the original image and the transformed image after encoding or pre-encoding) and/or motion vector information (MV, Motion Vecto, the motion distance of a certain image block in the current frame relative to the reference frame) corresponding to each image block are determined.
可选的,变换残差绝对值和信息和/或运动矢量信息可基于对待编码图像帧中多个图像块的预编码结果,或正式编码结果进行确定。其中,编码器在正式编码开始前可对视频进行预编码过程,该过程会缓冲输入视频的多个连续图像帧,将图像帧(例如对原始图像帧下采样得到的图像帧)分为多个大小相同的图像块,模拟正式编码里的预测模式(例如运动估计),得到图像块的编码信息(例如变换残差绝对值和信息和/或运动矢量信息),其中产生的编码信息会被保存下来以辅助后续正式编码流程。Optionally, the absolute value of the transform residual and/or motion vector information can be determined based on the pre-coding results of multiple image blocks in the image frame to be encoded, or the final encoding results. Specifically, the encoder can perform a pre-coding process on the video before the formal encoding begins. This process buffers multiple consecutive image frames of the input video, divides the image frames (e.g., image frames obtained by downsampling the original image frames) into multiple image blocks of the same size, simulates the prediction mode (e.g., motion estimation) in the formal encoding, and obtains the encoding information of the image blocks (e.g., the absolute value of the transform residual and/or motion vector information). The generated encoding information is saved to assist in the subsequent formal encoding process.
S120:在待编码图像帧的时域分层层级大于预设层级的情况下,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧。S120: If the temporal layering level of the image frame to be encoded is greater than the preset level, determine whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and/or motion vector information.
示例性的,确定待编码图像帧的时域分层层级(例如待编码图像帧在图像组中的不同位置对应不同的时域分层层级,可根据待编码图像帧在图像组中的位置确定对应的时域分层层级),并确定待编码图像帧的时域分层层级是否大于预设层级(例如预设层级可以是0层、1层等)。For example, the temporal layering level of the image frame to be encoded is determined (for example, different positions of the image frame to be encoded in the image group correspond to different temporal layering levels, and the corresponding temporal layering level can be determined according to the position of the image frame to be encoded in the image group), and it is determined whether the temporal layering level of the image frame to be encoded is greater than a preset level (for example, the preset level can be layer 0, layer 1, etc.).
在一个实施例中,在待编码图像帧的时域分层层级小于或等于预设层级时,为了保证编码质量,对待编码图像帧进行采用自适应环路滤波的编码处理,并记录对待编码图像帧进行采用自适应环路滤波的编码处理对应的率失真代价信息(RDCost,Rate-Distortion Cost)以及待编码图像帧进行不采用自适应环路滤波的编码处理的率失真代价信息。In one embodiment, when the temporal layer level of the image frame to be encoded is less than or equal to a preset level, in order to ensure encoding quality, the image frame to be encoded is subjected to encoding processing with adaptive loop filtering, and the rate-distortion cost information (RDCost) corresponding to the encoding processing with adaptive loop filtering and the rate-distortion cost information of the image frame to be encoded without adaptive loop filtering are recorded.
在待编码图像帧的时域分层层级大于预设层级时,可根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧。其中,静止图像可理解为图像帧相对于在前层级的已编码图像帧的画面变化较小的图像。静止图像帧由于画面变化较小,图像帧各个图像块在变换前后的残差较小,对应的变换残差绝对值和信息和/或运动矢量信息会小于预设的阈值,可据此确定待编码图像帧是否为静止图像帧。When the temporal layer level of the image frame to be encoded is greater than a preset level, it can be determined whether the image frame to be encoded is a still image frame based on the absolute value and information of the transform residuals and/or motion vector information. A still image can be understood as an image frame whose image changes are minimal compared to the encoded image frames in the preceding layers. Because still image frames have minimal image changes, the residuals of each image block before and after the transform are small, and the corresponding absolute value and information of the transform residuals and/or motion vector information will be less than a preset threshold. This can be used to determine whether the image frame to be encoded is a still image frame.
如图2提供的一种时域分层划分示意图所示,假设一个图像组的大小为8(图像组包括图中编号1-8的图像帧),其中I帧为关键帧,其对应编号为0,后续每个图像帧为非关键帧(例如B 帧、P帧),对应编号依次为1-8。数字编号可表示图像帧的播放顺序,对于时域分层的图像编码顺序和播放顺序并不一样,以图2为例,播放顺序是0,1,2,3,4,5,6,7,8。而编码顺序是0,8,4,2,1,3,6,5,7。编号为0,8的图像处在第0层,编号为4的图像在第1层,编号为2,6的图像在第2层,编号为1,3,5,7的图像在第3层,由于层级高的图像需要参考层级低的图像,通常需要对低层级的图像分配更多的码率以保证质量。箭头可理解为编码所需要参考的图像帧,例如图2中编号为8的图像帧指向编号为0的图像帧,可理解为编号为8的图像帧的编码参考编号为0的图像帧。可选的,不同大小的图像组可对应不同的帧层级数量、每个帧层级包含的图像帧的数量以及各个帧层级对应的图像帧在图像组内的编码,可根据图像组的大小(包括的图像帧的数量)确定图像帧对应的帧层级。Figure 2 illustrates a temporal layering diagram. Assume an image group is 8 frames in size (the image group includes frames numbered 1-8 in the figure), where the I-frame is a keyframe with the corresponding number 0, and each subsequent image frame is a non-keyframe (e.g., B-frame, P-frame), numbered 1-8 respectively. The numerical numbers represent the playback order of the image frames. For temporal layering, the encoding order and playback order are different. Taking Figure 2 as an example, the playback order is 0, 1, 2, 3, 4, 5, 6, 7, 8. The encoding order is 0, 8, 4, 2, 1, 3, 6, 5, 7. Images numbered 0 and 8 are in layer 0, image number 4 is in layer 1, images numbered 2 and 6 are in layer 2, and images numbered 1, 3, 5, and 7 are in layer 3. Since higher-layer images need to reference lower-layer images, a higher bitrate is usually allocated to lower-layer images to ensure quality. The arrows can be interpreted as the image frames that need to be referenced for encoding. For example, in Figure 2, image frame number 8 points to image frame number 0, which can be understood as the encoding of image frame number 8 referencing image frame number 0. Optionally, image groups of different sizes can correspond to different numbers of frame levels, the number of image frames contained in each frame level, and the encoding of image frames corresponding to each frame level within the image group. The frame level corresponding to an image frame can be determined based on the size of the image group (the number of image frames it includes).
例如,假设图2对应的预设层级为1,则其中时域分层层级为0或1的图像帧(图2中编号为0、4、8的图像帧)小于或等于预设层级,帧层级为2或3的图像帧(图2中编号为1-3、5-7的图像帧)对应的帧层级大于预设层级。例如在当前待编码帧的编号为5时,其帧层级为3,大于预设层级,则可进一步判断待编码图像帧是否为静止图像帧。而在当前待编码帧的编号为4时,其帧层级为1,等于预设层级,则对待编码图像帧进行采用自适应环路滤波的编码处理。For example, assuming the preset level corresponding to Figure 2 is 1, then image frames with a temporal layer level of 0 or 1 (image frames numbered 0, 4, and 8 in Figure 2) are less than or equal to the preset level, while image frames with a frame level of 2 or 3 (image frames numbered 1-3 and 5-7 in Figure 2) have a frame level greater than the preset level. For instance, when the current frame to be encoded is numbered 5, its frame level is 3, which is greater than the preset level, so it can be further determined whether the image frame to be encoded is a still image frame. When the current frame to be encoded is numbered 4, its frame level is 1, which is equal to the preset level, so the image frame to be encoded is processed using adaptive loop filtering.
S130:在待编码图像帧为静止图像帧的情况下,对待编码图像帧进行不采用自适应环路滤波的编码处理。S130: When the image frame to be encoded is a still image frame, the image frame to be encoded is encoded without adaptive loop filtering.
示例性的,在确定待编码图像帧为静止图像帧时,由于待编码图像帧的编码将参考之前层级的已编码图像帧,并且待编码图像帧相对于之前层级的已编码图像帧的画面变化较小,在已编码图像帧已经进行了自适应环路滤波的情况下,参考该自适应环路滤波进行编码处理也可实现理想的自适应环路滤波效果,可对待编码图像帧进行不采用自适应环路滤波(即跳过自适应环路滤波)的编码处理,减少自适应环路滤波的数据处理量,提高视频编码效率。For example, when the image frame to be encoded is determined to be a still image frame, since the encoding of the image frame to be encoded will refer to the previously encoded image frames in the previous layer, and the image frame to be encoded has little change in picture compared to the previously encoded image frames in the previous layer, if the encoded image frame has already undergone adaptive loop filtering, the ideal adaptive loop filtering effect can also be achieved by referring to the adaptive loop filtering for encoding processing. The image frame to be encoded can be encoded without using adaptive loop filtering (i.e., skipping adaptive loop filtering), which reduces the amount of data processing for adaptive loop filtering and improves video encoding efficiency.
例如图2中编号为3的待编码图像帧,如果是连续的静止图像,由于图像3参考图像2和4,图像3的很多信息可以继承自图像2和4,不需要再做多余的滤波处理,可有效提高视频编码效率。For example, in Figure 2, if the image frame numbered 3 to be encoded is a continuous still image, since image 3 references images 2 and 4, much of the information in image 3 can be inherited from images 2 and 4, eliminating the need for additional filtering and effectively improving video encoding efficiency.
上述,通过确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息,在待编码图像帧的时域分层层级大于预设层级时,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,并在待编码图像帧为静止图像帧时,对待编码图像帧进行不采用自适应环路滤波的编码处理,跳过部分效果较差的自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,有效提高视频编码的效率。As described above, by determining the absolute value and information of the transform residuals and/or motion vector information of multiple image blocks in the image frame to be encoded, when the temporal layering level of the image frame to be encoded is greater than the preset level, it is determined whether the image frame to be encoded is a still image frame based on the absolute value and information of the transform residuals and/or motion vector information. When the image frame to be encoded is a still image frame, the image frame to be encoded is encoded without adaptive loop filtering, skipping some of the less effective adaptive loop filtering processes, reducing the computational resources consumed by adaptive loop filtering processes, and effectively improving the efficiency of video encoding.
在上述实施例的基础上,图3给出了本申请实施例提供的另一种基于自适应环路滤波的视频编码方法的流程图,该基于自适应环路滤波的视频编码方法是对上述基于自适应环路滤波的视频编码方法的具体化。参考图3,该基于自适应环路滤波的视频编码方法包括:Based on the above embodiments, Figure 3 shows a flowchart of another video coding method based on adaptive loop filtering provided in this application embodiment. This video coding method based on adaptive loop filtering is a specific embodiment of the above-described video coding method based on adaptive loop filtering. Referring to Figure 3, the video coding method based on adaptive loop filtering includes:
S210:对待编码图像帧进行下采样得到下采样图像帧,并将下采样图像帧划分为多个图像块。S210: Downsample the image frame to be encoded to obtain a downsampled image frame, and divide the downsampled image frame into multiple image blocks.
S220:对多个图像块进行预编码得到各个图像块的变换残差绝对值和信息和/或运动矢量信息。S220: Pre-encode multiple image blocks to obtain the absolute value of the transform residual and information and/or motion vector information of each image block.
示例性的,编码器在对视频进行编码处理前,会先对视频进行预编码处理,在预编码处理过程中,缓冲输入视频的多个连续的图像帧,并对这些图像帧进行下采样处理,并将各个下采样处理后的图像帧划分为预设尺寸的多个图像块,对这些图像块模拟正式编码里的帧内预测和帧间预测,即对多个图像块进行预编码得到各个图像块最优的变换残差绝对值和信息和/或运动矢量信息。本方案通过对待编码图像帧的预编码结果确定各个图像块的变换残差绝对值和信息和/或运动矢量信息,可准确确定待编码图像帧是否为静止图像帧,准确跳过部分自适应环路滤波,在保证视频编码质量的同时,有效提高视频编码效率。For example, before encoding the video, the encoder pre-encodes it. During pre-encoding, multiple consecutive image frames of the input video are buffered, downsampled, and divided into multiple image blocks of a preset size. These image blocks simulate intra-frame and inter-frame prediction in the actual encoding process. In other words, pre-encoding multiple image blocks yields the optimal absolute value of the transform residual and information, and/or motion vector information for each block. This scheme determines the absolute value of the transform residual and information, and/or motion vector information, for each image block based on the pre-encoding results of the image frame to be encoded. This accurately determines whether the image frame to be encoded is a still image frame, accurately skips some adaptive loop filtering, and effectively improves video encoding efficiency while ensuring video encoding quality.
S230:在待编码图像帧的时域分层层级大于预设层级的情况下,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧。S230: If the temporal layering level of the image frame to be encoded is greater than the preset level, determine whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and/or motion vector information.
在一个可能的实施例中,本方案提供的基于自适应环路滤波的视频编码方法根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,可以是在变换残差绝对值和信息的平均值小于预设变换残差绝对值和阈值,和/或运动矢量信息的平均值小于预设运动矢量阈值的情况下,确定待编码图像帧为静止图像帧。In one possible embodiment, the video coding method based on adaptive loop filtering provided by this solution determines whether the image frame to be encoded is a still image frame based on the absolute value and information of the transform residual and/or the motion vector information. This can be done when the average value of the absolute value and information of the transform residual is less than a preset absolute value and threshold of the transform residual and/or the average value of the motion vector information is less than a preset motion vector threshold.
示例性的,在待编码图像帧的时域分层层级大于预设层级时,计算各个图像块的变换残差绝对值和信息的平均值,和/或各个图像块的运动矢量信息的平均值,并确定变换残差绝对值和信息的平均值是否小于预设变换残差绝对值和阈值,和/或确定运动矢量信息的平均值是否小于预设运动矢量阈值。For example, when the temporal layering level of the image frame to be encoded is greater than the preset layer, the average value of the absolute value of the transform residual and the average value of the information of each image block are calculated, and/or the average value of the motion vector information of each image block is determined, and it is determined whether the average value of the absolute value of the transform residual and the average value of the information is less than the preset absolute value of the transform residual and the preset threshold, and/or it is determined whether the average value of the motion vector information is less than the preset motion vector threshold.
在一个实施例中,在变换残差绝对值和信息的平均值小于预设变换残差绝对值和阈值,和/或运动矢量信息的平均值小于预设运动矢量阈值时,可确定待编码图像帧为静止图像帧。例如,在变换残差绝对值和信息的平均值小于预设变换残差绝对值和阈值,并且运动矢量信息的平均值小于预设运动矢量阈值时,可确定待编码图像帧为静止图像帧,而在变换残差绝对值和信息的平均值大于或等于预设变换残差绝对值和阈值,或运动矢量信息的平均值大于或等于预设运动矢量阈值时,可确定待编码图像帧为非静止图像帧。例如,变换残差绝对值和信息的平均值以及运动矢量信息的平均值可通过以下公式进行确定: In one embodiment, when the average of the absolute value of the transform residual and the information is less than a preset absolute value of the transform residual and a preset threshold, and/or the average of the motion vector information is less than a preset motion vector threshold, the image frame to be encoded can be determined to be a still image frame. For example, when the average of the absolute value of the transform residual and the information is less than a preset absolute value of the transform residual and a preset threshold, and the average of the motion vector information is less than a preset motion vector threshold, the image frame to be encoded can be determined to be a still image frame. Conversely, when the average of the absolute value of the transform residual and the information is greater than or equal to a preset absolute value of the transform residual and a preset threshold, or the average of the motion vector information is greater than or equal to a preset motion vector threshold, the image frame to be encoded can be determined to be a non-still image frame. For example, the average of the absolute value of the transform residual and the information, and the average of the motion vector information, can be determined using the following formula:
其中, 为变换残差绝对值和信息的平均值, 为运动矢量信息的平均值, 为待编码图像帧中图像块的数量, 为第 个图像块的变换残差绝对值和信息, 为第 个图像块的运动矢量信息。 in, To transform the absolute value of the residuals and the average value of the information, This is the average value of the motion vector information. The number of image blocks in the image frame to be encoded. For the first The absolute value of the transformation residual and information of each image patch. For the first Motion vector information of each image patch.
在满足以下条件时,待编码图像帧为静止图像帧: The image frame to be encoded is a still image frame when the following conditions are met:
其中, 为待编码图像帧的时域分层层级, 为预设层级。即 和 小于对应的阈值则判定待编码图像帧是静止的,且待编码图像帧的时域分层层级大于预设层级时,跳过自适应环路滤波的计算。本方案通过根据变换残差绝对值和信息的平均值,和/或运动矢量信息的平均值确定待编码图像帧是否为静止图像帧,准确判断待编码图像帧的整体运动情况,准确确定是否跳过待编码图像帧的自适应环路滤波处理,提高视频编码效率。 in, The temporal layering of the image frame to be encoded is defined. This is a preset hierarchy. and If the value is less than the corresponding threshold, the image frame to be encoded is determined to be static. Furthermore, if the temporal layering level of the image frame to be encoded is greater than a preset level, the adaptive loop filtering calculation is skipped. This scheme determines whether the image frame to be encoded is static based on the absolute value of the transform residual and the average value of the information, and/or the average value of the motion vector information. This accurately judges the overall motion of the image frame to be encoded and determines whether to skip the adaptive loop filtering process, thus improving video encoding efficiency.
S240:在待编码图像帧为静止图像帧的情况下,对待编码图像帧进行不采用自适应环路滤波的编码处理。S240: When the image frame to be encoded is a still image frame, the image frame to be encoded is encoded without adaptive loop filtering.
S250:在待编码图像帧为非静止图像帧的情况下,确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息。S250: When the image frame to be encoded is a non-still image frame, determine the filtering effect information of the encoded image frames with adaptive loop filtering at the level before the image frame to be encoded.
S260:在滤波效果信息未达到预设滤波效果条件的情况下,对待编码图像帧进行不采用自适应环路滤波的编码处理。S260: If the filtering effect information does not meet the preset filtering effect conditions, the image frame to be encoded will be encoded without adaptive loop filtering.
示例性的,在待编码图像帧的时域分层层级大于预设层级,并且待编码图像帧为非静止图像帧时,需要进一步确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息,根据已编码图像帧的滤波效果确定当前待编码图像帧是否采用自适应环路滤波。如图2所示,假设待编码图像帧的编号为3,其参考的已编码图像帧对应的编号为2和4,编号为2和4分别参考编号0和8的已编码图像,可确定编号为0、2、4、8中进行采用了自适应环路滤波的编码处理的滤波效果信息(若编号为2的图像未采用自适应环路滤波的编码处理,可不参考该图像的滤波效果信息),根据这些滤波效果信息确定是否跳过当前待编码图像帧的自适应环路滤波处理。For example, when the temporal layer of the image frame to be encoded is greater than a preset layer, and the image frame to be encoded is a non-still image frame, it is necessary to further determine the filtering effect information of the encoded image frames with adaptive loop filtering in the layers preceding the image frame to be encoded. Based on the filtering effect of the encoded image frames, it is determined whether the current image frame to be encoded should use adaptive loop filtering. As shown in Figure 2, assuming the image frame to be encoded is numbered 3, the corresponding encoded image frames it refers to are numbered 2 and 4. Numbered 2 and 4 refer to encoded images numbered 0 and 8 respectively. The filtering effect information of the encoding process with adaptive loop filtering in numbers 0, 2, 4, and 8 can be determined (if the image numbered 2 has not used adaptive loop filtering encoding process, the filtering effect information of this image can be ignored). Based on this filtering effect information, it is determined whether to skip the adaptive loop filtering process of the current image frame to be encoded.
在一个实施例中,确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息是否达到预设滤波效果条件。可选的,确定滤波效果信息是否达到预设滤波效果条件,可根据之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息对应的平均值与预设平均阈值的比较结果,或之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息对应的累加值与预设累加阈值的比较结果进行确定。例如滤波效果信息对应的平均值小于预设平均阈值,或滤波效果信息对应的累加值小于预设累加阈值时,认为滤波效果信息达到预设滤波效果条件。In one embodiment, it is determined whether the filtering effect information of the encoded image frames using adaptive loop filtering in the layers preceding the image frame to be encoded meets a preset filtering effect condition. Optionally, determining whether the filtering effect information meets the preset filtering effect condition can be based on a comparison between the average value of the filtering effect information of the encoded image frames using adaptive loop filtering in the previous layers and a preset average threshold, or a comparison between the accumulated value of the filtering effect information of the encoded image frames using adaptive loop filtering in the previous layers and a preset accumulated threshold. For example, if the average value of the filtering effect information is less than the preset average threshold, or the accumulated value of the filtering effect information is less than the preset accumulated threshold, the filtering effect information is considered to have met the preset filtering effect condition.
在一个可能的实施例中,本方案提供的基于自适应环路滤波的视频编码方法确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息,包括:In one possible embodiment, the video coding method based on adaptive loop filtering provided by this solution determines the filtering effect information of encoded image frames using adaptive loop filtering at levels preceding the image frame to be encoded, including:
S261:确定在待编码图像帧之前的层级的图像帧采用自适应环路滤波进行编码的第一率失真代价信息,以及不采用自适应环路滤波进行编码的第二率失真代价信息。S261: Determine the first rate-distortion cost information for encoding image frames at levels prior to the image frame to be encoded using adaptive loop filtering, and the second rate-distortion cost information for encoding without adaptive loop filtering.
S262:累积各个第二率失真代价信息和对应的第一率失真代价信息的差值得到滤波效果信息。S262: Accumulate the difference between each second-rate distortion cost information and the corresponding first-rate distortion cost information to obtain the filtering effect information.
可选的,在对每个图像帧进行采用自适应环路滤波的编码处理时,可确定采用自适应环路滤波进行编码的率失真代价信息,以及不采用自适应环路滤波对同一图像帧进行编码的率失真代价信息,用于后续确定是否跳过自适应环路滤波的判断。Optionally, when encoding each image frame using adaptive loop filtering, the rate-distortion cost information for encoding with adaptive loop filtering and the rate-distortion cost information for encoding the same image frame without adaptive loop filtering can be determined, which can be used to determine whether to skip adaptive loop filtering in the future.
示例性的,在待编码图像帧的时域分层层级大于预设层级,并且待编码图像帧为非静止图像帧时,确定在待编码图像帧之前的层级的采用自适应环路滤波进行编码的图像帧。确定这些图像帧采用自适应环路滤波进行编码的率失真代价信息,并将这些率失真代价信息作为第一率失真代价信息,以及不采用自适应环路滤波进行编码的率失真代价信息,并将这些率失真代价信息作为第二率失真代价信息。其中,在一个图像帧的自适应环路滤波效果较差时,第二率失真代价信息小于第一率失真代价信息。For example, when the temporal layer of the image frame to be encoded is greater than a preset layer, and the image frame to be encoded is a non-still image frame, image frames encoded using adaptive loop filtering at layers preceding the image frame to be encoded are determined. Rate-distortion cost information for these image frames encoded using adaptive loop filtering is determined, and this rate-distortion cost information is used as the first rate-distortion cost information. Rate-distortion cost information for image frames encoded without adaptive loop filtering is also determined, and this rate-distortion cost information is used as the second rate-distortion cost information. Where the adaptive loop filtering effect of an image frame is poor, the second rate-distortion cost information is less than the first rate-distortion cost information.
在一个实施例中,确定各个图像帧的第二率失真代价信息和同一图像帧对应的第一率失真代价信息的差值,并累积这些图像帧对应的率失真代价信息的差值,将累积结果作为待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息。可选的,也可将各个第二率失真代价信息和对应的第一率失真代价信息的差值的平均值作为滤波效果信息。其中,滤波效果信息与滤波效果成反比,即滤波效果信息对应数值越大,滤波效果越差。In one embodiment, the difference between the second rate-distortion cost information of each image frame and the first rate-distortion cost information corresponding to the same image frame is determined, and the differences between these rate-distortion cost information of corresponding image frames are accumulated. The accumulated result is used as the filtering effect information of the encoded image frames of the layer preceding the image frame to be encoded, which employs adaptive loop filtering. Optionally, the average of the differences between each second rate-distortion cost information and the corresponding first rate-distortion cost information can also be used as the filtering effect information. The filtering effect information is inversely proportional to the filtering effect; that is, the larger the value of the filtering effect information, the worse the filtering effect.
如图2所示,假设待编码图像帧的编号为3,其参考的已编码图像帧对应的编号为2和4,编号为2和4分别参考编号0和8的已编码图像,编号为2的图像帧未采用自适应环路滤波的编码处理,编号为0、4、8的图像帧采用了自适应环路滤波的编码处理,则确定编号为0、4、8的图像帧对应的第一率失真代价信息和第二率失真代价信息,确定编号为0的图像帧的第二率失真代价信息和第一率失真代价信息的差值、编号为4的图像帧的第二率失真代价信息和第一率失真代价信息的差值以及编号为8的图像帧的第二率失真代价信息和第一率失真代价信息的差值,将上述3个差值相加得到待编码图像帧之前的层级的采用自适应环路滤波的滤波效果信息。本方案通过累积待编码图像帧之前的层级的图像帧采用自适应环路滤波进行编码的第一率失真代价信息,以及不采用自适应环路滤波进行编码的第二率失真代价信息的差值确定滤波效果信息,准确判断低层级图像帧的自适应环路滤波效果,准确判断是否需要跳过累积滤波效果较差的自适应环路滤波,实现视频编码质量与效率的平衡。As shown in Figure 2, assuming the image frame to be encoded is numbered 3, and the corresponding encoded image frames it references are numbered 2 and 4, with numbered 2 and 4 referencing encoded images numbered 0 and 8 respectively. Image frame numbered 2 did not undergo adaptive loop filtering encoding, while image frames numbered 0, 4, and 8 underwent adaptive loop filtering encoding. The first rate-distortion cost information and the second rate-distortion cost information corresponding to image frames numbered 0, 4, and 8 are then determined. The differences between the second and first rate-distortion cost information of image frame numbered 0, the second and first rate-distortion cost information of image frame numbered 4, and the second and first rate-distortion cost information of image frame numbered 8 are also determined. These three differences are then added together to obtain the filtering effect information of the layer preceding the image frame to be encoded using adaptive loop filtering. This scheme determines the filtering effect information by accumulating the difference between the first rate-distortion cost information of the image frames in the layers before the image frame to be encoded using adaptive loop filtering and the second rate-distortion cost information of the image frames not using adaptive loop filtering. This accurately judges the adaptive loop filtering effect of the lower-level image frames and accurately determines whether it is necessary to skip the adaptive loop filtering with poor cumulative filtering effect, thus achieving a balance between video encoding quality and efficiency.
在一个实施例中,本方案提供的滤波效果信息未达到预设滤波效果条件,可以是滤波效果信息小于预设率失真代价变化阈值。例如,将滤波效果信息与预设率失真代价变化阈值进行比较,在滤波效果信息小于预设率失真代价变化阈值时,可认为滤波效果信息未达到预设滤波效果条件,即在待编码图像帧之前的累积滤波效果较差,而在滤波效果信息大于或等于预设率失真代价变化阈值时,可认为滤波效果信息达到预设滤波效果条件,即在待编码图像帧之前的累积滤波效果较好。In one embodiment, the filtering effect information provided by this solution may not meet the preset filtering effect condition if the filtering effect information is less than a preset rate-distortion cost change threshold. For example, by comparing the filtering effect information with the preset rate-distortion cost change threshold, if the filtering effect information is less than the preset rate-distortion cost change threshold, it can be considered that the filtering effect information has not met the preset filtering effect condition, that is, the cumulative filtering effect before the image frame to be encoded is poor. Conversely, if the filtering effect information is greater than or equal to the preset rate-distortion cost change threshold, it can be considered that the filtering effect information has met the preset filtering effect condition, that is, the cumulative filtering effect before the image frame to be encoded is good.
在一个实施例中,预设率失真代价变化阈值可根据待编码图像帧的图像分辨率、待编码图像帧的时域分层层级和对待编码图像帧配置的量化参数(QP,Quantizer Parameter)中的一种或多种的组合进行确定。例如,预设率失真代价变化阈值与图像分辨率、时域分层层级以及量化参数正相关,即图像分辨率、时域分层层级、量化参数越大,对应的预设率失真代价变化阈值越大。In one embodiment, the preset rate-distortion cost variation threshold can be determined based on one or more of the following combinations: the image resolution of the image frame to be encoded, the temporal layering level of the image frame to be encoded, and the quantizer parameter (QP) configured for the image frame to be encoded. For example, the preset rate-distortion cost variation threshold is positively correlated with the image resolution, the temporal layering level, and the quantizer parameter; that is, the larger the image resolution, the temporal layering level, and the quantizer parameter, the larger the corresponding preset rate-distortion cost variation threshold.
在一个实施例中,在视频编码中,低层级的图像帧会先编码,编码得到的信息对于高层级的图像帧有较强的参考意义,本方案在自适应环路滤波对低层级的图像质量提升效果有限时,关闭对高层级的图像帧的自适应环路滤波,减少不必要的自适应环路滤波计算。对于时域分层的图像帧来说,低层级的图像帧像会被高层级的图像帧用作参考,因此被参考得越多的低层级图像帧越重要,由于参考会存在错误传递的问题,比如在低层级的图像帧上关闭了自适应环路滤波,那么高层级的图像帧也需要跟着关闭自适应环路滤波,为了减少对质量的影响,对于低层级的图像帧不采用帧级别的自适应环路滤波跳过算法,只做自适应环路滤波数据的保存。首先判断当前待编码图像帧的时域分层层级是否大于预设层级,如果小于或等于预设层级,记录自适应环路滤波后图像的率失真代价rdcost,与未经过自适应环路滤波前的率失真代价rdcost进行比较,记录两者的差值,当自适应环路滤波的滤波效果不好时, ,则关闭高层级的自适应环路滤波。可选的,滤波效果信息可通过以下公式进行确定: In one embodiment, during video encoding, lower-level image frames are encoded first. The encoded information has strong reference value for higher-level image frames. In this scheme, when adaptive loop filtering has limited effect on improving the quality of lower-level images, adaptive loop filtering for higher-level image frames is disabled to reduce unnecessary adaptive loop filtering calculations. For temporally layered image frames, lower-level image frames are used as references by higher-level image frames. Therefore, the more lower-level image frames are referenced, the more important they are. Since reference can lead to error propagation, for example, if adaptive loop filtering is disabled on lower-level image frames, then adaptive loop filtering also needs to be disabled on higher-level image frames. To minimize the impact on quality, frame-level adaptive loop filtering skipping algorithms are not used for lower-level image frames; only adaptive loop filtering data is saved. First, determine if the temporal layer level of the current image frame to be encoded is greater than the preset layer level. If it is less than or equal to the preset layer level, record the rate-distortion cost (rdcost) of the image after adaptive loop filtering, and compare it with the rate-distortion cost (rdcost) before adaptive loop filtering, recording the difference between the two. When the filtering effect of adaptive loop filtering is poor... If this is not the case, then the higher-level adaptive loop filtering is disabled. Optionally, the filtering effect information can be determined using the following formula:
其中, 为滤波效果信息, 为第 个图像帧的第二率失真代价信息, 为第 个图像帧的第一率失真代价信息, 为在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的数量。 in, For filtering effect information, For the first Second rate-distortion cost information for each image frame For the first The first rate-distortion cost information for each image frame This represents the number of encoded image frames that have undergone adaptive loop filtering at the level preceding the image frame to be encoded.
在满足以下关系时,滤波效果信息未达到预设滤波效果条件: 。 The filtering effect information does not meet the preset filtering effect conditions when the following relationship is met: .
其中, 为基于图像分辨率 、时域分层层级 和量化参数 确定的预设率失真代价变化阈值。本方案通过滤波效果信息和预设率失真代价变化阈值的比较结果判断滤波效果信息是否达到预设滤波效果条件,准确判断是否需要跳过累积滤波效果较差的自适应环路滤波,实现视频编码质量与效率的平衡。 in, For image resolution Time-domain hierarchical structure and quantization parameters A predetermined rate-distortion cost variation threshold is established. This scheme determines whether the filtering effect information meets the predetermined filtering effect conditions by comparing the filtering effect information with the predetermined rate-distortion cost variation threshold. It accurately determines whether it is necessary to skip the adaptive loop filter with poor cumulative filtering effect, thereby achieving a balance between video coding quality and efficiency.
在一个实施例中,在滤波效果信息达到预设滤波效果条件(自适应环路滤较好)时,可认为对图像帧的自适应环路滤波可取得较好的滤波效果,当前待编码图像帧可继续采用自适应环路滤波,即对待编码图像帧进行采用自适应环路滤波的编码处理,保证视频编码质量。而在滤波效果信息未达到预设滤波效果条件(自适应环路滤较差)时,可认为对图像帧的自适应环路滤波的滤波效果较差,可跳过自适应环路滤波,即对待编码图像帧进行不采用自适应环路滤波的编码处理,减少不必要的自适应环路滤波计算,提高视频编码效率。In one embodiment, when the filtering effect information meets the preset filtering effect condition (adaptive loop filtering is good), the adaptive loop filtering of the image frame can be considered to have achieved a good filtering effect. The current image frame to be encoded can continue to use adaptive loop filtering, that is, the image frame to be encoded undergoes encoding processing with adaptive loop filtering to ensure video encoding quality. Conversely, when the filtering effect information does not meet the preset filtering effect condition (adaptive loop filtering is poor), the filtering effect of the adaptive loop filtering of the image frame can be considered poor. Adaptive loop filtering can be skipped, that is, the image frame to be encoded undergoes encoding processing without adaptive loop filtering, reducing unnecessary adaptive loop filtering calculations and improving video encoding efficiency.
上述,通过确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息,在待编码图像帧的时域分层层级大于预设层级时,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,并在待编码图像帧为静止图像帧时,对待编码图像帧进行不采用自适应环路滤波的编码处理,跳过部分效果较差的自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,有效提高视频编码的效率。同时,在待编码图像帧的时域分层层级大于预设层级,并且待编码图像帧为非静止图像帧时,确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息,并在滤波效果信息未达到预设滤波效果条件时,对待编码图像帧进行不采用自适应环路滤波的编码处理,减少不必要的自适应环路滤波计算,进一步提高视频编码效率。As described above, by determining the absolute values of the transform residuals and/or motion vector information of multiple image blocks in the image frame to be encoded, when the temporal layer level of the image frame to be encoded is greater than a preset level, it is determined whether the image frame to be encoded is a still image frame based on the absolute values of the transform residuals and/or motion vector information. If the image frame to be encoded is a still image frame, encoding processing without adaptive loop filtering is performed, skipping some of the less effective adaptive loop filtering processes, reducing the computational resources consumed by adaptive loop filtering, and effectively improving the efficiency of video encoding. Simultaneously, when the temporal layer level of the image frame to be encoded is greater than a preset level, and the image frame to be encoded is not a still image frame, the filtering effect information of the encoded image frames in the layers preceding the image frame to be encoded, which have undergone adaptive loop filtering, is determined. If the filtering effect information does not meet the preset filtering effect conditions, encoding processing without adaptive loop filtering is performed on the image frame to be encoded, reducing unnecessary adaptive loop filtering calculations and further improving video encoding efficiency.
图4是本申请实施例提供的一种基于自适应环路滤波的视频编码装置的结构示意图。参考图4,该基于自适应环路滤波的视频编码装置包括信息确定模块41、静止判断模块42和编码处理模块43。Figure 4 is a schematic diagram of a video encoding device based on adaptive loop filtering according to an embodiment of this application. Referring to Figure 4, the video encoding device based on adaptive loop filtering includes an information determination module 41, a stillness determination module 42, and an encoding processing module 43.
其中,信息确定模块41,配置为确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息;The information determination module 41 is configured to determine the absolute value of the transformation residual and information and/or motion vector information of multiple image blocks in the image frame to be encoded.
静止判断模块42,配置为在待编码图像帧的时域分层层级大于预设层级的情况下,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧;The stillness determination module 42 is configured to determine whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and information and/or motion vector information when the temporal layering level of the image frame to be encoded is greater than the preset level.
编码处理模块43,配置为在待编码图像帧为静止图像帧的情况下,对待编码图像帧进行不采用自适应环路滤波的编码处理。The encoding processing module 43 is configured to perform encoding processing on the image frame to be encoded without adaptive loop filtering when the image frame to be encoded is a still image frame.
上述,通过确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息,在待编码图像帧的时域分层层级大于预设层级时,根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,并在待编码图像帧为静止图像帧时,对待编码图像帧进行不采用自适应环路滤波的编码处理,跳过部分效果较差的自适应环路滤波处理,减少自适应环路滤波处理耗费的计算资源,有效提高视频编码的效率。As described above, by determining the absolute value and information of the transform residuals and/or motion vector information of multiple image blocks in the image frame to be encoded, when the temporal layering level of the image frame to be encoded is greater than the preset level, it is determined whether the image frame to be encoded is a still image frame based on the absolute value and information of the transform residuals and/or motion vector information. When the image frame to be encoded is a still image frame, the image frame to be encoded is encoded without adaptive loop filtering, skipping some of the less effective adaptive loop filtering processes, reducing the computational resources consumed by adaptive loop filtering processes, and effectively improving the efficiency of video encoding.
在一个可能的实施例中,基于自适应环路滤波的视频编码装置还包括效果确定模块,效果确定模块配置为:在待编码图像帧为非静止图像帧的情况下,确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息;In one possible embodiment, the video coding apparatus based on adaptive loop filtering further includes an effect determination module, which is configured to: determine the filtering effect information of encoded image frames using adaptive loop filtering at levels prior to the image frame to be encoded when the image frame to be encoded is a non-still image frame;
编码处理模块43还配置为:在滤波效果信息未达到预设滤波效果条件的情况下,对待编码图像帧进行不采用自适应环路滤波的编码处理。The encoding processing module 43 is also configured to perform encoding processing on the image frame to be encoded without using adaptive loop filtering when the filtering effect information does not meet the preset filtering effect conditions.
在一个可能的实施例中,信息确定模块41确定待编码图像帧中多个图像块的变换残差绝对值和信息和/或运动矢量信息,配置为:In one possible embodiment, the information determination module 41 determines the absolute values of the transform residuals and information and/or motion vector information of multiple image blocks in the image frame to be encoded, configured as follows:
对待编码图像帧进行下采样得到下采样图像帧,并将下采样图像帧划分为多个图像块;The image frame to be encoded is downsampled to obtain a downsampled image frame, and the downsampled image frame is divided into multiple image blocks;
对多个图像块进行预编码得到各个图像块的变换残差绝对值和信息和/或运动矢量信息。Pre-encode multiple image blocks to obtain the absolute value of the transform residual and/or motion vector information of each image block.
在一个可能的实施例中,静止判断模块42根据变换残差绝对值和信息和/或运动矢量信息确定待编码图像帧是否为静止图像帧,配置为:In one possible embodiment, the stillness determination module 42 determines whether the image frame to be encoded is a still image frame based on the absolute value of the transform residual and/or motion vector information, configured as follows:
在变换残差绝对值和信息的平均值小于预设变换残差绝对值和阈值,和/或运动矢量信息的平均值小于预设运动矢量阈值的情况下,确定待编码图像帧为静止图像帧。If the average value of the absolute value of the transform residual and the average value of the information are less than the preset absolute value of the transform residual and the threshold, and/or the average value of the motion vector information is less than the preset motion vector threshold, the image frame to be encoded is determined to be a still image frame.
在一个可能的实施例中,效果确定模块确定在待编码图像帧之前的层级的采用自适应环路滤波的已编码图像帧的滤波效果信息,配置为:In one possible embodiment, the effect determination module determines the filtering effect information of the encoded image frames using adaptive loop filtering at the levels preceding the image frame to be encoded, configured as follows:
确定在待编码图像帧之前的层级的图像帧采用自适应环路滤波进行编码的第一率失真代价信息,以及不采用自适应环路滤波进行编码的第二率失真代价信息;Determine the first rate-distortion cost information for encoding image frames at levels prior to the image frame to be encoded using adaptive loop filtering, and the second rate-distortion cost information for encoding without adaptive loop filtering;
累积各个第二率失真代价信息和对应的第一率失真代价信息的差值得到滤波效果信息。The filtering effect information is obtained by accumulating the difference between each second rate distortion cost information and the corresponding first rate distortion cost information.
在一个可能的实施例中,滤波效果信息未达到预设滤波效果条件,配置为:滤波效果信息小于预设率失真代价变化阈值。In one possible embodiment, if the filtering effect information does not meet the preset filtering effect condition, it is configured as follows: the filtering effect information is less than the preset rate distortion cost change threshold.
在一个可能的实施例中,编码处理模块43还配置为:在滤波效果信息达到预设滤波效果条件的情况下,对待编码图像帧进行采用自适应环路滤波的编码处理。In one possible embodiment, the encoding processing module 43 is further configured to: perform encoding processing on the image frame to be encoded using adaptive loop filtering when the filtering effect information reaches the preset filtering effect conditions.
值得注意的是,上述基于自适应环路滤波的视频编码装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。It is worth noting that in the above embodiments of the video encoding device based on adaptive loop filtering, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.
本申请实施例还提供了一种基于自适应环路滤波的视频编码设备,该基于自适应环路滤波的视频编码设备可集成本申请实施例提供的基于自适应环路滤波的视频编码装置。图5是本申请实施例提供的一种基于自适应环路滤波的视频编码设备的结构示意图。参考图5,该基于自适应环路滤波的视频编码设备包括:输入装置53、输出装置54、存储器52以及一个或多个处理器51;存储器52,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器51执行,使得一个或多个处理器51实现如上述实施例提供的基于自适应环路滤波的视频编码方法。上述提供的基于自适应环路滤波的视频编码装置、设备和计算机可用于执行上述任意实施例提供的基于自适应环路滤波的视频编码方法,具备相应的功能和有益效果。This application also provides a video encoding device based on adaptive loop filtering, which can integrate the video encoding apparatus based on adaptive loop filtering provided in this application. Figure 5 is a schematic diagram of the structure of a video encoding device based on adaptive loop filtering provided in this application. Referring to Figure 5, the video encoding device based on adaptive loop filtering includes: an input device 53, an output device 54, a memory 52, and one or more processors 51; the memory 52 is used to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 implement the video encoding method based on adaptive loop filtering as provided in the above embodiments. The video encoding apparatus, device, and computer based on adaptive loop filtering provided above can be used to execute the video encoding method based on adaptive loop filtering provided in any of the above embodiments, and have corresponding functions and beneficial effects.
本申请实施例还提供一种存储计算机可执行指令的非易失性存储介质,计算机可执行指令在由计算机处理器执行时用于执行如上述实施例提供的基于自适应环路滤波的视频编码方法。当然,本申请实施例所提供的一种存储计算机可执行指令的非易失性存储介质,其计算机可执行指令不限于如上提供的基于自适应环路滤波的视频编码方法,还可以执行本申请任意实施例所提供的基于自适应环路滤波的视频编码方法中的相关操作。上述实施例中提供的基于自适应环路滤波的视频编码装置、设备及存储介质可执行本申请任意实施例所提供的基于自适应环路滤波的视频编码方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的基于自适应环路滤波的视频编码方法。This application also provides a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the video coding method based on adaptive loop filtering provided in the above embodiments. Of course, the computer-executable instructions provided in this application are not limited to the video coding method based on adaptive loop filtering provided above; they can also perform related operations in the video coding method based on adaptive loop filtering provided in any embodiment of this application. The video coding apparatus, device, and storage medium based on adaptive loop filtering provided in the above embodiments can execute the video coding method based on adaptive loop filtering provided in any embodiment of this application. Technical details not described in detail in the above embodiments can be found in the video coding method based on adaptive loop filtering provided in any embodiment of this application.
在上述实施例的基础上,本申请实施例还提供一种计算机程序产品,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备、移动终端或其中的处理器执行本申请各个实施例所提供的基于自适应环路滤波的视频编码方法的全部或部分步骤。Based on the above embodiments, this application also provides a computer program product. The technical solution of this application, in essence or in other words, the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions to cause a computer device, mobile terminal, or processor therein to execute all or part of the steps of the video coding method based on adaptive loop filtering provided in the various embodiments of this application.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510137501.2A CN119996713A (en) | 2025-02-07 | 2025-02-07 | A video encoding method, device and equipment based on adaptive loop filtering |
| CN202510137501.2 | 2025-02-07 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2026166360A1 true WO2026166360A1 (en) | 2026-08-13 |
Family
ID=95640290
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2026/074681 Pending WO2026166360A1 (en) | 2025-02-07 | 2026-01-23 | Adaptive loop filtering-based video encoding method, apparatus and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119996713A (en) |
| WO (1) | WO2026166360A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119996713A (en) * | 2025-02-07 | 2025-05-13 | 百果园技术(新加坡)有限公司 | A video encoding method, device and equipment based on adaptive loop filtering |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111512632A (en) * | 2017-11-01 | 2020-08-07 | Vid拓展公司 | Method for simplifying adaptive loop filter in video coding |
| US20240312211A1 (en) * | 2023-03-16 | 2024-09-19 | Alibaba (China) Co., Ltd. | Methods for frame extraction processing of video and for playing video at variable speeds, video platform, and medium |
| CN118842913A (en) * | 2024-07-09 | 2024-10-25 | 上海洛塔信息技术有限公司 | Image coding method, device, equipment, storage medium and product |
| KR20250015786A (en) * | 2023-07-24 | 2025-02-03 | 삼성전자주식회사 | Encoding method and apparatus of image, and decoding method and apparatus |
| CN119996713A (en) * | 2025-02-07 | 2025-05-13 | 百果园技术(新加坡)有限公司 | A video encoding method, device and equipment based on adaptive loop filtering |
-
2025
- 2025-02-07 CN CN202510137501.2A patent/CN119996713A/en active Pending
-
2026
- 2026-01-23 WO PCT/CN2026/074681 patent/WO2026166360A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111512632A (en) * | 2017-11-01 | 2020-08-07 | Vid拓展公司 | Method for simplifying adaptive loop filter in video coding |
| US20240312211A1 (en) * | 2023-03-16 | 2024-09-19 | Alibaba (China) Co., Ltd. | Methods for frame extraction processing of video and for playing video at variable speeds, video platform, and medium |
| KR20250015786A (en) * | 2023-07-24 | 2025-02-03 | 삼성전자주식회사 | Encoding method and apparatus of image, and decoding method and apparatus |
| CN118842913A (en) * | 2024-07-09 | 2024-10-25 | 上海洛塔信息技术有限公司 | Image coding method, device, equipment, storage medium and product |
| CN119996713A (en) * | 2025-02-07 | 2025-05-13 | 百果园技术(新加坡)有限公司 | A video encoding method, device and equipment based on adaptive loop filtering |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119996713A (en) | 2025-05-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102165780B (en) | Video encoder and its method and video decoder and its method | |
| CN114363612B (en) | Method and apparatus for bit width control of bi-directional optical flow | |
| CN101534440B (en) | Video signal encoding method | |
| US8619859B2 (en) | Motion estimation apparatus and method and image encoding apparatus and method employing the same | |
| KR102992146B1 (en) | Methods and apparatuses for prediction refinement with optical flow, bi-directional optical flow, and decoder-side motion vector refinement | |
| CN101500167A (en) | Image encoding method | |
| WO1999052297A1 (en) | Method and apparatus for encoding video information | |
| CN114342379A (en) | Method and apparatus for optical flow prediction refinement | |
| JPWO1996028937A1 (en) | Image signal encoding method and device | |
| WO2014039229A1 (en) | Video deblocking filter strength derivation | |
| CN116233466A (en) | Method and apparatus for predictive refinement of optical flow (PROF) | |
| US12395667B2 (en) | Methods and systems for temporal distance based estimating of motion in multimedia picture encoding based on previously encoded predictive picture | |
| JP2023159292A (en) | Method and apparatus for prediction refinement using optical flow | |
| JP5613319B2 (en) | Video encoding apparatus, video encoding method, and video encoding program | |
| JP2000201354A (en) | Video encoding device | |
| WO2020037501A1 (en) | Bit rate allocation method, bit rate control method, encoder, and recording medium | |
| CN102196253B (en) | Video coding method and device for adaptive selection of frame type | |
| CN116320482B (en) | Motion compensation methods, electronic devices and storage media | |
| CN114365498B (en) | Inter-frame prediction methods, encoders, decoders, and storage media | |
| CN119996713A (en) | A video encoding method, device and equipment based on adaptive loop filtering | |
| JP4571955B2 (en) | Adaptive deblocking processing method, apparatus, adaptive deblocking processing program, and computer-readable recording medium | |
| CN102655591B (en) | Dynamic image encoding device, moving image decoding apparatus and dynamic image encoding method | |
| CN118842913A (en) | Image coding method, device, equipment, storage medium and product | |
| CN1610408B (en) | A dynamically adjusted video encoding method and related device | |
| CN115315955A (en) | Simplified method and apparatus for bi-directional optical flow and decoder-side motion vector refinement |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 26751754 Country of ref document: EP Kind code of ref document: A1 |