CN109495742B - A video frame coding method, device and equipment - Google Patents

A video frame coding method, device and equipment Download PDF

Info

Publication number
CN109495742B
CN109495742B CN201811528004.1A CN201811528004A CN109495742B CN 109495742 B CN109495742 B CN 109495742B CN 201811528004 A CN201811528004 A CN 201811528004A CN 109495742 B CN109495742 B CN 109495742B
Authority
CN
China
Prior art keywords
frame
prediction
video
prediction mode
encoding
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.)
Active
Application number
CN201811528004.1A
Other languages
Chinese (zh)
Other versions
CN109495742A (en
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.)
Shenzhen Onething Technologies Co Ltd
Original Assignee
Shenzhen Onething Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technologies Co Ltd filed Critical Shenzhen Onething Technologies Co Ltd
Priority to CN201811528004.1A priority Critical patent/CN109495742B/en
Publication of CN109495742A publication Critical patent/CN109495742A/en
Application granted granted Critical
Publication of CN109495742B publication Critical patent/CN109495742B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a video frame coding method, which comprises the following steps: after receiving the pre-analysis instruction, sampling a frame to be coded in the video to be compressed to obtain a down-sampling frame, pre-analyzing the down-sampling frame to obtain a prediction mode of the down-sampling frame, and storing the prediction mode; after receiving an actual coding instruction, calling a prediction mode corresponding to the frame to be coded from the stored prediction modes to predict the frame to be coded; and after the prediction operation of all frames to be encoded in the video to be compressed is completed, carrying out subsequent encoding operation according to a prediction result to obtain video compression data of the video to be compressed. The invention directly utilizes the prediction mode obtained in the pre-analysis process in the actual coding stage to improve the utilization rate of computing resources and the coding efficiency. The invention also discloses a device, equipment and a computer readable storage medium based on the method.

Description

一种视频帧编码方法、装置及设备A video frame coding method, device and equipment

技术领域technical field

本发明涉及视频压缩技术领域,特别是涉及一种视频帧编码方法。本发明还涉及一种视频帧编码装置、设备及计算机可读存储介质。The invention relates to the technical field of video compression, in particular to a video frame encoding method. The present invention also relates to a video frame encoding device, device and computer-readable storage medium.

背景技术Background technique

H.264/AVC是目前使用最广泛的视频压缩格式。视频压缩的主要手段是,通过预测去除帧内或帧间的冗余信息。预测是视频压缩的核心技术之一,相应的,视频压缩的两种预测方式分别是帧内预测和帧间预测。H.264的帧内预测支持4x4、8x8、16x16等尺寸,并且支持亮度和色度的帧内预测。H.264/AVC is currently the most widely used video compression format. The main means of video compression is to remove redundant information within or between frames through prediction. Prediction is one of the core technologies of video compression. Correspondingly, the two prediction methods of video compression are intra prediction and inter prediction. The intra-frame prediction of H.264 supports 4x4, 8x8, 16x16 and other sizes, and supports intra-frame prediction of luma and chroma.

预分析是目前H.264编码器普遍采用的一种近似编码过程的处理模块,例如,最著名的开源H.264编码器x264,它实现了被统称为lookahead的预分析功能,其目的是为了在实际编码之前,对待编码的视频进行下采样,然后对下采样帧进行模拟分析,从而得到下采样帧的复杂度等;预分析的过程包括了帧类型判决、自适应量化AQ、mbtree、精简的8x8帧内预测、精简的ME等功能。由上文可知,x264在lookahead部分实现了精简的8x8帧内预测。预分析完成后,编码器会开始实际的编码过程,这个过程中,还要再次进行帧内预测等操作来确定帧内预测的模式,计算过程复杂,编码效率低。Pre-analysis is a processing module commonly used by H.264 encoders to approximate the encoding process. For example, the most famous open-source H.264 encoder x264 implements the pre-analysis function collectively called lookahead. Its purpose is to Before the actual encoding, the video to be encoded is down-sampled, and then the down-sampled frame is simulated and analyzed to obtain the complexity of the down-sampled frame, etc.; the pre-analysis process includes frame type judgment, adaptive quantization AQ, mbtree, streamlining 8x8 intra-frame prediction, streamlined ME and other functions. As can be seen from the above, x264 implements simplified 8x8 intra-frame prediction in the lookahead part. After the pre-analysis is completed, the encoder will start the actual encoding process. During this process, intra-frame prediction and other operations must be performed again to determine the intra-frame prediction mode. The calculation process is complicated and the encoding efficiency is low.

因此,如何提供一种编码效率高的视频帧编码方案是本领域技术人员目前需要解决的问题。Therefore, how to provide a video frame coding scheme with high coding efficiency is a problem that those skilled in the art need to solve.

发明内容Contents of the invention

本发明的目的是提供一种视频帧编码方法,在实际编码阶段直接利用预分析过程中得到的预测模式,来提高计算资源的利用率以及编码的效率;本发明的另一目的是提供一种基于上述方法的装置、设备及计算机可读存储介质。The purpose of the present invention is to provide a video frame coding method, which directly uses the prediction mode obtained in the pre-analysis process in the actual coding stage to improve the utilization rate of computing resources and the efficiency of coding; another purpose of the present invention is to provide a An apparatus, device, and computer-readable storage medium based on the above method.

为解决上述技术问题,本发明提供了一种视频帧编码方法,包括:In order to solve the above technical problems, the present invention provides a video frame encoding method, comprising:

接收预分析指令后,对待压缩视频中的待编码帧进行采样得到下采样帧,对所述下采样帧进行预分析,得到所述下采样帧的预测模式并进行保存;After receiving the pre-analysis instruction, sampling the frame to be encoded in the video to be compressed to obtain a down-sampled frame, performing pre-analysis on the down-sampled frame, obtaining the prediction mode of the down-sampled frame and saving it;

接收实际编码指令后,从保存的预测模式中调用所述待编码帧对应的预测模式来对所述待编码帧进行预测;After receiving the actual encoding instruction, call the prediction mode corresponding to the frame to be encoded from the saved prediction mode to predict the frame to be encoded;

完成对所述待压缩视频中全部待编码帧的预测操作后,依据预测结果进行后续的编码操作,得到所述待压缩视频的视频压缩数据。After the prediction operation on all the frames to be encoded in the video to be compressed is completed, a subsequent encoding operation is performed according to the prediction result to obtain video compression data of the video to be compressed.

优选地,得到的所述下采样帧的预测模式保存至所述下采样帧对应的待编码帧的数据结构中。Preferably, the obtained prediction mode of the downsampled frame is stored in the data structure of the frame to be encoded corresponding to the downsampled frame.

优选地,得到的所述下采样帧的预测模式与所述下采样帧对应的待编码帧的标识,对应的保存至预测模式列表内。Preferably, the obtained prediction mode of the down-sampled frame and the identifier of the frame to be encoded corresponding to the down-sampled frame are correspondingly stored in the prediction mode list.

优选地,所述预测模式包括帧内预测的模式。Preferably, the prediction mode includes an intra prediction mode.

优选地,所述预测模式包括帧内预测的模式和帧间预测的模式。Preferably, the prediction mode includes an intra prediction mode and an inter prediction mode.

优选地,所述下采样帧采用8×8的块划分方式进行划分。Preferably, the down-sampled frame is divided in an 8×8 block division manner.

为解决上述技术问题,本发明还提供了一种视频帧编码装置,包括:In order to solve the above technical problems, the present invention also provides a video frame encoding device, including:

预分析模块,用于接收预分析指令后,对待压缩视频中的待编码帧进行采样得到下采样帧,对所述下采样帧进行预分析,得到所述下采样帧的预测模式并进行保存;The pre-analysis module is used to sample the frame to be encoded in the video to be compressed to obtain a down-sampled frame after receiving the pre-analysis instruction, perform pre-analysis on the down-sampled frame, obtain the prediction mode of the down-sampled frame and save it;

预测编码模块,用于接收实际编码指令后,从保存的预测模式中调用所述待编码帧对应的预测模式来对所述待编码帧进行预测;The predictive encoding module is configured to call the prediction mode corresponding to the frame to be encoded from the saved prediction modes to predict the frame to be encoded after receiving the actual encoding instruction;

后续编码模块,用于完成对所述待压缩视频中全部待编码帧的预测操作后,依据预测结果进行后续的编码操作,得到所述待压缩视频的视频压缩数据。The subsequent encoding module is configured to perform subsequent encoding operations according to the prediction results after completing the prediction operation on all the frames to be encoded in the video to be compressed, so as to obtain video compression data of the video to be compressed.

为解决上述技术问题,本发明还提供了一种视频帧编码设备,所述设备包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的视频帧编码程序,所述视频帧编码程序被所述处理器执行时实现如以上任一项所述的视频帧编码方法。In order to solve the above technical problems, the present invention also provides a video frame encoding device, the device includes a memory and a processor, the memory stores a video frame encoding program that can run on the processor, the video When the frame coding program is executed by the processor, the video frame coding method described in any one of the above items is realized.

优选地,所述设备为组成内容分发网络CDN网络或者区块链网络的节点。Preferably, the device is a node forming a content distribution network CDN network or a blockchain network.

为解决上述技术问题,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有视频帧编码程序,所述视频帧编码程序可被一个或者多个处理器执行,以实现如以上任一项所述的视频帧编码方法。In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a video frame coding program is stored, and the video frame coding program can be executed by one or more processors, To realize the video frame encoding method described in any one of the above.

本发明提供了一种视频帧编码方法,在该方法中,在预分析过程中,得到每个待编码帧的预测模式,之后在实际编码时,直接使用之前预分析时得到的预测模式来对各个待编码帧进行预测,预测完成后,进行后续编码操作,来得到视频压缩数据。可见,在本发明中,在实际编码过程中,直接利用之前预分析过程中得到的各个待编码帧的预测模式,使得实际编码过程中不需要再次进行预测模式的计算操作,不仅提高了计算资源的利用效率,并且减小了实际编码过程中的计算量,提高了编码效率。本发明还提供了一种基于上述方法的装置、设备及计算机可读存储介质。The present invention provides a method for encoding video frames. In this method, during the pre-analysis process, the prediction mode of each frame to be encoded is obtained, and then the prediction mode obtained during the previous pre-analysis is directly used for actual encoding. Each frame to be encoded is predicted, and after the prediction is completed, a subsequent encoding operation is performed to obtain compressed video data. It can be seen that in the present invention, in the actual encoding process, the prediction mode of each frame to be encoded obtained in the previous pre-analysis process is directly used, so that the calculation operation of the prediction mode does not need to be performed again in the actual encoding process, which not only improves the calculation resource The utilization efficiency, and reduce the amount of calculation in the actual encoding process, improve the encoding efficiency. The present invention also provides a device, equipment and computer-readable storage medium based on the above method.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对现有技术和实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the prior art and the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为本发明提供的一种视频帧编码方法的过程的流程图;Fig. 1 is the flowchart of the process of a kind of video frame encoding method provided by the present invention;

图2为4×4帧内预测亮度块和预测方向示意图;FIG. 2 is a schematic diagram of a 4×4 intra-frame prediction luma block and prediction direction;

图3为4×4帧内预测模式示意图;FIG. 3 is a schematic diagram of a 4×4 intra-frame prediction mode;

图4为一种预分析过程的细化流程示意图;Fig. 4 is a schematic flow chart of a refinement of the pre-analysis process;

图5为本发明提供的一种视频帧编码装置的结构示意图。FIG. 5 is a schematic structural diagram of a video frame encoding device provided by the present invention.

具体实施方式Detailed ways

本发明的核心是提供一种视频帧编码方法,在实际编码阶段直接利用预分析过程中得到的预测模式,来提高计算资源的利用率以及编码的效率;本发明的另一核心是提供一种基于上述方法的装置、设备及计算机可读存储介质。The core of the present invention is to provide a video frame encoding method, which directly uses the prediction mode obtained in the pre-analysis process in the actual encoding stage to improve the utilization rate of computing resources and the efficiency of encoding; another core of the present invention is to provide a An apparatus, device, and computer-readable storage medium based on the above method.

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and not necessarily Used to describe a specific sequence or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

需要说明的是,在本发明中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。It should be noted that the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and should not be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features . Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present invention.

本发明提供了一种视频帧编码方法,参见图1所示,图1为本发明提供的一种视频帧编码方法的过程的流程图;该方法包括:The present invention provides a video frame encoding method, as shown in FIG. 1, and FIG. 1 is a flow chart of the process of a video frame encoding method provided by the present invention; the method includes:

步骤s11:接收预分析指令后,对待压缩视频中的待编码帧进行采样得到下采样帧,对下采样帧进行预分析,得到下采样帧的预测模式并进行保存;Step s11: After receiving the pre-analysis instruction, sample the frame to be encoded in the video to be compressed to obtain a down-sampled frame, perform pre-analysis on the down-sampled frame, obtain the prediction mode of the down-sampled frame and save it;

其中,对于一个样值序列间隔几个样值取样一次,这样得到新序列就是原序列的下采样,因此,下采样帧相比原始帧体积要小得多,但是下采样帧能够尽可能保留原始帧中的元素点的分布特征,下采样帧与原始帧的画面内容基本相同。通过预先对与原始帧近似的下采样帧进行分析,从而能够预先得到一些基于原始帧的特征的信息,如复杂度等,方便后续使用。Among them, a sample sequence is sampled every few samples, so that the new sequence obtained is the downsampling of the original sequence. Therefore, the downsampled frame is much smaller than the original frame, but the downsampled frame can retain the original frame as much as possible. The distribution characteristics of the element points in the frame, the picture content of the downsampled frame is basically the same as that of the original frame. By analyzing the downsampled frame similar to the original frame in advance, some information based on the characteristics of the original frame, such as complexity, can be obtained in advance, which is convenient for subsequent use.

但是目前在进行预分析的过程中,虽然也会得到下采样帧的预测模式,但是这部分预测模式并未应用于后续实际的编码过程中,导致了计算资源的浪费。因此,本发明在预分析完成后,将得到的下采样帧的预测模式进行保存,在后续实际编码时,直接使用这些预测模式进行编码。由于下采样帧与待编码帧的画面基本相同,因此,下采样帧计算得到的预测模式与后续的实际编码过程中的预测过程的相关度是很高的,故直接将预分析模块已经计算过的预测模式引入到后续的实际编码的预测过程中,不仅提高了计算资源的利用率,并且使得实际过程中不再需要计算预测模式,从而简化了实际编码时的预测过程。However, in the current pre-analysis process, although the prediction mode of the downsampled frame is also obtained, this part of the prediction mode is not applied to the subsequent actual encoding process, resulting in a waste of computing resources. Therefore, after the pre-analysis is completed, the present invention saves the obtained prediction modes of the down-sampled frames, and directly uses these prediction modes for encoding in subsequent actual encoding. Since the pictures of the downsampled frame and the frame to be encoded are basically the same, the prediction mode calculated by the downsampled frame has a high correlation with the prediction process in the subsequent actual encoding process, so the pre-analysis module has been calculated directly The introduction of the prediction mode into the subsequent actual encoding prediction process not only improves the utilization of computing resources, but also eliminates the need to calculate the prediction mode in the actual process, thereby simplifying the actual encoding prediction process.

步骤s12:接收实际编码指令后,从保存的预测模式中调用待编码帧对应的预测模式来对待编码帧进行预测;Step s12: After receiving the actual encoding instruction, call the prediction mode corresponding to the frame to be encoded from the saved prediction mode to predict the frame to be encoded;

接收实际编码指令后,会开始对待压缩视频中的待编码帧进行实际编码。After receiving the actual encoding instruction, the actual encoding of the frame to be encoded in the video to be compressed will start.

可以理解的是,预测模式是以宏块为单位的,每个待编码帧会包含多个宏块,每个宏块对应一个预测模式,因此,本发明中提到的待编码帧对应的预测模式,实际上指的是待编码帧中每个宏块对应的预测模式。并且,每个待编码帧调用的预测模式,为预分析时该待编码帧对应的下采样帧计算得到的预测模式。It can be understood that the prediction mode is based on macroblocks, and each frame to be encoded will contain multiple macroblocks, and each macroblock corresponds to a prediction mode. Therefore, the prediction corresponding to the frame to be encoded mentioned in the present invention The mode actually refers to the prediction mode corresponding to each macroblock in the frame to be encoded. Moreover, the prediction mode invoked by each frame to be encoded is the prediction mode calculated from the downsampled frame corresponding to the frame to be encoded during pre-analysis.

步骤s13:完成对待压缩视频中全部待编码帧的预测操作后,依据预测结果进行后续的编码操作,得到待压缩视频的视频压缩数据。Step s13: After the prediction operation of all frames to be encoded in the video to be compressed is completed, subsequent encoding operations are performed according to the prediction results to obtain video compression data of the video to be compressed.

本发明提供的上述视频帧编码方法,在该方法中,在预分析过程中,得到每个待编码帧的预测模式,之后在实际编码时,直接使用之前预分析时得到的预测模式来对各个待编码帧进行预测。可见,在本发明中,在实际编码过程中,直接利用之前预分析过程中得到的各个待编码帧的预测模式,这种复用预分析模块的预测模式计算结果的方式,使得实际编码过程中不需要再次进行预测模式的计算操作,不仅提高了计算资源的利用效率,并且减小了实际编码过程中的计算量,提高了编码效率。The above-mentioned video frame encoding method provided by the present invention, in this method, in the pre-analysis process, the prediction mode of each frame to be encoded is obtained, and then in the actual encoding, the prediction mode obtained during the previous pre-analysis is directly used for each frame. The frame to be coded is predicted. It can be seen that in the present invention, in the actual encoding process, the prediction mode of each frame to be encoded obtained in the previous pre-analysis process is directly used. This way of multiplexing the calculation results of the prediction mode of the pre-analysis module makes the actual encoding process The calculation operation of the prediction mode does not need to be performed again, which not only improves the utilization efficiency of calculation resources, but also reduces the calculation amount in the actual encoding process, and improves the encoding efficiency.

可以理解的是,由于一帧图像图像中连续的像素点之间存在前后相关性,因此可以采用预测编码的方式进行图像预测,此时预测编码后输出的不再是原始的像素点的值,而是像素点的预测值与实际值的差。预测编码如此设计的出发点在于,由于前后存在相关性,相邻像素点存在大量相同或相近的现象,通过计算其差值,可以减少大量用于保存和传输原始像素点的值的数据体积。而预测编码包括帧间预测和帧内预测,帧内预测指的是同一帧图像内像素点间进行比较,依据其差值得到最终输出的编码;帧间预测指的是连续不同帧之间的像素点的比较,依据其差值得到最终输出的编码。另外,帧内预测包括亮度和色度两部分,虽然亮度和色度的尺寸有区别,但其帧内预测的原理是一致的。本发明针对的是亮度的帧内预测。It can be understood that, since there is a front-rear correlation between consecutive pixels in a frame of image, the predictive coding method can be used for image prediction. At this time, the output after predictive coding is no longer the original pixel value. It is the difference between the predicted value of the pixel and the actual value. The starting point of the design of predictive coding is that due to the correlation between the front and back, there are a lot of the same or similar phenomena in adjacent pixels. By calculating the difference, a large amount of data volume used to save and transmit the value of the original pixel can be reduced. The predictive coding includes inter-frame prediction and intra-frame prediction. Intra-frame prediction refers to the comparison between pixels in the same frame image, and the final output coding is obtained according to the difference; inter-frame prediction refers to the difference between consecutive different frames. The pixel points are compared, and the final output code is obtained according to the difference value. In addition, intra-frame prediction includes luma and chroma. Although the sizes of luma and chroma are different, the principle of intra-frame prediction is the same. The present invention is directed to intra prediction of luma.

具体的,本发明中的预测模式指的是对于一个图像帧,应该采用帧内预测还是帧间预测,以及帧内预测时每个宏块具体采用的是哪种帧内预测的模式。下面以4x4帧内预测为例,8x8和16x16的帧内预测过程基本与此相同,不再另行叙述。帧内预测的实现原理为:Specifically, the prediction mode in the present invention refers to whether intra-frame prediction or inter-frame prediction should be used for an image frame, and which intra-frame prediction mode is specifically adopted for each macroblock during intra-frame prediction. In the following, 4x4 intra-frame prediction is taken as an example. The intra-frame prediction processes of 8x8 and 16x16 are basically the same and will not be described separately. The implementation principle of intra prediction is as follows:

参见图2和图3所示,图3为4×4帧内预测模式示意图。Referring to FIG. 2 and FIG. 3 , FIG. 3 is a schematic diagram of a 4×4 intra-frame prediction mode.

一帧图像被分为多个宏块,对于4x4模式,即该帧图像中每个宏块的亮度分量被分为4×4个亮度点(即16个亮度点),每一个宏块作为一个帧内预测的基本单元,针对每一个宏块进行预测与编码。帧内预测会参考每一个像素点的相邻像素点来构建预测数据。对于某一个4×4的宏块而言,该宏块上方4个、右上方4个、左侧4个以及左上方顶点的1个像素,共13个像素会作为参考像素构建预测块(即待预测的宏块)。预测块同参考像素的位置关系如图2所示,图2为4×4帧内预测亮度块和预测方向示意图;在图2中,a~p表示预测块中的像素,A/B/C/D表示上方参考像素,E/F/G/H表示右上方的参考像素,I/J/K/L表示左方参考像素,Q表示左上方的参考像素。对于4×4亮度分量的帧内预测,共定义了9种不同预测模式。除DC模式以外,其他8种模式的方向描述如表1、图2(b)和图3所示,这里的方向指的是:在该模式下,每一个预测块中像素点的预测值由该方向上相邻的像素点的值预测得到。DC模式下,用上方和左方相邻像素的均值表示整个预测块的预测值。A frame of image is divided into multiple macroblocks. For 4x4 mode, the luminance component of each macroblock in the frame image is divided into 4x4 luminance points (that is, 16 luminance points), and each macroblock is used as a The basic unit of intra prediction is to perform prediction and coding for each macroblock. Intra prediction refers to the neighboring pixels of each pixel to construct prediction data. For a certain 4×4 macroblock, a total of 13 pixels will be used as reference pixels to build a prediction block (ie macroblock to be predicted). The positional relationship between the prediction block and the reference pixel is shown in Figure 2, which is a schematic diagram of the 4×4 intra-frame prediction brightness block and the prediction direction; in Figure 2, a~p represent the pixels in the prediction block, A/B/C /D indicates the upper reference pixel, E/F/G/H indicates the upper right reference pixel, I/J/K/L indicates the left reference pixel, and Q indicates the upper left reference pixel. For intra-frame prediction of 4×4 luma components, 9 different prediction modes are defined. In addition to the DC mode, the direction descriptions of the other eight modes are shown in Table 1, Figure 2(b) and Figure 3. The direction here refers to: in this mode, the predicted value of the pixel in each prediction block is determined by The values of adjacent pixels in this direction are predicted. In the DC mode, the average value of the upper and left adjacent pixels is used to represent the prediction value of the entire prediction block.

表1H.264的帧内预测模式的方向描述Direction Description of Intra Prediction Mode of Table 1H.264

Figure BDA0001904942350000061
Figure BDA0001904942350000061

Figure BDA0001904942350000071
Figure BDA0001904942350000071

作为优选地,步骤s11中,得到的下采样帧的预测模式保存至下采样帧对应的待编码帧的数据结构中。Preferably, in step s11, the obtained prediction mode of the downsampled frame is stored in the data structure of the frame to be encoded corresponding to the downsampled frame.

可以理解的是,每个下采样帧与待编码帧一一对应,因此预分析过程中得到的下采样帧的预测模式也分别与待编码帧一一对应。为了方便后续实际编码过程中调用这些预测模式,本实施例中,将得到的每个下采样帧的预测模式保存至该下采样帧对应的待编码帧的数据结构中,使得后续这些待编码帧在进行实际编码时,可以直接从自身的数据结构中获取之前保存的预测模式进行预测编码,保证了预测模式调用的准确性以及预测模式的调用速度。这里保存在待编码帧的数据结构内可以指的是保存至与该待编码帧绑定的存储位置内,本发明对此不限定待编码帧的数据结构所指的存储位置。It can be understood that each downsampled frame is in one-to-one correspondence with the frame to be encoded, so the prediction modes of the downsampled frame obtained in the pre-analysis process are also in one-to-one correspondence with the frame to be encoded. In order to facilitate calling these prediction modes in the subsequent actual encoding process, in this embodiment, the obtained prediction mode of each downsampled frame is stored in the data structure of the frame to be encoded corresponding to the downsampled frame, so that the subsequent frames to be encoded When performing actual coding, the previously saved prediction mode can be directly obtained from its own data structure for predictive coding, which ensures the accuracy of the prediction mode call and the speed of the prediction mode call. Here, storing in the data structure of the frame to be encoded may refer to storing in a storage location bound to the frame to be encoded, and the present invention does not limit the storage location referred to by the data structure of the frame to be encoded.

在另一优选实施例中,步骤s11中,得到的下采样帧的预测模式与下采样帧对应的待编码帧的标识,对应的保存至预测模式列表内。In another preferred embodiment, in step s11, the obtained prediction mode of the down-sampled frame and the identification of the frame to be encoded corresponding to the down-sampled frame are correspondingly stored in the prediction mode list.

可以理解的是,在本实施例中设置了一个预设模式列表,该列表中保存有每个待编码帧的标识,在预分析得到下采样帧的预测模式时,可以将预测模式保存至该列表内相应的待编码帧的标识所对应的位置。或者,也可以不预先在列表内保存待编码帧的标识,而是在计算得到下采样帧的预测模式时,再将预测模式与其对应的待编码帧的标识统一保存至列表内。这种方式下,预测模式可以统一进行管理和保存,也便于为预测模式的保存分配存储空间,并且方便后续工作人员追溯历史预测模式记录。It can be understood that, in this embodiment, a preset mode list is set, and the identifier of each frame to be encoded is saved in the list, and when the prediction mode of the downsampled frame is obtained by pre-analysis, the prediction mode can be saved to the The position corresponding to the identifier of the frame to be encoded in the list. Alternatively, instead of saving the identifier of the frame to be encoded in the list in advance, the prediction mode and the identifier of the frame to be encoded corresponding to it are uniformly stored in the list when the prediction mode of the downsampled frame is calculated. In this way, the prediction mode can be managed and saved in a unified manner, and it is also convenient to allocate storage space for the preservation of the prediction mode, and it is convenient for subsequent staff to trace the historical prediction mode records.

另外,在保存预测模式时,可以首先缓存得到的预测模式,等到全部下采样帧的预测模式均计算完毕后再统一进行保存;或者也可以每得到一个下采样帧的预测模式,则立即进行保存,之后再计算下一个下采样帧的预测模式。具体采用哪种方式,本发明不做限定。In addition, when saving the prediction mode, the obtained prediction mode can be cached first, and then saved uniformly after all the prediction modes of the downsampled frames are calculated; or it can be saved immediately every time the prediction mode of a downsampled frame is obtained , and then calculate the prediction mode for the next downsampled frame. Which method is used specifically is not limited in the present invention.

其中,预分析的主要功能是计算下采样帧的复杂度、实现帧类型的判决、mbtree等。参见图4所示,图4为一种预分析过程的细化流程示意图;其实现的主要原理是:Among them, the main function of the pre-analysis is to calculate the complexity of the downsampled frame, realize the judgment of the frame type, mbtree, etc. Referring to shown in Figure 4, Figure 4 is a schematic diagram of a detailed flow chart of a pre-analysis process; the main principles of its realization are:

步骤s21:对输入的原始帧进行下采样,获取下采样帧;Step s21: Downsampling the input original frame to obtain the downsampled frame;

步骤s22:对下采样帧进行8x8块大小的划分,每个8x8块分别对应原始帧中的一个16x16的宏块;当然,这里也可以进行4x4块大小的划分,本发明对此不作限定。Step s22: divide the downsampled frame into 8x8 blocks, each 8x8 block corresponds to a 16x16 macroblock in the original frame; of course, 4x4 blocks can also be divided here, which is not limited in the present invention.

步骤s23:计算每种模式下,下采样帧的代价;若下采样帧为I帧,则计算其包含的每个8x8块在不同帧内模式的代价;若下采样帧为P、B帧,则计算其包含的每个8x8块在不同帧内模式的代价,以及进行运动估计ME过程,计算出其包含的每个8x8块在不同帧间模式的代价;Step s23: Calculate the cost of the downsampled frame in each mode; if the downsampled frame is an I frame, calculate the cost of each 8x8 block it contains in different intra-frame modes; if the downsampled frame is a P, B frame, Then calculate the cost of each 8x8 block it contains in different intra-frame modes, and perform the motion estimation ME process to calculate the cost of each 8x8 block it contains in different inter-frame modes;

这里的代价指的是失真代价,即在每种帧内模式下,采用预测编码的方式后的失真率;每种模式中下采样帧的代价等于自身包含的全部8x8块的代价之和,构成完整的下采样帧的代价;The cost here refers to the distortion cost, that is, in each intra-frame mode, the distortion rate after adopting the predictive coding method; the cost of the downsampled frame in each mode is equal to the sum of the costs of all 8x8 blocks contained in itself, forming The cost of a complete downsampled frame;

步骤s24:从以上计算的代价中,选择代价最小的模式作为后续该下采样帧对应的原始帧在实际的编码过程中的预测类型。Step s24: From the above calculated costs, select the mode with the smallest cost as the prediction type of the original frame corresponding to the subsequent downsampled frame in the actual encoding process.

即例如计算帧内预测的代价时,则分别模拟计算9种帧内预测模式下,最终计算得到的预测编码还原后的图像和实际图像之间的失真率,这里的失真率即为代价,失真率越大则代价越大,表明这种预测模式效果越差,因此,模拟计算后,选择代价最小的模式作为预分析得到的最终预测模式。当然,帧间预测也是同样的过程。并且,上述比较时,是从全部计算的帧间预测模式和帧内预测模式的代价中,选择一个,因此,最终下采样帧选择的预测模式,有可能是帧内预测的模式,也有可能是帧间预测的模式。由于待压缩视频中包含多个待编码帧,因此一个待压缩视频包含的待编码帧中,有的待编码帧的预测模式为帧内预测的模式,有的待编码帧的预测模式为帧间预测的模式。即最终得到的全部待编码帧预测模式可能同时包括帧内预测的模式和帧间预测的模式,也可能全部是帧内预测的模式,本发明对此不做限定。That is, for example, when calculating the cost of intra-frame prediction, simulate and calculate the distortion rate between the finally calculated predictive encoding and restored image and the actual image under the 9 intra-frame prediction modes respectively. The distortion rate here is the cost, and the distortion The larger the rate is, the greater the cost is, indicating that the effect of this prediction model is worse. Therefore, after the simulation calculation, the model with the smallest cost is selected as the final prediction model obtained from the pre-analysis. Of course, inter prediction is the same process. Moreover, in the above comparison, one is selected from the cost of all calculated inter-frame prediction modes and intra-frame prediction modes. Therefore, the prediction mode selected for the final down-sampled frame may be the intra-frame prediction mode, or it may be The mode of inter prediction. Since the video to be compressed contains multiple frames to be encoded, among the frames to be encoded contained in a video to be compressed, the prediction mode of some frames to be encoded is intra-frame prediction mode, and the prediction mode of some frames to be encoded is inter-frame prediction predictive model. That is, all prediction modes of frames to be coded that are finally obtained may include intra-frame prediction modes and inter-frame prediction modes at the same time, or may all be intra-frame prediction modes, which is not limited in the present invention.

作为优选地,下采样帧采用8×8的块划分方式进行划分。Preferably, the down-sampling frame is divided in an 8×8 block division manner.

可以理解的是,若下采样帧采用4×4的块划分方式的话,表明每个4×4的块对应的是待编码帧中的一个8×8的块,由于8×8的块无法覆盖16x16块,因此后续待编码帧在实际编码时,若按照16x16划分的话,则无法使用预分析过程中的预测模式,即后续实际编码时,仅能支持4×4或8×8的划分方式,这样导致局限性较小。而本实施例中下采样帧采用8×8的块划分的话,则表明每个8×8的块对应的是待编码帧中的一个16x16的块,即后续实际编码过程中,每个下采样帧的预测模式可以应用在一个待编码帧中的16x16的块内,由于16x16能够覆盖4x4、8x8、16x16三种大小的块,因此实际编码过程中,可以同时支持4x4、8x8、16x16三种块划分方式,即待编码帧可以配置为4x4、8x8、16x16中的任一种,从而方便了实际编码过程中待编码帧的宏块划分过程。当然,以上仅为一种优选方案,本发明不限定具体的块划分方法。It is understandable that if the downsampling frame adopts the 4×4 block division method, it indicates that each 4×4 block corresponds to an 8×8 block in the frame to be encoded, because the 8×8 block cannot cover 16x16 blocks, so if the subsequent frames to be encoded are divided according to 16x16 in actual encoding, the prediction mode in the pre-analysis process cannot be used, that is, in the subsequent actual encoding, only 4×4 or 8×8 division methods can be supported. This results in less limitations. In this embodiment, if the downsampling frame is divided into 8×8 blocks, it indicates that each 8×8 block corresponds to a 16×16 block in the frame to be encoded, that is, in the subsequent actual encoding process, each downsampling The frame prediction mode can be applied to a 16x16 block in a frame to be encoded. Since 16x16 can cover blocks of three sizes: 4x4, 8x8, and 16x16, in the actual encoding process, three blocks of 4x4, 8x8, and 16x16 can be supported at the same time. The division method, that is, the frame to be encoded can be configured as any one of 4x4, 8x8, and 16x16, which facilitates the macroblock division process of the frame to be encoded in the actual encoding process. Of course, the above is only a preferred solution, and the present invention does not limit a specific block division method.

本发明还提供了一种视频帧编码装置,参见图5所示,图5为本发明提供的一种视频帧编码装置的结构示意图。该装置包括:The present invention also provides a video frame coding device, as shown in FIG. 5 , which is a schematic structural diagram of a video frame coding device provided by the present invention. The unit includes:

预分析模块1,用于接收预分析指令后,对待压缩视频中的待编码帧进行采样得到下采样帧,对下采样帧进行预分析,得到下采样帧的预测模式并进行保存;The pre-analysis module 1 is used to sample the frame to be encoded in the video to be compressed to obtain a down-sampled frame after receiving the pre-analysis instruction, and perform pre-analysis on the down-sampled frame to obtain a prediction mode of the down-sampled frame and save it;

预测编码模块2,用于接收实际编码指令后,从保存的预测模式中调用待编码帧对应的预测模式来对待编码帧进行预测;The predictive encoding module 2 is configured to call the prediction mode corresponding to the frame to be encoded from the saved prediction mode to predict the frame to be encoded after receiving the actual encoding instruction;

后续编码模块3,用于完成对待压缩视频中全部待编码帧的预测操作后,依据预测结果进行后续的编码操作,得到待压缩视频的视频压缩数据。The subsequent encoding module 3 is configured to perform subsequent encoding operations according to the prediction results after completing the prediction operation of all the frames to be encoded in the video to be compressed to obtain compressed video data of the video to be compressed.

以上模块可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The above modules may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

本发明还提供了一种视频帧编码设备,设备包括存储器和处理器,存储器上存储有可在处理器上运行的视频帧编码程序,视频帧编码程序被处理器执行时实现如以上任一项的视频帧编码方法。The present invention also provides a video frame coding device, the device includes a memory and a processor, the memory stores a video frame coding program that can run on the processor, and when the video frame coding program is executed by the processor, any of the above The video frame encoding method.

该视频帧编码设备可以包括存储器、处理器和总线。The video frame encoding device may include a memory, a processor and a bus.

其中,存储器至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器在一些实施例中可以是视频帧编码设备的内部存储单元,例如该视频帧编码设备的硬盘。存储器在另一些实施例中也可以是设备的外部存储设备,例如视频帧编码设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器还可以既包括视频帧编码设备的内部存储单元也包括外部存储设备。存储器不仅可以用于存储安装于视频帧编码设备的应用软件及各类数据,例如视频帧编码程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of the video frame encoding device, such as a hard disk of the video frame encoding device. The memory may also be an external storage device of the device in other embodiments, such as a plug-in hard disk equipped on a video frame encoding device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc. Further, the memory may also include both an internal storage unit of the video frame encoding device and an external storage device. The memory can not only be used to store application software and various data installed in the video frame coding device, such as the code of the video frame coding program, but also can be used to temporarily store the data that has been output or will be output.

处理器在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器中存储的程序代码或处理数据,例如执行视频帧编码程序等。In some embodiments, the processor can be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chips for running program codes stored in the memory or processing data, For example, execute a video frame encoding program, etc.

该总线用于连接处理器和存储器,总线可以是外设部件互连标准(peripheralcomponent interconnect,简称PCI)总线或扩展工业标准结构(extended industrystandard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。The bus is used to connect the processor and the memory, and the bus may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on.

进一步地,视频帧编码设备还可以包括网络接口,用于接收输入的待压缩视频以及输出压缩完成后的视频数据等。这里的网络接口可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该设备与其他电子设备之间建立通信连接。Further, the video frame encoding device may also include a network interface, configured to receive input video to be compressed and output compressed video data. The network interface here may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which are generally used to establish a communication connection between the device and other electronic devices.

可选地,该设备还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在视频帧编码设备中处理的信息以及用于显示可视化的用户界面。Optionally, the device may further include a user interface. The user interface may include a display (Display) and an input unit such as a keyboard (Keyboard). Optional user interfaces may also include standard wired interfaces and wireless interfaces. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. Wherein, the display may also be properly referred to as a display screen or a display unit, and is used for displaying information processed in the video frame encoding device and for displaying a visualized user interface.

在本实施例中,视频帧编码设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机等终端设备。优选地,设备为组成内容分发网络CDN网络或者区块链网络的节点。In this embodiment, the video frame encoding device may be a PC (Personal Computer, personal computer), and may also be a terminal device such as a smart phone, a tablet computer, a palmtop computer, or a portable computer. Preferably, the device is a node forming a content distribution network CDN network or a blockchain network.

本发明还提供了一种计算机可读存储介质,计算机可读存储介质上存储有视频帧编码程序,视频帧编码程序可被一个或者多个处理器执行,以实现如以上任一项的视频帧编码方法。The present invention also provides a computer-readable storage medium, on which a video frame coding program is stored, and the video frame coding program can be executed by one or more processors, so as to realize any of the above video frame encoding method.

本发明前述提供的视频帧编码装置中的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the modules in the video frame encoding device provided above in the present invention are realized in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

本发明还提供了一种计算机程序产品,其特征在于,包括计算机指令,当其在计算机上运行时,使得计算机可以执行上述以上任一项所述的视频帧编码方法。The present invention also provides a computer program product, which is characterized in that it includes computer instructions, and when it is run on a computer, the computer can execute the video frame coding method described in any one of the above.

所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present invention will be generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置,设备和计算机可读存储介质的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described device, device, and computer-readable storage medium can refer to the corresponding process in the foregoing method embodiment, which is not repeated here. repeat.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置,设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或模块的间接耦合或通信连接,可以是电性、机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices or modules, and may be in electrical, mechanical or other forms.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is no such actual relationship or order between the operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process conversion made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related technical fields , are all included in the scope of patent protection of the present invention in the same way.

Claims (8)

1. A video frame encoding method, applied to an h.264 encoder, comprising:
after receiving a pre-analysis instruction, sampling a frame to be coded in a video to be compressed to obtain a down-sampling frame, pre-analyzing the down-sampling frame to obtain a prediction mode of the down-sampling frame, and storing the prediction mode;
after receiving an actual coding instruction, calling a prediction mode corresponding to the frame to be coded from the stored prediction modes to predict the frame to be coded;
after the prediction operation of all frames to be encoded in the video to be compressed is completed, carrying out subsequent encoding operation according to a prediction result to obtain video compression data of the video to be compressed;
wherein the prediction modes include a plurality of modes of intra prediction and a plurality of modes of inter prediction.
2. The video frame coding method according to claim 1, wherein the obtained prediction mode of the downsampled frame is stored in a data structure of a frame to be coded corresponding to the downsampled frame.
3. The video frame coding method according to claim 1, wherein the obtained prediction mode of the downsampled frame and the identification of the frame to be coded corresponding to the downsampled frame are stored correspondingly in a prediction mode list.
4. The video frame coding method of claim 1, wherein the downsampled frames are partitioned using an 8x8 block partition.
5. A video frame encoding apparatus for use with an h.264 encoder, comprising:
the pre-analysis module is used for sampling a frame to be coded in the video to be compressed to obtain a down-sampling frame after receiving a pre-analysis instruction, pre-analyzing the down-sampling frame to obtain a prediction mode of the down-sampling frame and storing the prediction mode;
the prediction coding module is used for calling a prediction mode corresponding to the frame to be coded from the stored prediction modes to predict the frame to be coded after receiving the actual coding instruction;
the subsequent encoding module is used for performing subsequent encoding operation according to a prediction result after finishing the prediction operation of all frames to be encoded in the video to be compressed, so as to obtain video compression data of the video to be compressed;
wherein the prediction modes include a plurality of modes of intra prediction and a plurality of modes of inter prediction.
6. A video frame encoding device comprising a memory and a processor, the memory having stored thereon a video frame encoding program executable on the processor, the video frame encoding program when executed by the processor implementing the video frame encoding method of any of claims 1-4.
7. The video frame coding device of claim 6, wherein the device is a node that forms a content delivery network, CDN, network or a blockchain network.
8. A computer-readable storage medium having stored thereon a video frame encoding program executable by one or more processors to implement the video frame encoding method of any of claims 1-4.
CN201811528004.1A 2018-12-13 2018-12-13 A video frame coding method, device and equipment Active CN109495742B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811528004.1A CN109495742B (en) 2018-12-13 2018-12-13 A video frame coding method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811528004.1A CN109495742B (en) 2018-12-13 2018-12-13 A video frame coding method, device and equipment

Publications (2)

Publication Number Publication Date
CN109495742A CN109495742A (en) 2019-03-19
CN109495742B true CN109495742B (en) 2023-05-12

Family

ID=65710094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811528004.1A Active CN109495742B (en) 2018-12-13 2018-12-13 A video frame coding method, device and equipment

Country Status (1)

Country Link
CN (1) CN109495742B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109640081B (en) * 2019-02-14 2023-07-14 深圳市网心科技有限公司 An intra-frame prediction method, encoder, electronic equipment and readable storage medium
CN113301340B (en) * 2020-09-29 2024-11-22 淘宝(中国)软件有限公司 A method for determining coding parameters, a method for transmitting video and a device
CN116962686A (en) * 2022-04-15 2023-10-27 维沃移动通信有限公司 Inter-frame prediction method and terminal

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517080A (en) * 2012-06-21 2014-01-15 北京数码视讯科技股份有限公司 Real-time video stream encoder and real-time video stream encoding method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020196854A1 (en) * 2001-06-15 2002-12-26 Jongil Kim Fast video encoder using adaptive hierarchical video processing in a down-sampled domain
KR100689215B1 (en) * 2005-04-18 2007-03-09 동국대학교 산학협력단 Fast Prediction Mode Decision Method Using Downsampling and Edge Direction in H.264
US8934544B1 (en) * 2011-10-17 2015-01-13 Google Inc. Efficient motion estimation in hierarchical structure
CN104754338A (en) * 2014-12-30 2015-07-01 北京奇艺世纪科技有限公司 Selection method and device for intra-frame predication mode
US10187655B2 (en) * 2015-09-30 2019-01-22 Apple Inc. Memory-to-memory low resolution motion estimation systems and methods

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517080A (en) * 2012-06-21 2014-01-15 北京数码视讯科技股份有限公司 Real-time video stream encoder and real-time video stream encoding method

Also Published As

Publication number Publication date
CN109495742A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
JP6843239B2 (en) Method and device for specifying the depth of the coding unit
US9106521B2 (en) Method and system for visualizing an adaptive screen according to a terminal
CN109495742B (en) A video frame coding method, device and equipment
CN110446044B (en) Linear model prediction method, device, encoder and storage device
CN111681167A (en) Image quality adjusting method and device, storage medium and electronic equipment
WO2016180129A1 (en) Prediction mode selection method, apparatus and device
CN112104867B (en) Video processing method, video processing device, intelligent equipment and storage medium
CN113873252B (en) Image processing methods and devices, electronic equipment and storage media
CN111654696B (en) An intra-frame multi-reference line prediction method, device, storage medium and terminal
CN112203085B (en) Image processing method, device, terminal and storage medium
CN110213576A (en) Method for video coding, video coding apparatus, electronic equipment and storage medium
JP2022526547A (en) Image processing methods and electronic devices
CN111083450A (en) Vehicle-mounted-end image remote output method, device and system
CN109429064A (en) A kind of method and apparatus handling video data
CN109640087B (en) A method, device and equipment for intra-frame prediction mode decision
CN107018416B (en) Adaptive tile data size coding for video and image compression
WO2024240135A1 (en) Video coding method and apparatus, electronic device, and storage medium
CN105100799A (en) Method for reducing intraframe coding time delay in HEVC encoder
CN109587502B (en) A method, device, device, and computer-readable storage medium for intra-frame compression
CN113347425B (en) Information processing method and device, equipment and storage medium
CN111953972A (en) Hash table construction method, device and equipment in IBC mode
CN112738522A (en) Video coding method and device
CN110351560A (en) A kind of coding method, system and electronic equipment and storage medium
CN115442617A (en) A video processing method and device based on video coding
CN113066139B (en) Picture processing method and device, storage medium and electronic equipment

Legal Events

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