[go: up one dir, main page]

CN112291566B - H.264 video coding method, device and storage equipment - Google Patents

H.264 video coding method, device and storage equipment Download PDF

Info

Publication number
CN112291566B
CN112291566B CN202010568622.XA CN202010568622A CN112291566B CN 112291566 B CN112291566 B CN 112291566B CN 202010568622 A CN202010568622 A CN 202010568622A CN 112291566 B CN112291566 B CN 112291566B
Authority
CN
China
Prior art keywords
frame
current frame
encoding
current
identifier
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
CN202010568622.XA
Other languages
Chinese (zh)
Other versions
CN112291566A (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.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN202010568622.XA priority Critical patent/CN112291566B/en
Publication of CN112291566A publication Critical patent/CN112291566A/en
Application granted granted Critical
Publication of CN112291566B publication Critical patent/CN112291566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/177Methods 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 a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

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

Abstract

The invention discloses an H.264 video coding method, a device, a chip, a storage device and an electronic device, wherein the method comprises the following steps: for the P frame, if the position of the current frame is before the set frame position, setting the first mark of the current frame as a reference frame; if the position of the current frame is the set frame position, setting a first mark of the current frame as a non-reference frame; if the position of the current frame is at the set frame position, judging whether the frame interval between the current frame and the nearest non-reference frame is the set frame interval, if so, setting the first identification of the current frame as the non-reference frame, and if not, setting the first identification of the current frame as the reference frame; encoding the current frame to output a compressed code stream; if the code rate is greater than the first code rate threshold, the frame interval is increased to reduce the number of non-reference frames. The invention can give consideration to the anti-interference capability and the coding quality of the video frame sequence.

Description

H.264视频编码方法、装置及存储设备H.264 video encoding method, device and storage device

技术领域Technical Field

本发明涉及图像编码领域,尤其涉及H.264视频编码方法、装置、芯片、存储设备及电子设备。The present invention relates to the field of image coding, and in particular to an H.264 video coding method, device, chip, storage device and electronic device.

背景技术Background technique

随着无线网络的迅速发展,移动通信对人们生活的影响也越来越大,无线传输的高速发展使得人们在业务上对其有了更高的要求。在某些特殊场合中的一些特殊业务有高稳定性、低时延、不间断传输的要求,如移动视频会议、视频监控等。相比于传统的有线网络来说,无线网络存在不稳定性和移动性高等特点,无线网络传输过程中容易出现干扰,信号衰减,切换等多种破坏传输的情况。这些都会导致传输效率低下,出现网络拥塞,丢包以及包损坏等问题。这样接收端的视频解码就会出现问题。With the rapid development of wireless networks, mobile communications have an increasingly greater impact on people's lives. The rapid development of wireless transmission has led to higher requirements for services. Some special services in special occasions require high stability, low latency, and uninterrupted transmission, such as mobile video conferencing and video surveillance. Compared with traditional wired networks, wireless networks have the characteristics of instability and high mobility. During wireless network transmission, interference, signal attenuation, switching and other situations that damage transmission are prone to occur. These will lead to low transmission efficiency, network congestion, packet loss and packet damage. In this way, video decoding at the receiving end will have problems.

H.264视频压缩标准自2003年3月正式公布以来,被广泛应用于实时视频监控,低延时模式的视频会议、网络视频点播等电子消费领域。H.264之所以有着出色的压缩性能,得益于新引入的多种技术,如帧内预测,帧间预测,多参考帧,帧间可变尺寸块运动估计,去方块滤波和上下文自适应的熵编码技术。其中作为帧间预测的P帧对无线网络传输的可靠性影响较大,特别是在IDR(立即刷新帧)间隔较大时,一旦有一个P帧在无线传输中丢失,那么在一个GOP(图像画面组,具体指两个IDR帧的间隔)内丢失P帧之后的所有P帧的解码都会受到影响。Since the H.264 video compression standard was officially announced in March 2003, it has been widely used in consumer electronics such as real-time video surveillance, low-latency video conferencing, and online video on demand. The reason why H.264 has excellent compression performance is due to the introduction of a variety of newly introduced technologies, such as intra-frame prediction, inter-frame prediction, multiple reference frames, inter-frame variable-size block motion estimation, deblocking filtering, and context-adaptive entropy coding technology. Among them, the P frame used as inter-frame prediction has a greater impact on the reliability of wireless network transmission, especially when the IDR (immediate refresh frame) interval is large. Once a P frame is lost in wireless transmission, the decoding of all P frames after the lost P frame in a GOP (group of pictures, specifically the interval between two IDR frames) will be affected.

目前大多数H.264编码方案在帧间预测时仅使用一个前向参考帧。其中一种编码技术是每一帧P帧都以前面的一帧作为参考帧,具体而言,在对图像组GOP(H.264定义的图像画面组,具体指两个IDR帧的间隔)进行编码时,第一帧(I帧)后面的每一帧P帧都以前面的一帧作为参考帧,因此作为帧间预测的P帧参考帧对无线网络传输的可靠性影响较大,特别是在IDR(立即刷新帧)间隔较大时,一旦有一个P帧在传输中丢失(例如在无线网络传输带宽紧张时丢失),那么丢失的P帧之后的所有该GOP内的P帧的解码都不能正常解码,解码端画面出现卡顿或异常。At present, most H.264 coding schemes use only one forward reference frame for inter-frame prediction. One of the coding techniques is that each P frame uses the previous frame as a reference frame. Specifically, when encoding the group of pictures GOP (the group of pictures defined by H.264, specifically the interval between two IDR frames), each P frame after the first frame (I frame) uses the previous frame as a reference frame. Therefore, the P frame reference frame used as the inter-frame prediction has a greater impact on the reliability of wireless network transmission, especially when the IDR (immediate refresh frame) interval is large. Once a P frame is lost during transmission (for example, when the wireless network transmission bandwidth is tight), the decoding of all P frames in the GOP after the lost P frame cannot be decoded normally, and the decoding end screen will be stuck or abnormal.

H.264帧间预测时最多可以使用16个参考帧,多参考帧的使用可以降低网络传输丢帧时导致的解码问题。但是消费电子级视频芯片的开发使用多参考帧会带来编码复杂度增加,内存和带宽消耗增大,芯片成本增加等问题。H.264 can use up to 16 reference frames for inter-frame prediction. The use of multiple reference frames can reduce decoding problems caused by frame loss during network transmission. However, the use of multiple reference frames in the development of consumer electronics-grade video chips will increase encoding complexity, memory and bandwidth consumption, and chip costs.

另外一种技术如现有技术CN104754345A公开的,在一个图像组中引入多个非参考帧P帧,该技术客观上能够减轻前述编码技术中的问题,但是,研究发现该技术容易导致编码质量下降。另外,该现有技术中将编码后的帧数据直接送出外部缓存中,当需要以该编码后的帧数据作为参考帧使用时,需要再从片外的缓存中再通过参考帧读取模块进行读取,不仅降低了缓存利用率,而且读写效率较低。Another technology, such as the prior art CN104754345A, introduces multiple non-reference frames P frames into an image group. This technology can objectively alleviate the problems in the aforementioned coding technology. However, research has found that this technology is prone to reduce coding quality. In addition, in this prior art, the encoded frame data is directly sent to the external cache. When the encoded frame data needs to be used as a reference frame, it needs to be read from the off-chip cache through the reference frame reading module, which not only reduces the cache utilization, but also has low read and write efficiency.

发明内容Summary of the invention

研究现有技术CN104754345A发现,当连续非参考帧的数量过多,势必会降低帧间预测的精度,即导致待编码帧与参考帧之间的差异越大,需要更多的比特来表示这种差异,从而导致实时码率增大,当编码器需要控制输出码流的码率(码流速率)在一定码率以下时,进而导致量化参数qp大幅增加,从而引起编码质量急剧下降。Research on the prior art CN104754345A found that when the number of consecutive non-reference frames is too large, the accuracy of inter-frame prediction will inevitably be reduced, that is, the greater the difference between the frame to be encoded and the reference frame, the more bits are needed to represent this difference, which will lead to an increase in the real-time bit rate. When the encoder needs to control the bit rate (bit rate) of the output bit stream below a certain bit rate, the quantization parameter qp will increase significantly, causing the encoding quality to drop sharply.

基于上述现状,本发明的主要目的在于提供H.264视频编码方法、装置、芯片、存储设备及电子设备,通过实时检测编码输出码流的码率的大小,当码率大于码率阈值时减小非参考帧之间的帧间隔,以减少非参考帧的数量,从而在非参考帧存在且兼顾视频编码质量的前提下,提高了视频在无线网络传输环境下的抗干扰性,以及接收端解码的视觉成像质量。Based on the above situation, the main purpose of the present invention is to provide an H.264 video encoding method, apparatus, chip, storage device and electronic device, which detects the bit rate of the encoded output stream in real time, and reduces the frame interval between non-reference frames when the bit rate is greater than the bit rate threshold, so as to reduce the number of non-reference frames. Under the premise of the existence of non-reference frames and taking into account the quality of video encoding, the anti-interference ability of the video in a wireless network transmission environment and the visual imaging quality of decoding at the receiving end are improved.

为实现上述目的,本发明采用的技术方案如下:To achieve the above purpose, the technical solution adopted by the present invention is as follows:

参考图1,一种H.264视频编码方法,包括如下步骤:S110,判断当前帧的类型,若所述当前帧的类型是I帧则执行步骤S140-S150,若所述当前帧的类型是P帧则执行步骤S120-S150;S120,判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并执行步骤S140-S150;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并执行步骤S140-S150;若所述当前帧的位置在设定帧位置之后,执行步骤S130-S150;其中,所述第一标识用于表示所述当前帧是否为参考帧;S130,判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;S140,对所述当前帧根据其第一标识进行编码,并输出压缩码流;S150,实时检测所述压缩码流的码率,判断所述码率是否大于第一码率阈值,若否则重新执行步骤S110-S150,若是则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S110-S150直至完成编码。Referring to FIG. 1 , an H.264 video encoding method includes the following steps: S110, determining the type of the current frame, if the type of the current frame is an I frame, executing steps S140-S150, if the type of the current frame is a P frame, executing steps S120-S150; S120, determining the position of the current frame, if the position of the current frame is before a set frame position, setting the first identifier of the current frame as a reference frame, and executing steps S140-S150; if the position of the current frame is the set frame position, setting the first identifier of the current frame as a non-reference frame, and executing steps S140-S150; if the position of the current frame is after the set frame position, executing step S13 0-S150; wherein, the first identifier is used to indicate whether the current frame is a reference frame; S130, determining whether the frame spacing between the current frame and the nearest non-reference frame is a set frame spacing, if so, setting the first identifier of the current frame to a non-reference frame, if otherwise, setting the first identifier of the current frame to a reference frame; S140, encoding the current frame according to its first identifier, and outputting a compressed code stream; S150, detecting the bit rate of the compressed code stream in real time, determining whether the bit rate is greater than a first bit rate threshold, if otherwise, re-executing steps S110-S150, if so, increasing the frame spacing to reduce the number of non-reference frames, and re-executing steps S110-S150 until encoding is completed.

优选的,在步骤S150中,所述帧间隔每次减小数值1。Preferably, in step S150, the frame interval is reduced by a value of 1 each time.

优选的,参考图6,在步骤S110之前,所述视频编码方法还包括如下步骤:S100,在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;所述步骤S110还包括以下步骤:若所述当前帧的类型是I帧,将所述当前帧的第一标识设置为参考帧,并写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;所述步骤S130后还包括以下步骤:S131,将所述当前帧的所述第一标识写入所述当前帧的帧头部;S132,判断所述当前帧的前一帧是否为参考帧,若是,则执行步骤S133,若否执行步骤S134;S133,将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;S134,将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。Preferably, referring to FIG6, before step S110, the video encoding method further includes the following steps: S100, providing two blocks of encoding cache addresses for storing reference frame data generated by the encoding process in the buffer for encoding; the step S110 further includes the following steps: if the type of the current frame is an I frame, setting the first identifier of the current frame as a reference frame and writing it into the frame header of the current frame, initializing the write cache address of the current frame to any one of the two encoding cache addresses for storing the reference frame data obtained by encoding the current frame; the step S130 further includes the following steps: S131, writing the first identifier of the current frame into the frame header of the current frame; S132, judging whether the previous frame of the current frame is a reference frame, and if so, executing Perform step S133, if not, perform step S134; S133, assign the read cache address of the current frame to the write cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and assign the write cache address to the other of the two encoding cache addresses except the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame; S134, keep the read cache address of the current frame consistent with the read cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and keep the write cache address consistent with the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame.

优选的,在步骤S110和S130中,将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。Preferably, in steps S110 and S130, the first identifier of the current frame is written into a padding network abstraction layer unit in a frame header of the current frame.

参考图7,本发明还提供了一种H.264视频编码方法,包括如下步骤:S210,判断当前帧的类型,若所述当前帧的类型是I帧则执行步骤S240-S250,若所述当前帧的类型是P帧则执行步骤S220-S250;S220,判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并执行步骤S240-S250;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并执行步骤S240-S250;若所述当前帧的位置在设定帧位置之后,执行步骤S230-S250;其中,所述第一标识用于表示所述当前帧是否为参考帧;S230,判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;S240,对所述当前帧根据其第一标识进行编码,并输出压缩码流;S250,实时检测所述压缩码流的码率,判断所述码率的大小,若:第二码率阈值≤所述码率≤第三码率阈值,则不调整帧间隔大小,并重新执行步骤S210-S250,直至完成编码;若:所述码率>第三码率阈值,则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S210-S250,直至完成编码;若:所述码率<第二码率阈值,则减小所述帧间隔以增加非参考帧的数量,并重新执行步骤S210-S250,直至完成编码。Referring to FIG. 7 , the present invention further provides an H.264 video encoding method, comprising the following steps: S210, determining the type of the current frame, if the type of the current frame is an I frame, executing steps S240-S250, if the type of the current frame is a P frame, executing steps S220-S250; S220, determining the position of the current frame, if the position of the current frame is before the set frame position, setting the first identifier of the current frame as a reference frame, and executing steps S240-S250; if the position of the current frame is the set frame position, setting the first identifier of the current frame as a non-reference frame, and executing steps S240-S250; if the position of the current frame is after the set frame position, executing steps S230-S250; wherein the first identifier is used to indicate whether the current frame is a reference frame; S230, determining whether the current frame is the longest Whether the frame spacing of the nearest non-reference frame is the set frame spacing, if so, the first identifier of the current frame is set to a non-reference frame, if not, the first identifier of the current frame is set to a reference frame; S240, encode the current frame according to its first identifier, and output a compressed code stream; S250, detect the code rate of the compressed code stream in real time, and judge the size of the code rate, if: the second code rate threshold ≤ the code rate ≤ the third code rate threshold, then do not adjust the frame spacing size, and re-execute steps S210-S250 until the encoding is completed; if: the code rate > the third code rate threshold, then increase the frame spacing to reduce the number of non-reference frames, and re-execute steps S210-S250 until the encoding is completed; if: the code rate < the second code rate threshold, then reduce the frame spacing to increase the number of non-reference frames, and re-execute steps S210-S250 until the encoding is completed.

优选的,在步骤S250中,所述帧间隔每次减小数值1和/或所述帧间隔每次增加数值1。Preferably, in step S250, the frame interval is reduced by a value of 1 each time and/or the frame interval is increased by a value of 1 each time.

优选的,参考图8,在步骤S210之前,所述视频编码方法还包括如下步骤:S200,在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;所述步骤S210还包括以下步骤:若所述当前帧的类型是I帧,将所述当前帧的第一标识设置为参考帧并写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;所述步骤S230后还包括以下步骤:S231,将所述当前帧的所述第一标识写入所述当前帧的帧头部;S232,判断所述当前帧的前一帧是否为参考帧,若是,则执行步骤S233,若否执行步骤S234;S233,将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;S234,将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。Preferably, referring to FIG8, before step S210, the video encoding method further includes the following steps: S200, providing two blocks of encoding cache addresses for storing reference frame data generated by the encoding process in the buffer for encoding; the step S210 further includes the following steps: if the type of the current frame is an I frame, setting the first identifier of the current frame as a reference frame and writing it into the frame header of the current frame, initializing the write cache address of the current frame to any one of the two encoding cache addresses for storing the reference frame data obtained by encoding the current frame; the step S230 further includes the following steps: S231, writing the first identifier of the current frame into the frame header of the current frame; S232, judging whether the previous frame of the current frame is a reference frame, and if so, executing Perform step S233, if not, perform step S234; S233, assign the read cache address of the current frame to the write cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and assign the write cache address to the other of the two blocks of encoding cache addresses except the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame; S234, keep the read cache address of the current frame consistent with the read cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and keep the write cache address consistent with the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame.

优选的,在步骤S210和S230中,将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。Preferably, in steps S210 and S230, the first identifier of the current frame is written into a padding network abstraction layer unit in a frame header of the current frame.

本发明还提供了一种H.264视频编码装置,包括:第一一处理单元,用于判断当前帧的类型,若所述当前帧的类型是I帧则触发第一四处理单元和第一五处理单元工作,若所述当前帧的类型是P帧则触发第一二处理单元至第一五处理单元工作;第一二处理单元,用于判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并触发第一四处理单元和第一五处理单元工作;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并触发第一四处理单元和第一五处理单元工作;若所述当前帧的位置在设定帧位置之后,触发第一三处理单元至第一五处理单元工作;其中,所述第一标识用于表示所述当前帧是否为参考帧;第一三处理单元,用于判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;第一四处理单元,用于对所述当前帧根据其第一标识进行编码,并输出压缩码流;第一五处理单元,用于实时检测所述压缩码流的码率,判断所述码率是否大于第一码率阈值,若否则重新触发第一一处理单元至第一五处理单元工作,若是则增加所述帧间隔以减少非参考帧的数量,并重新触发第一一处理单元至第一五处理单元工作,直至完成编码。The present invention also provides an H.264 video encoding device, comprising: a first processing unit, used to determine the type of the current frame, if the type of the current frame is an I frame, the first four processing units and the first five processing units are triggered to work, if the type of the current frame is a P frame, the first two processing units to the first five processing units are triggered to work; the first two processing units, used to determine the position of the current frame, if the position of the current frame is before the set frame position, the first identifier of the current frame is set as a reference frame, and the first four processing units and the first five processing units are triggered to work; if the position of the current frame is the set frame position, the first identifier of the current frame is set as a non-reference frame, and the first four processing units and the first five processing units are triggered to work; if the position of the current frame is after the set frame position, the first three processing units are triggered. The first to fifth processing units operate; wherein the first identifier is used to indicate whether the current frame is a reference frame; the first to third processing units are used to determine whether the frame spacing between the current frame and the nearest non-reference frame is a set frame spacing, and if so, the first identifier of the current frame is set to a non-reference frame, and if otherwise, the first identifier of the current frame is set to a reference frame; the first to fourth processing units are used to encode the current frame according to its first identifier and output a compressed code stream; the first to fifth processing units are used to detect the bit rate of the compressed code stream in real time, determine whether the bit rate is greater than a first bit rate threshold, and if otherwise, re-trigger the first to fifth processing units to operate, and if so, increase the frame spacing to reduce the number of non-reference frames, and re-trigger the first to fifth processing units to operate until the encoding is completed.

优选的,所述第一五处理单元用于将所述帧间隔每次减小数值1。Preferably, the first five processing units are used to reduce the frame interval by a value of 1 each time.

优选的,所述的H.264视频编码装置还包括第一六处理单元和第一七处理单元,所述第一六处理单元用于在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;所述第一一处理单元还用于:若所述当前帧的类型是I帧,将所述当前帧的第一标识设置为参考帧并写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;所述第一七处理单元用于:将所述当前帧的所述第一标识写入所述当前帧的帧头部;判断所述当前帧的前一帧是否为参考帧,若是,则:将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;若否,则:将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。Preferably, the H.264 video encoding device further includes a first six processing unit and a first seven processing unit, wherein the first six processing unit is used to provide two blocks of encoding cache addresses for storing reference frame data generated by the encoding process in the buffer for encoding; the first one processing unit is also used to: if the type of the current frame is an I frame, set the first identifier of the current frame as a reference frame and write it into the frame header of the current frame, and initialize the write cache address of the current frame to any one of the two encoding cache addresses for storing the reference frame data obtained by encoding the current frame; the first seven processing unit is used to: write the first identifier of the current frame into the frame header of the current frame; and determine whether the previous frame of the current frame is a reference frame. frame, if so: assigning the read cache address of the current frame to the write cache address of the frame before the current frame, so as to read the reference frame data encoded by the frame before the current frame during encoding, and assigning the write cache address to the other of the two blocks of encoding cache addresses except the write cache address of the frame before the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame; if not, then: keeping the read cache address of the current frame consistent with the read cache address of the frame before the current frame, so as to read the reference frame data encoded by the reference frame before the current frame during encoding, and keeping the write cache address consistent with the write cache address of the frame before the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame.

优选的,所述第一一处理单元和第一三处理单元还用于将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。Preferably, the first-first processing unit and the first-third processing unit are further used to write the first identifier of the current frame into a padding network abstraction layer unit in a frame header of the current frame.

本发明还提供了一种H.264视频编码装置,包括:第二一处理单元,用于判断当前帧的类型,若所述当前帧的类型是I帧则触发第二四处理单元和第二五处理单元工作,若所述当前帧的类型是P帧则执行步骤触发第二二处理单元至第二五处理单元工作;第二二处理单元,用于判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并触发第二四处理单元和第二五处理单元工作;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并触发第二四处理单元和第二五处理单元工作;若所述当前帧的位置在设定帧位置之后,触发第二三处理单元至第二五处理单元工作;其中,所述第一标识用于表示所述当前帧是否为参考帧;第二三处理单元,用于判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;第二四处理单元,用于对所述当前帧根据其第一标识进行编码,并输出压缩码流;第二五处理单元,用于实时检测所述压缩码流的码率,判断所述码率的大小,若:第二码率阈值≤所述码率≤第三码率阈值,则不调整帧间隔大小,并重新触发第二一处理单元至第二五处理单元工作;若:所述码率>第三码率阈值,则增加所述帧间隔以减少非参考帧的数量,并重新触发第二一处理单元至第二五处理单元工作,直至完成编码;若:所述码率<第二码率阈值,则减小所述帧间隔以增加非参考帧的数量,并重新触发第二一处理单元至第二五处理单元工作,直至完成编码。The present invention also provides an H.264 video encoding device, comprising: a second-first processing unit, used to determine the type of the current frame, if the type of the current frame is an I frame, the second-fourth processing unit and the second-fifth processing unit are triggered to work, if the type of the current frame is a P frame, the steps of triggering the second-second processing unit to the second-fifth processing unit to work; the second-second processing unit, used to determine the position of the current frame, if the position of the current frame is before the set frame position, the first identifier of the current frame is set as a reference frame, and the second-fourth processing unit and the second-fifth processing unit are triggered to work; if the position of the current frame is the set frame position, the first identifier of the current frame is set as a non-reference frame, and the second-fourth processing unit and the second-fifth processing unit are triggered to work; if the position of the current frame is after the set frame position, the second-third processing unit to the second-fifth processing unit are triggered to work; wherein, the first identifier is used to indicate whether the current frame is a reference frame; the second-third processing unit is used to determine whether the frame spacing between the current frame and the nearest non-reference frame is the set frame spacing, if so, set the first identifier of the current frame to the non-reference frame, if not, set the first identifier of the current frame to the reference frame; the second four processing units are used to encode the current frame according to its first identifier and output a compressed code stream; the second five processing units are used to detect the code rate of the compressed code stream in real time and determine the size of the code rate. If: the second code rate threshold ≤ the code rate ≤ the third code rate threshold, the frame spacing size is not adjusted, and the second one to the second five processing units are re-triggered to work; if: the code rate is greater than the third code rate threshold, the frame spacing is increased to reduce the number of non-reference frames, and the second one to the second five processing units are re-triggered to work until the encoding is completed; if: the code rate is less than the second code rate threshold, the frame spacing is reduced to increase the number of non-reference frames, and the second one to the second five processing units are re-triggered to work until the encoding is completed.

优选的,所述第二五处理单元用于将所述帧间隔每次减小数值1和/或所述帧间隔每次增加数值1。Preferably, the second fifth processing unit is used to reduce the frame interval by a value of 1 each time and/or increase the frame interval by a value of 1 each time.

优选的,所述的H.264视频编码装置还包括:第二八处理单元和第二九处理单元,用于在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;所述第二一处理单元,还用于若所述当前帧的类型是I帧,将所述当前帧的第一标识设置为参考帧并写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;所述第二九处理单元用于将所述当前帧的所述第一标识写入所述当前帧的帧头部;将所述当前帧的所述第一标识写入所述当前帧的帧头部;判断所述当前帧的前一帧是否为参考帧,若是,则:将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;若否,则:将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。Preferably, the H.264 video encoding device also includes: a second eighth processing unit and a second ninth processing unit, which are used to provide two blocks of encoding cache addresses for storing reference frame data generated by the encoding process in the buffer for encoding; the second first processing unit is also used to set the first identifier of the current frame as a reference frame and write it into the frame header of the current frame if the type of the current frame is an I frame, and initialize the write cache address of the current frame to any one of the two encoding cache addresses for storing the reference frame data obtained by encoding the current frame; the second ninth processing unit is used to write the first identifier of the current frame into the frame header of the current frame; write the first identifier of the current frame into the frame header of the current frame; and judge whether the current frame Whether the previous frame is a reference frame, if so: assigning the read cache address of the current frame to the write cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and assigning the write cache address to the other of the two encoding cache addresses except the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame; if not, then: keeping the read cache address of the current frame consistent with the read cache address of the previous frame of the current frame, so as to read the reference frame data encoded by the previous frame of the current frame during encoding, and keeping the write cache address consistent with the write cache address of the previous frame of the current frame, so as to store the reference frame data encoded by the current frame when the current frame is a reference frame.

优选的,所述第二一处理单元和第二三处理单元还用于将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。Preferably, the second-first processing unit and the second-third processing unit are further used to write the first identifier of the current frame into a padding network abstraction layer unit in a frame header of the current frame.

本发明还提供了一种编码芯片,其特征在于,用于执行任一所述的编码方法。The present invention also provides a coding chip, characterized in that it is used to execute any of the above-mentioned coding methods.

本发明还提供了一种存储程序的存储介质,所述程序被处理器执行成任一所述的编码方法。The present invention also provides a storage medium storing a program, wherein the program is executed by a processor to perform any of the above-mentioned encoding methods.

本发明还提供了一种无线通信设备,包括所述的编码芯片。The present invention also provides a wireless communication device, comprising the encoding chip.

本发明还提供了一种电子设备,包括所述的编码芯片。The present invention also provides an electronic device, comprising the encoding chip.

【有益效果】【Beneficial Effects】

本发明通过实时检测编码输出码流的码率的大小,当码率大于码率阈值时减小非参考帧之间的帧间隔,以减少非参考帧的数量,进而保证维持一定的编码质量,同时具备在视频帧序列中生成非参考帧的能力,因而兼顾视频序列在无线传输中的抗干扰能力和编码质量。The present invention detects the bit rate of the encoded output code stream in real time, and reduces the frame interval between non-reference frames when the bit rate is greater than the bit rate threshold to reduce the number of non-reference frames, thereby ensuring a certain encoding quality. At the same time, it has the ability to generate non-reference frames in a video frame sequence, thereby taking into account the anti-interference ability and encoding quality of the video sequence in wireless transmission.

另外,在更优的方案中,通过本发明的方案,在对图像组GOP进行编码的过程中,通过一定的算法控制每一个编码帧是否生成参考帧,进而区分出参考帧和非参考帧。由于非参考帧不产生重建帧,在不过多增加内存的情况下,通过一定的方法合理配置参考帧读写的两帧缓存,使得每一个编码的P帧的前向参考帧不一定是紧邻自身的前一帧,从而达到了多参考帧编码的效果,同时提高了缓存地址的利用率以及读写效率。In addition, in a more optimal solution, through the solution of the present invention, in the process of encoding the group of pictures GOP, a certain algorithm is used to control whether each encoded frame generates a reference frame, thereby distinguishing between reference frames and non-reference frames. Since non-reference frames do not generate reconstructed frames, without increasing the memory too much, a certain method is used to reasonably configure the two-frame cache for reading and writing reference frames, so that the forward reference frame of each encoded P frame is not necessarily the previous frame immediately adjacent to itself, thereby achieving the effect of multi-reference frame encoding, while improving the utilization rate of the cache address and the read-write efficiency.

本发明的其他有益效果,将在具体实施方式中通过具体技术特征和技术方案的介绍来阐述,本领域技术人员通过这些技术特征和技术方案的介绍,应能理解所述技术特征和技术方案带来的有益技术效果。Other beneficial effects of the present invention will be explained in the specific implementation manner through the introduction of specific technical features and technical solutions. Through the introduction of these technical features and technical solutions, those skilled in the art should be able to understand the beneficial technical effects brought about by the technical features and technical solutions.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

以下将参照附图对根据本发明的优选实施方式进行描述。图中:The preferred embodiments according to the present invention will be described below with reference to the accompanying drawings.

图1为根据本发明的一种优选实施方式的H.264视频编码方法流程图FIG. 1 is a flow chart of an H.264 video encoding method according to a preferred embodiment of the present invention.

图2是本发明一种实施例的待编码的视频帧序列的示意图FIG. 2 is a schematic diagram of a video frame sequence to be encoded according to an embodiment of the present invention.

图3是本发明一种实施例的编码后的视频帧序列的示意图FIG. 3 is a schematic diagram of a coded video frame sequence according to an embodiment of the present invention.

图4是本发明一种实施例的缓存器的示意图FIG. 4 is a schematic diagram of a buffer according to an embodiment of the present invention.

图5是本发明另一种实施例的编码后的视频帧序列的示意图FIG. 5 is a schematic diagram of a coded video frame sequence according to another embodiment of the present invention.

图6为根据本发明的一种优选实施方式的H.264视频编码方法部分流程图FIG. 6 is a partial flow chart of an H.264 video encoding method according to a preferred embodiment of the present invention.

图7为根据本发明的另一种优选实施方式的H.264视频编码方法流程图FIG. 7 is a flow chart of an H.264 video encoding method according to another preferred embodiment of the present invention.

图8为根据本发明的一种优选实施方式的H.264视频编码方法部分流程图FIG. 8 is a partial flow chart of an H.264 video encoding method according to a preferred embodiment of the present invention.

具体实施方式Detailed ways

图1是本发明一种实施例的H.264视频编码方法,该编码方法由编码端实施,如电子设备,例如移动电子设备、摄像装置等,该编码方法包括如下步骤。FIG. 1 is an H.264 video encoding method according to an embodiment of the present invention. The encoding method is implemented by an encoding end, such as an electronic device, for example, a mobile electronic device, a camera device, etc. The encoding method includes the following steps.

S100,在编码端缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址。S100, providing two encoding buffer addresses for storing reference frame data generated in the encoding process in the encoding end buffer for encoding.

在对图像组GOP进行编码前,需要在缓存器中申请两块编码缓存地址(例如buffer1和buffer2,如图4所示),以缓存在编码过程中产生的参考帧数据。需要指出的是,本发明所称的编码过程中产生的参考帧数据是指经过变换,量化,反量化,反变换以及滤波等操作之后所重建出的数据,而非参考帧在编码过程中经过变换、量化等操作之后,不再进行反量化,反变换以及滤波等重建操作,直接进行熵编码形成压缩码流,因而也就不会形成重建的参考帧数据。现有技术中,由于采用欠佳的参考帧策略和未经优化的缓存利用策略,往往需要在缓存器中申请多块编码缓存地址,从而占用较大的硬件资源,以及较低的读写效率。而在本发明中,只需要两块编码缓存地址交替缓存经过编码产生的参考帧数据,并配合下文将详细描述的读写策略将提高参考帧数据的读写效率。Before encoding the group of pictures GOP, it is necessary to apply for two encoding cache addresses (such as buffer1 and buffer2, as shown in FIG4 ) in the cache to cache the reference frame data generated during the encoding process. It should be pointed out that the reference frame data generated during the encoding process referred to in the present invention refers to the data reconstructed after operations such as transformation, quantization, inverse quantization, inverse transformation and filtering, while the non-reference frame is no longer subjected to inverse quantization, inverse transformation and filtering reconstruction operations after transformation, quantization and other operations during the encoding process, and is directly entropy encoded to form a compressed code stream, so that no reconstructed reference frame data is formed. In the prior art, due to the use of poor reference frame strategies and unoptimized cache utilization strategies, it is often necessary to apply for multiple encoding cache addresses in the cache, thereby occupying large hardware resources and having low read and write efficiency. In the present invention, only two encoding cache addresses are needed to alternately cache the reference frame data generated by encoding, and the read and write efficiency of the reference frame data will be improved in conjunction with the read and write strategies described in detail below.

S110,编码前的初始化设置。S110, initialization settings before encoding.

根据H.264标准,每一帧编码后的帧数据包括两大部分:帧头部和帧主体,对于I帧而言,帧头部依次包括四个部分:序列参数集SPS、图像参数集PPS、填充网络抽象层单元(NALU,其标识nal_unit_type=12)和片头(slice header),其中,填充NALU是预留的,可以根据实际编码需要是否采用该填充NALU;对于P帧而言,帧头部依次包括两个部分:填充网络抽象层单元NALU和片头slice header,其中,填充NALU是预留的,可以根据实际编码需要是否采用该填充NALU,片头中包含了该帧的类型信息,例如是I帧还是P帧。但在本发明中,I帧和P帧中都需要使用填充NALU,以承载下文将涉及的第一标识,所述第一标识用于表示所述当前帧是否为参考帧。According to the H.264 standard, the frame data after encoding each frame includes two parts: a frame header and a frame body. For an I frame, the frame header includes four parts in sequence: a sequence parameter set SPS, a picture parameter set PPS, a padding network abstraction layer unit (NALU, whose identifier nal_unit_type = 12) and a slice header, wherein the padding NALU is reserved and can be used according to actual coding needs; for a P frame, the frame header includes two parts in sequence: a padding network abstraction layer unit NALU and a slice header, wherein the padding NALU is reserved and can be used according to actual coding needs. The type information of the frame is included in the slice header, such as whether it is an I frame or a P frame. However, in the present invention, a padding NALU is required in both I and P frames to carry the first identifier to be involved below, and the first identifier is used to indicate whether the current frame is a reference frame.

为了应对某些帧无用或者缺失的情况,可以允许编码过程中某些帧缺失,因此可以对帧头部中的序列参数集SPS进行设置,以使帧序号(即句法元素frame_num,表示该帧的编码顺序)可以不连续,对应的语法元素配置如下:gaps_in_frame_num_value_allowed_flag=1。In order to deal with the situation where some frames are useless or missing, it is possible to allow some frames to be missing during the encoding process. Therefore, the sequence parameter set SPS in the frame header can be set so that the frame number (that is, the syntactic element frame_num, indicating the encoding order of the frame) can be discontinuous. The corresponding syntax element configuration is as follows: gaps_in_frame_num_value_allowed_flag=1.

定义帧间隔(具体而言是相邻非参考帧之间间隔的帧数量),是指从每个图像组GOP中相邻两个非参考帧之间间隔的帧数量,通过调整该帧间隔的大小,可以调整每个图像组中作为非参考帧的P帧的数量,进而可以调整实时码率及编码质量。The definition of frame interval (specifically, the number of frames between adjacent non-reference frames) refers to the number of frames between two adjacent non-reference frames in each image group GOP. By adjusting the size of the frame interval, the number of P frames that serve as non-reference frames in each image group can be adjusted, thereby adjusting the real-time bit rate and encoding quality.

S120,判断图像组当前帧的类型,若当前帧的类型是I帧则执行步骤S130,若当前帧的类型是P帧则执行步骤S140-S190。在本发明中,每个图像组依次包括I帧(即第一帧)和I帧之后的多个P帧。在此步骤之前,已经通过H.264标准规定的算法对图像组中每个帧的类型作出了决策,例如某帧是属于I帧还是P帧,由于这可以采用现有的帧类型决策算法,在此不再赘述。S120, determine the type of the current frame of the image group. If the type of the current frame is an I frame, execute step S130. If the type of the current frame is a P frame, execute steps S140-S190. In the present invention, each image group includes an I frame (i.e., the first frame) and multiple P frames after the I frame. Prior to this step, the type of each frame in the image group has been determined by the algorithm specified in the H.264 standard, for example, whether a frame is an I frame or a P frame. Since this can adopt the existing frame type decision algorithm, it will not be repeated here.

S130,将当前帧(此时为I帧)的第一标识设置为参考帧并写入当前帧的帧头部,将当前帧的写缓存地址初始化为两块编码缓存地址中的任一编码缓存地址,对当前帧进行编码得到参考帧数据并将所述参考帧数据写入该任一编码缓存地址。S130, set the first identifier of the current frame (I frame in this case) as the reference frame and write it into the frame header of the current frame, initialize the write cache address of the current frame to any one of the two encoding cache addresses, encode the current frame to obtain reference frame data and write the reference frame data into any one of the encoding cache addresses.

根据H.264标准I帧是参考帧,除了在帧头部的片头设置帧类型以表明是I帧之外,本发明还额外需要将I帧的第一标识no_ref_flag设置为参考帧,并将I帧的第一标识no_ref_flag写入I帧的帧头部的填充NALU中,以便解码端接收该帧头部而获得第一标识no_ref_flag并进行解码;在本实施例中,第一标识no_ref_flag用于表示当前帧是否为非参考帧,取值为1表示当前帧为非参考帧,取值为0表示当前帧为参考帧。According to the H.264 standard, an I frame is a reference frame. In addition to setting the frame type in the slice header of the frame header to indicate that it is an I frame, the present invention also needs to set the first identifier no_ref_flag of the I frame as a reference frame, and write the first identifier no_ref_flag of the I frame into the padding NALU of the frame header of the I frame, so that the decoding end receives the frame header and obtains the first identifier no_ref_flag and decodes it; in this embodiment, the first identifier no_ref_flag is used to indicate whether the current frame is a non-reference frame, a value of 1 indicates that the current frame is a non-reference frame, and a value of 0 indicates that the current frame is a reference frame.

将I帧的写缓存地址初始化为两块编码缓存地址中的任一编码缓存地址,例如将I帧的写缓存地址初始化为buffer1。The write buffer address of the I frame is initialized to any one of the two blocks of the code buffer address, for example, the write buffer address of the I frame is initialized to buffer1.

然后硬件编码电路开始对I帧的编码(I帧可以划分为一个或多个条状(slice)进行分别编码),由于图像组中的I帧并不需要参考其他帧进行编码,而是采用帧内编码,因此,在编码I帧过程中,硬件编码电路需要从上述两块编码缓存地址之外的专门缓存待编码帧数据的缓存器的地址中读取待编码I帧数据,然后进行编码,每次编码完成后,将得到I帧参考帧数据写入写缓存地址buffer1,该参考帧数据可能分多次写入该buffer1,但是本发明并不做限定。I帧编码完后,即得到图3所示0号I帧。Then the hardware encoding circuit starts encoding the I frame (the I frame can be divided into one or more slices for separate encoding). Since the I frame in the image group does not need to refer to other frames for encoding, but adopts intra-frame encoding, therefore, in the process of encoding the I frame, the hardware encoding circuit needs to read the I frame data to be encoded from the address of the buffer dedicated to caching the frame data to be encoded outside the above two encoding buffer addresses, and then encode it. After each encoding is completed, the I frame reference frame data is written into the write buffer address buffer1. The reference frame data may be written into buffer1 multiple times, but the present invention does not limit it. After the I frame is encoded, the I frame No. 0 shown in Figure 3 is obtained.

S140,判断当前帧(此时为P帧)的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并执行步骤S160-S190;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并执行步骤S160-S190;若所述当前帧的位置在设定帧位置之后,执行步骤S150-S190。S140, determine the position of the current frame (P frame in this case). If the position of the current frame is before the set frame position, set the first identifier of the current frame as a reference frame and execute steps S160-S190; if the position of the current frame is the set frame position, set the first identifier of the current frame as a non-reference frame and execute steps S160-S190; if the position of the current frame is after the set frame position, execute steps S150-S190.

上述设定帧位置可以是以I帧作为参考位置确定的帧位置,例如是I帧后第1或2帧等,也可以是帧间隔更新时(详细更新步骤见下文步骤S190)所在的帧作为参考位置确定的帧位置,例如是Px帧(帧间隔更新时编码所在帧)后第1或2帧。如图2所示,上述设定帧位置为I帧后第2帧num_a(2号P帧),帧间隔的初始值为3,若当前帧为1号P帧,即在设定参考帧位置num_a之前,则将1号P帧的第一标识设置为参考帧,并执行步骤S160-S190。The above-mentioned set frame position can be a frame position determined by taking the I frame as a reference position, such as the 1st or 2nd frame after the I frame, etc., or a frame position determined by taking the frame where the frame interval is updated (see step S190 below for detailed updating steps) as a reference position, such as the 1st or 2nd frame after the Px frame (the frame where the encoding is when the frame interval is updated). As shown in FIG2 , the above-mentioned set frame position is the 2nd frame num_a (P frame No. 2) after the I frame, and the initial value of the frame interval is 3. If the current frame is P frame No. 1, that is, before the reference frame position num_a is set, the first identifier of P frame No. 1 is set as the reference frame, and steps S160-S190 are executed.

若当前帧为2号P帧,即当前帧是设定帧位置num_a,因此将所述当前帧的第一标识设置为非参考帧(此时完成了对图2所示视频帧序列的首个非参考帧的设置,在下文中将详细描述根据帧间隔以及首个非参考帧对下一个非参考帧的设置),并执行步骤S160-S190,例如,如图5所示的视频帧序列,0号帧为I帧,1-13号都是P帧,在编码开始时,帧间隔为1,且设定帧位置为I帧后第1帧,因此1号P帧生成非参考帧,与1号P帧间隔1帧的3号P帧也生成非参考帧。If the current frame is P frame No. 2, that is, the current frame is the set frame position num_a, and therefore the first identifier of the current frame is set to a non-reference frame (at this point, the setting of the first non-reference frame of the video frame sequence shown in FIG. 2 is completed, and the setting of the next non-reference frame according to the frame interval and the first non-reference frame will be described in detail hereinafter), and steps S160-S190 are executed. For example, in the video frame sequence shown in FIG. 5 , frame No. 0 is an I frame, and frames 1-13 are all P frames. At the beginning of encoding, the frame interval is 1, and the frame position is set to the first frame after the I frame. Therefore, P frame No. 1 generates a non-reference frame, and P frame No. 3, which is 1 frame apart from P frame No. 1, also generates a non-reference frame.

以下对上述设定帧位置是在帧间隔更新时(详细更新步骤见下文步骤S190)当前帧所在的帧作为参考位置确定的帧位置进行举例说明。例如,若在对4号P帧(即当前帧)进行编码过程中,检测到码率大于第一码率阈值时,将帧间隔增加为2,并在该4号P帧下一帧(此帧位置即设定帧位置)即5号P帧生成非参考帧,然后在距5号P帧2帧的位置(即8号P帧)再次生成非参考帧。The following is an example of the above-mentioned setting of the frame position, which is a frame position determined as a reference position by the frame where the current frame is located when the frame interval is updated (the detailed updating steps are shown in step S190 below). For example, if during the encoding process of the No. 4 P frame (i.e., the current frame), it is detected that the bit rate is greater than the first bit rate threshold, the frame interval is increased to 2, and a non-reference frame is generated at the next frame of the No. 4 P frame (this frame position is the set frame position), i.e., the No. 5 P frame, and then a non-reference frame is generated again at a position 2 frames away from the No. 5 P frame (i.e., the No. 8 P frame).

若当前帧为3号P帧,即在设定帧位置之后,执行步骤S150-S190。If the current frame is P frame No. 3, that is, after the frame position is set, steps S150 - S190 are executed.

S150,判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧,然后执行步骤S160-S190。S150, determine whether the frame spacing between the current frame and the nearest non-reference frame is the set frame spacing, if so, set the first identifier of the current frame to the non-reference frame, if not, set the first identifier of the current frame to the reference frame, and then execute steps S160-S190.

如图3所示,若当前帧为3号P帧,其距前面最近的非参考帧(即2号P帧)的间隔不等于3,因此将3号P帧的第一标识设置为参考帧;若当前帧为6号P帧即位置num_b,其距前面最近的非参考帧(即2号P帧)的间隔等于3,因此将6号P帧的第一标识设置为非参考帧。As shown in Figure 3, if the current frame is P frame No. 3, the interval between it and the nearest non-reference frame (i.e., P frame No. 2) is not equal to 3, so the first identifier of P frame No. 3 is set as the reference frame; if the current frame is P frame No. 6, that is, position num_b, the interval between it and the nearest non-reference frame (i.e., P frame No. 2) is equal to 3, so the first identifier of P frame No. 6 is set as the non-reference frame.

S160,将当前帧(此时为P帧)的第一标识no_ref_flag写入当前帧的帧头部,具体而言,将第一标识no_ref_flag写入当前帧的帧头部的填充NALU中。S160, write the first identifier no_ref_flag of the current frame (this is the P frame) into the frame header of the current frame. Specifically, write the first identifier no_ref_flag into the padding NALU of the frame header of the current frame.

S170,判断当前帧(此时为P帧)的前一帧是否为参考帧,若是参考帧则将当前帧的读缓存地址赋值为当前帧前一帧的写缓存地址以在编码时读取所述当前帧前一帧在编码过程中得到的参考帧数据,并将当前帧的写缓存地址赋值为两块编码缓存地址中除当前帧前一帧的写缓存地址外的另一者以存储当前帧编码过程中得到的参考帧数据,若是非参考帧,则将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码过程得到的参考帧数据。S170, determine whether the previous frame of the current frame (P frame in this case) is a reference frame. If it is a reference frame, assign the read cache address of the current frame to the write cache address of the previous frame of the current frame so that the reference frame data obtained during the encoding process of the previous frame of the current frame can be read during encoding, and assign the write cache address of the current frame to the other of the two encoding cache addresses except the write cache address of the previous frame of the current frame so as to store the reference frame data obtained during the encoding process of the current frame. If it is a non-reference frame, keep the read cache address of the current frame consistent with the read cache address of the previous frame of the current frame so that the reference frame data obtained by encoding the reference frame of the previous frame of the current frame can be read during encoding, and keep the write cache address consistent with the write cache address of the previous frame so as to store the reference frame data obtained during the encoding process of the current frame when the current frame is a reference frame.

本发明通过设置变量间隔ref_id并判断该变量间隔ref_id的大小,以判断当前帧的前一帧是否为参考帧。具体而言,将间隔ref_id赋值为Num1-Num_r-1,其中,Numl为当前帧的语法元素frame_num的值,Num_r为在当前帧前面距离当前帧最近的参考帧的frame_num值。如图3所示,对于2号P帧而言,在该2号帧前面并离2号P帧最近的参考帧是1号P帧,对于1号P帧而言,在该1号P帧前面离并离1号P帧最近的参考帧是0号I帧,因此,当前帧为1号P帧时,该间隔ref_id赋值为Num1-Num_r-1=1-0-1=0;当前帧为2号P帧时,该间隔ref_id赋值为Num1-Num_r-1=2-1-1=0;当前帧为3号P帧时,该间隔ref_id赋值为Num1-Num_r-1=3-1-1>0。The present invention determines whether the previous frame of the current frame is a reference frame by setting a variable interval ref_id and determining the size of the variable interval ref_id. Specifically, the interval ref_id is assigned a value of Num1-Num_r-1, where Num1 is the value of the syntax element frame_num of the current frame, and Num_r is the frame_num value of the reference frame closest to the current frame in front of the current frame. As shown in Figure 3, for P frame No. 2, the reference frame that is in front of frame No. 2 and closest to frame No. 2 is P frame No. 1. For P frame No. 1, the reference frame that is in front of frame No. 1 and closest to frame No. 1 is I frame No. 0. Therefore, when the current frame is P frame No. 1, the interval ref_id is assigned a value of Num1-Num_r-1=1-0-1=0; when the current frame is P frame No. 2, the interval ref_id is assigned a value of Num1-Num_r-1=2-1-1=0; when the current frame is P frame No. 3, the interval ref_id is assigned a value of Num1-Num_r-1=3-1-1>0.

判断间隔ref_id的大小,若间隔ref_id为0,则表示当前帧的前一帧为参考帧,因此将当前帧的读缓存地址赋值为前一帧的写缓存地址、写缓存地址赋值为两块编码缓存地址中除前一帧的写缓存地址之外的另一者,若间隔大于0,则表示当前帧的前一帧不是参考帧即非参考帧,因此不更改当前帧的读缓存地址和写缓存地址,将当前帧的读缓存地址和写缓存地址分别保持与当前帧前一帧的读缓存地址和写缓存地址一致。例如,对于1号P帧,其间隔ref_id=1-0-1=0,因此,将1号P帧的读缓存地址赋值为前一帧0号I帧的写缓存地址buffer1,并将1号P帧的写缓存地址赋值另一缓存地址buffer2。Determine the size of the interval ref_id. If the interval ref_id is 0, it means that the previous frame of the current frame is a reference frame. Therefore, the read cache address of the current frame is assigned to the write cache address of the previous frame, and the write cache address is assigned to the other of the two encoding cache addresses except the write cache address of the previous frame. If the interval is greater than 0, it means that the previous frame of the current frame is not a reference frame, that is, a non-reference frame. Therefore, the read cache address and write cache address of the current frame are not changed, and the read cache address and write cache address of the current frame are respectively kept consistent with the read cache address and write cache address of the previous frame of the current frame. For example, for P frame No. 1, its interval ref_id = 1-0-1 = 0, therefore, the read cache address of P frame No. 1 is assigned to the write cache address buffer1 of the previous frame No. 0 I frame, and the write cache address of P frame No. 1 is assigned to another cache address buffer2.

在一些实施例中,将间隔ref_id通过寄存器配置给硬件编码电路,以便硬件熵编码时对参考帧的相关信息进行编码。In some embodiments, the interval ref_id is configured to the hardware encoding circuit through a register so that the relevant information of the reference frame is encoded during hardware entropy encoding.

S180,对当前帧进行编码,并输出压缩码流。S180, encode the current frame and output a compressed code stream.

硬件编码电路从当前帧的读缓存地址中读取帧数据作为参考帧,并对当前帧进行编码,若当前帧是非参考帧,根据H.264编码标准,当前帧编码在经过变换、量化等操作之后,硬件编码电路不再进行反量化、反变换及滤波等重建操作,因此即使在前面步骤S170中对属于非参考帧的当前帧的写缓存地址进行了赋值,硬件电路也无法获得重建的参考帧数据以写入该写缓存地址;而若当前帧是参考帧,根据H.264的编码标准,当前帧编码在经过变换,量化及熵编码等操作形成压缩码流同时,硬件编码电路还需通过反量化,反变换及滤波等重建操作生成参考帧数据,然后硬件编码电路将当前帧编码得到的参考帧数据写入当前帧的写缓存地址。最后输出上述形成的压缩码流。The hardware encoding circuit reads frame data from the read cache address of the current frame as a reference frame, and encodes the current frame. If the current frame is a non-reference frame, according to the H.264 encoding standard, after the current frame encoding is transformed, quantized, and other operations, the hardware encoding circuit no longer performs reconstruction operations such as inverse quantization, inverse transformation, and filtering. Therefore, even if the write cache address of the current frame belonging to the non-reference frame is assigned in the previous step S170, the hardware circuit cannot obtain the reconstructed reference frame data to write to the write cache address; and if the current frame is a reference frame, according to the H.264 encoding standard, after the current frame encoding is transformed, quantized, and entropy encoded to form a compressed code stream, the hardware encoding circuit also needs to generate reference frame data through reconstruction operations such as inverse quantization, inverse transformation, and filtering, and then the hardware encoding circuit writes the reference frame data obtained by the current frame encoding into the write cache address of the current frame. Finally, the compressed code stream formed as above is output.

S190,实时检测所述压缩码流的码率,判断所述码率是否大于第一码率阈值,若否则重新执行步骤S120-S190,直至完成编码;若是则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S120-S190,直至完成编码。编码后的帧可以通过无线通信发送给作为解码端的另一移动设备。S190, real-time detection of the bit rate of the compressed code stream, determining whether the bit rate is greater than a first bit rate threshold, if not, re-execute steps S120-S190 until the encoding is completed; if yes, increase the frame interval to reduce the number of non-reference frames, and re-execute steps S120-S190 until the encoding is completed. The encoded frame can be sent to another mobile device as a decoding end via wireless communication.

设置第一码率阈值THR1。当图像组中非参考帧过多时,会导致实时码率增大,若当前码率大于第一码率阈值THR1,则需要通过减小帧间隔以减少非参考帧的数量,进而降低码率,并保证一定的编码质量。例如,每次减小帧间隔的数值为1,直至码流小于第一码率阈值THR1。例如,可以设置目标码率target_bit,以及容许的偏差百分比X(这个偏差的百分比可以根据实时编码情况来设置),即THR1=target_bit+X*target_bit。Set the first bitrate threshold THR1. When there are too many non-reference frames in the image group, the real-time bitrate will increase. If the current bitrate is greater than the first bitrate threshold THR1, it is necessary to reduce the frame interval to reduce the number of non-reference frames, thereby reducing the bitrate and ensuring a certain encoding quality. For example, the value of the frame interval is reduced by 1 each time until the bitstream is less than the first bitrate threshold THR1. For example, the target bitrate target_bit and the allowable deviation percentage X (this deviation percentage can be set according to the real-time encoding situation) can be set, that is, THR1 = target_bit + X*target_bit.

通过本发明的方案,同时兼顾了编码质量和保证一定数量的非参考帧(即保证了视频序列在无线传输中的抗干扰能力)。Through the solution of the present invention, both the coding quality and the guarantee of a certain number of non-reference frames are taken into account (ie, the anti-interference capability of the video sequence in wireless transmission is guaranteed).

实施例2Example 2

本实施例提供了另一种实施例的H.264视频编码方法,其与实施例1大体上相同,主要区别在于设置了由多个码率阈值确定的码率区间,并根据当前码率所在的码率区间,以对帧间隔作不同的处理,具体而言,实施例1步骤S190被以下步骤取代后,形成了实施例2的方案,详细如下。This embodiment provides another embodiment of the H.264 video encoding method, which is substantially the same as the first embodiment, with the main difference being that a bit rate interval determined by a plurality of bit rate thresholds is set, and the frame interval is processed differently according to the bit rate interval in which the current bit rate is located. Specifically, after step S190 of the first embodiment is replaced by the following steps, the scheme of the second embodiment is formed, as described in detail as follows.

设置第二码率阈值THR2和第三码率阈值THR3,实时检测所述压缩码流的码率,判断所述码率的大小。A second bit rate threshold THR2 and a third bit rate threshold THR3 are set to detect the bit rate of the compressed bit stream in real time and determine the size of the bit rate.

若:第二码率阈值≤所述码率≤第三码率阈值,则不对帧间隔的大小进行调整,并重新执行步骤S120-S190,直至完成编码。例如,设置目标码率target_bit,以及容许的偏差百分比X(例如2%),即target_bit-X*target_bit≤码率≤target_bit+X*target_bit时,保持帧间隔不变,以防止帧间隔的不断修正。If: the second code rate threshold ≤ the code rate ≤ the third code rate threshold, the size of the frame interval is not adjusted, and steps S120-S190 are re-executed until the encoding is completed. For example, when the target code rate target_bit and the allowable deviation percentage X (e.g., 2%) are set, that is, target_bit-X*target_bit≤code rate≤target_bit+X*target_bit, the frame interval is kept unchanged to prevent the frame interval from being constantly corrected.

若:所述码率>第三码率阈值,则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S120-S190。例如,设置目标码率target_bit,以及容许的偏差百分比X,即码率>target_bit+X*target_bit时,增加所述帧间隔以减少非参考帧的数量,进而降低码率的同时保证一定的编码质量。If: the bit rate > the third bit rate threshold, the frame interval is increased to reduce the number of non-reference frames, and steps S120-S190 are performed again. For example, when the target bit rate target_bit and the allowable deviation percentage X are set, that is, when the bit rate > target_bit + X*target_bit, the frame interval is increased to reduce the number of non-reference frames, thereby reducing the bit rate while ensuring a certain encoding quality.

若:所述码率<第二码率阈值,则减小所述帧间隔以增加非参考帧的数量,并重新执行步骤S120-S190,直至完成编码。例如,设置目标码率target_bit,以及容许的偏差百分比X,即码率>target_bit-X*target_bit时,减小所述帧间隔以增加非参考帧的数量,进而当这些非参考帧丢失之后,解码时丢失的非参考帧后面的帧仍然可以解码恢复,即保证了视频序列在无线传输中的抗干扰能力。If: the bit rate is less than the second bit rate threshold, the frame interval is reduced to increase the number of non-reference frames, and steps S120-S190 are re-executed until the encoding is completed. For example, when the target bit rate target_bit and the allowable deviation percentage X are set, that is, the bit rate>target_bit-X*target_bit, the frame interval is reduced to increase the number of non-reference frames, and then when these non-reference frames are lost, the frames following the lost non-reference frames during decoding can still be decoded and recovered, that is, the anti-interference ability of the video sequence in wireless transmission is guaranteed.

图3是本发明一种实施例的编码后的视频帧序列示意图,按照本实施例的前述步骤的编码过程中0-6号帧相关参数的计算结果如下表1所示。FIG3 is a schematic diagram of a sequence of encoded video frames according to an embodiment of the present invention. The calculation results of the parameters related to frames 0-6 during the encoding process according to the aforementioned steps of this embodiment are shown in Table 1 below.

表1Table 1

需要说明的是,本发明中采用步骤编号(字母或数字编号)来指代某些具体的方法步骤,仅仅是出于描述方便和简洁的目的,而绝不是用字母或数字来限制这些方法步骤的顺序。本领域的技术人员能够明了,相关方法步骤的顺序,应由技术本身决定,不应因步骤编号的存在而被不适当地限制。It should be noted that the use of step numbers (letters or numbers) to refer to certain specific method steps in the present invention is only for the purpose of convenience and brevity of description, and is by no means intended to limit the order of these method steps. Those skilled in the art will appreciate that the order of the relevant method steps should be determined by the technology itself and should not be inappropriately limited by the existence of step numbers.

本领域的技术人员能够理解的是,在不冲突的前提下,上述各优选方案可以自由地组合、叠加。Those skilled in the art will appreciate that, without conflict, the above-mentioned preferred solutions can be freely combined and superimposed.

应当理解,上述的实施方式仅是示例性的,而非限制性的,在不偏离本发明的基本原理的情况下,本领域的技术人员可以针对上述细节做出的各种明显的或等同的修改或替换,都将包含于本发明的权利要求范围内。It should be understood that the above-mentioned embodiments are merely illustrative and not restrictive. Without departing from the basic principles of the present invention, various obvious or equivalent modifications or substitutions that can be made by those skilled in the art to the above-mentioned details will be included in the scope of the claims of the present invention.

Claims (17)

1.一种H.264视频编码方法,其特征在于,包括如下步骤:1. A H.264 video encoding method, comprising the following steps: S110,判断当前帧的类型,若所述当前帧的类型是I帧,则将所述当前帧的第一标识设置为参考帧,并执行步骤S140-S150,若所述当前帧的类型是P帧则执行步骤S120-S150;S110, determining the type of the current frame. If the type of the current frame is an I frame, setting the first identifier of the current frame as a reference frame and executing steps S140-S150. If the type of the current frame is a P frame, executing steps S120-S150. S120,判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并执行步骤S140-S150;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并执行步骤S140-S150;若所述当前帧的位置在设定帧位置之后,执行步骤S130-S150;其中,所述第一标识用于表示所述当前帧是否为参考帧;S120, determining the position of the current frame. If the position of the current frame is before the set frame position, setting the first identifier of the current frame as a reference frame, and executing steps S140-S150; if the position of the current frame is the set frame position, setting the first identifier of the current frame as a non-reference frame, and executing steps S140-S150; if the position of the current frame is after the set frame position, executing steps S130-S150; wherein the first identifier is used to indicate whether the current frame is a reference frame; S130,判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;S130, determining whether the frame interval between the current frame and the nearest non-reference frame is a set frame interval, if yes, setting the first identifier of the current frame to a non-reference frame, if no, setting the first identifier of the current frame to a reference frame; S140,对所述当前帧根据其第一标识进行编码,并输出压缩码流;S140, encoding the current frame according to its first identifier, and outputting a compressed code stream; S150,实时检测所述压缩码流的码率,判断所述码率是否大于第一码率阈值,若否则重新执行步骤S110-S150,若是则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S110-S150直至完成编码。S150, detecting the bit rate of the compressed code stream in real time, determining whether the bit rate is greater than a first bit rate threshold, if not, re-executing steps S110-S150, if yes, increasing the frame interval to reduce the number of non-reference frames, and re-executing steps S110-S150 until the encoding is completed. 2.根据权利要求1所述的H.264视频编码方法,其特征在于,2. The H.264 video encoding method according to claim 1, characterized in that: 在步骤S150中,所述帧间隔每次增加数值1。In step S150, the frame interval is increased by a value of 1 each time. 3.根据权利要求1-2任一所述的H.264视频编码方法,其特征在于,3. The H.264 video encoding method according to any one of claims 1-2, characterized in that: 在步骤S110之前,所述视频编码方法还包括如下步骤:Before step S110, the video encoding method further includes the following steps: S100,在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;S100, providing two encoding buffer addresses for storing reference frame data generated during the encoding process in a buffer for encoding; 所述步骤S110还包括以下步骤:The step S110 further includes the following steps: 若所述当前帧的类型是I帧,将所述当前帧的第一标识写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;If the type of the current frame is an I frame, write the first identifier of the current frame into the frame header of the current frame, and initialize the write cache address of the current frame to any one of the two encoding cache addresses to store reference frame data obtained by encoding the current frame; 所述步骤S130后还包括以下步骤:The step S130 further includes the following steps: S131,将所述当前帧的所述第一标识写入所述当前帧的帧头部;S131, writing the first identifier of the current frame into the frame header of the current frame; S132,判断所述当前帧的前一帧是否为参考帧,若是,则执行步骤S133,若否执行步骤S134;S132, determining whether the previous frame of the current frame is a reference frame, if so, executing step S133, if not, executing step S134; S133,将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;S133, assigning the read cache address of the current frame to the write cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the frame before the current frame during encoding, and assigning the write cache address to the other of the two encoding cache addresses except the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame; S134,将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。S134, keeping the read cache address of the current frame consistent with the read cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the reference frame of the frame before the current frame during encoding, and keeping the write cache address consistent with the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame. 4.根据权利要求1-2任一所述的H.264视频编码方法,其特征在于,4. The H.264 video encoding method according to any one of claims 1-2, characterized in that: 在步骤S110和S130中,将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。In steps S110 and S130, the first identifier of the current frame is written into a padding network abstraction layer unit in a frame header of the current frame. 5.一种H.264视频编码方法,其特征在于,包括如下步骤:5. A H.264 video encoding method, characterized in that it comprises the following steps: S210,判断当前帧的类型,若所述当前帧的类型是I帧,则所述当前帧的第一标识设置为参考帧,并执行步骤S240-S250,若所述当前帧的类型是P帧则执行步骤S220-S250;S210, determining the type of the current frame. If the type of the current frame is an I frame, the first identifier of the current frame is set as a reference frame, and steps S240-S250 are executed. If the type of the current frame is a P frame, steps S220-S250 are executed. S220,判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并执行步骤S240-S250;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并执行步骤S240-S250;若所述当前帧的位置在设定帧位置之后,执行步骤S230-S250;其中,所述第一标识用于表示所述当前帧是否为参考帧;S220, determining the position of the current frame. If the position of the current frame is before the set frame position, setting the first identifier of the current frame as a reference frame, and executing steps S240-S250; if the position of the current frame is the set frame position, setting the first identifier of the current frame as a non-reference frame, and executing steps S240-S250; if the position of the current frame is after the set frame position, executing steps S230-S250; wherein the first identifier is used to indicate whether the current frame is a reference frame; S230,判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;S230, determining whether the frame interval between the current frame and the nearest non-reference frame is a set frame interval, if yes, setting the first identifier of the current frame to a non-reference frame, if no, setting the first identifier of the current frame to a reference frame; S240,对所述当前帧根据其第一标识进行编码,并输出压缩码流;S240, encoding the current frame according to its first identifier, and outputting a compressed code stream; S250,实时检测所述压缩码流的码率,判断所述码率的大小,S250, detecting the bit rate of the compressed bit stream in real time and determining the size of the bit rate, 若:第二码率阈值≤所述码率≤第三码率阈值,则不调整帧间隔大小,并重新执行步骤S210-S250,直至完成编码;If: the second code rate threshold ≤ the code rate ≤ the third code rate threshold, the frame interval size is not adjusted, and steps S210-S250 are re-executed until the encoding is completed; 若:所述码率>第三码率阈值,则增加所述帧间隔以减少非参考帧的数量,并重新执行步骤S210-S250,直至完成编码;If: the bit rate> the third bit rate threshold, then increase the frame interval to reduce the number of non-reference frames, and re-execute steps S210-S250 until the encoding is completed; 若:所述码率<第二码率阈值,则减小所述帧间隔以增加非参考帧的数量,并重新执行步骤S210-S250,直至完成编码。If: the code rate is less than the second code rate threshold, the frame interval is reduced to increase the number of non-reference frames, and steps S210 to S250 are re-executed until the encoding is completed. 6.根据权利要求5所述的H.264视频编码方法,其特征在于,6. The H.264 video encoding method according to claim 5, characterized in that: 在步骤S250中,所述帧间隔每次减小数值1和/或所述帧间隔每次增加数值1。In step S250, the frame interval is decreased by a value of 1 each time and/or the frame interval is increased by a value of 1 each time. 7.根据权利要求5所述的H.264视频编码方法,其特征在于,7. The H.264 video encoding method according to claim 5, characterized in that: 在步骤S210之前,所述视频编码方法还包括如下步骤:Before step S210, the video encoding method further includes the following steps: S200,在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;S200, providing two encoding buffer addresses for storing reference frame data generated during the encoding process in a buffer for encoding; 所述步骤S210还包括以下步骤:The step S210 further includes the following steps: 若所述当前帧的类型是I帧,将所述当前帧的第一标识设置写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;If the type of the current frame is an I frame, writing the first identification setting of the current frame into the frame header of the current frame, and initializing the write cache address of the current frame to any one of the two encoding cache addresses for storing reference frame data obtained by encoding the current frame; 所述步骤S230后还包括以下步骤:The step S230 further includes the following steps: S231,将所述当前帧的所述第一标识写入所述当前帧的帧头部;S231, writing the first identifier of the current frame into the frame header of the current frame; S232,判断所述当前帧的前一帧是否为参考帧,若是,则执行步骤S233,若否执行步骤S234;S232, determining whether the previous frame of the current frame is a reference frame, if so, executing step S233, if not, executing step S234; S233,将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;S233, assigning the read cache address of the current frame to the write cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the frame before the current frame during encoding, and assigning the write cache address to the other of the two encoding cache addresses except the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame; S234,将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。S234, keeping the read cache address of the current frame consistent with the read cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the reference frame of the frame before the current frame during encoding, and keeping the write cache address consistent with the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame. 8.根据权利要求7所述的H.264视频编码方法,其特征在于,8. The H.264 video encoding method according to claim 7, characterized in that: 在步骤S210和S230中,将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。In steps S210 and S230, the first identifier of the current frame is written into a padding network abstraction layer unit in a frame header of the current frame. 9.一种H.264视频编码装置,其特征在于,包括:9. An H.264 video encoding device, comprising: 第一一处理单元,用于判断当前帧的类型,若所述当前帧的类型是I帧,则将所述当前帧的第一标识设置为参考帧,并触发第一四处理单元和第一五处理单元工作,若所述当前帧的类型是P帧则触发第一二处理单元至第一五处理单元工作;The first processing unit is used to determine the type of the current frame. If the type of the current frame is an I frame, the first identifier of the current frame is set as a reference frame, and the first four processing units and the first five processing units are triggered to work. If the type of the current frame is a P frame, the first two processing units to the first five processing units are triggered to work. 第一二处理单元,用于判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并触发第一四处理单元和第一五处理单元工作;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并触发第一四处理单元和第一五处理单元工作;若所述当前帧的位置在设定帧位置之后,触发第一三处理单元至第一五处理单元工作;其中,所述第一标识用于表示所述当前帧是否为参考帧;The first two processing units are used to determine the position of the current frame. If the position of the current frame is before the set frame position, the first identifier of the current frame is set as a reference frame, and the first four processing units and the first five processing units are triggered to work; if the position of the current frame is the set frame position, the first identifier of the current frame is set as a non-reference frame, and the first four processing units and the first five processing units are triggered to work; if the position of the current frame is after the set frame position, the first three processing units to the first five processing units are triggered to work; wherein the first identifier is used to indicate whether the current frame is a reference frame; 第一三处理单元,用于判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;The first three processing units are used to determine whether the frame interval between the current frame and the nearest non-reference frame is a set frame interval, and if so, set the first identifier of the current frame as a non-reference frame; if not, set the first identifier of the current frame as a reference frame; 第一四处理单元,用于对所述当前帧根据其第一标识进行编码,并输出压缩码流;The first four processing units are used to encode the current frame according to its first identifier and output a compressed code stream; 第一五处理单元,用于实时检测所述压缩码流的码率,判断所述码率是否大于第一码率阈值,若否则重新触发第一一处理单元至第一五处理单元工作,若是则增加所述帧间隔以减少非参考帧的数量,并重新触发第一一处理单元至第一五处理单元工作,直至完成编码。The first five processing units are used to detect the bit rate of the compressed code stream in real time, determine whether the bit rate is greater than the first bit rate threshold, and if not, re-trigger the first one to the first five processing units to work; if so, increase the frame interval to reduce the number of non-reference frames, and re-trigger the first one to the first five processing units to work until the encoding is completed. 10.根据权利要求9所述的H.264视频编码装置,其特征在于,10. The H.264 video encoding device according to claim 9, characterized in that: 所述第一五处理单元用于将所述帧间隔每次增加数值1。The first five processing units are used to increase the frame interval by a value of 1 each time. 11.根据权利要求9所述的H.264视频编码装置,其特征在于,还包括第一六处理单元和第一七处理单元,11. The H.264 video encoding device according to claim 9, further comprising a first sixth processing unit and a first seventh processing unit, 所述第一六处理单元用于在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;The first six processing units are used to provide two blocks of encoding buffer addresses storing reference frame data generated by the encoding process in the buffer for encoding; 所述第一一处理单元还用于:The first processing unit is further configured to: 若所述当前帧的类型是I帧,将所述当前帧的第一标识写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;所述第一七处理单元用于:If the type of the current frame is an I frame, write the first identifier of the current frame into the frame header of the current frame, initialize the write cache address of the current frame to any one of the two encoding cache addresses, so as to store reference frame data obtained by encoding the current frame; the first seven processing units are used for: 将所述当前帧的所述第一标识写入所述当前帧的帧头部;判断所述当前帧的前一帧是否为参考帧,writing the first identifier of the current frame into the frame header of the current frame; determining whether the previous frame of the current frame is a reference frame, 若是,则:将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;If yes, then: assigning the read cache address of the current frame to the write cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the frame before the current frame during encoding, and assigning the write cache address to the other of the two encoding cache addresses except the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame; 若否,则:将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。If not, then: the read cache address of the current frame is kept consistent with the read cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the reference frame of the frame before the current frame during encoding, and the write cache address is kept consistent with the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame. 12.根据权利要求9所述的H.264视频编码装置,其特征在于,12. The H.264 video encoding device according to claim 9, characterized in that: 所述第一一处理单元和第一三处理单元还用于将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。The first-first processing unit and the first-third processing unit are further configured to write the first identifier of the current frame into a padding network abstraction layer unit in a frame header of the current frame. 13.一种H.264视频编码装置,其特征在于,包括:13. An H.264 video encoding device, comprising: 第二一处理单元,用于判断当前帧的类型,若所述当前帧的类型是I帧,则将所述当前帧的第一标识设置为参考帧,并触发第二四处理单元和第二五处理单元工作,若所述当前帧的类型是P帧则执行步骤触发第二二处理单元至第二五处理单元工作;The second-first processing unit is used to determine the type of the current frame. If the type of the current frame is an I frame, the first identifier of the current frame is set as a reference frame, and the second-fourth processing unit and the second-fifth processing unit are triggered to work. If the type of the current frame is a P frame, the steps are executed to trigger the second-second processing unit to the second-fifth processing unit to work. 第二二处理单元,用于判断所述当前帧的位置,若所述当前帧的位置在设定帧位置之前,则将所述当前帧的第一标识设置为参考帧,并触发第二四处理单元和第二五处理单元工作;若所述当前帧的位置为设定帧位置,则将所述当前帧的第一标识设置为非参考帧,并触发第二四处理单元和第二五处理单元工作;若所述当前帧的位置在设定帧位置之后,触发第二三处理单元至第二五处理单元工作;其中,所述第一标识用于表示所述当前帧是否为参考帧;The second processing unit is used to determine the position of the current frame. If the position of the current frame is before the set frame position, the first identifier of the current frame is set as a reference frame, and the second fourth processing unit and the second fifth processing unit are triggered to work; if the position of the current frame is the set frame position, the first identifier of the current frame is set as a non-reference frame, and the second fourth processing unit and the second fifth processing unit are triggered to work; if the position of the current frame is after the set frame position, the second third processing unit to the second fifth processing unit are triggered to work; wherein the first identifier is used to indicate whether the current frame is a reference frame; 第二三处理单元,用于判断所述当前帧距最近的非参考帧的帧间距是否为设定帧间隔,若是则将所述当前帧的第一标识设置为非参考帧,若否则将所述当前帧的第一标识设置为参考帧;The second third processing unit is used to determine whether the frame interval between the current frame and the nearest non-reference frame is a set frame interval, and if so, set the first identifier of the current frame to a non-reference frame; if not, set the first identifier of the current frame to a reference frame; 第二四处理单元,用于对所述当前帧根据其第一标识进行编码,并输出压缩码流;The second four-processing unit is used to encode the current frame according to its first identifier and output a compressed code stream; 第二五处理单元,用于实时检测所述压缩码流的码率,判断所述码率的大小,The second fifth processing unit is used to detect the code rate of the compressed code stream in real time and determine the size of the code rate. 若:第二码率阈值≤所述码率≤第三码率阈值,则不调整帧间隔大小,并重新触发第二一处理单元至第二五处理单元工作;If: the second code rate threshold ≤ the code rate ≤ the third code rate threshold, the frame interval size is not adjusted, and the second-first processing unit to the second-fifth processing unit are re-triggered to work; 若:所述码率>第三码率阈值,则增加所述帧间隔以减少非参考帧的数量,并重新触发第二一处理单元至第二五处理单元工作,直至完成编码;If: the bit rate> the third bit rate threshold, then increasing the frame interval to reduce the number of non-reference frames, and re-triggering the second-first processing unit to the second-fifth processing unit to work until the encoding is completed; 若:所述码率<第二码率阈值,则减小所述帧间隔以增加非参考帧的数量,并重新触发第二一处理单元至第二五处理单元工作,直至完成编码。If: the code rate is less than the second code rate threshold, the frame interval is reduced to increase the number of non-reference frames, and the second-first processing unit to the second-fifth processing unit are re-triggered to work until the encoding is completed. 14.根据权利要求13所述的H.264视频编码装置,其特征在于,14. The H.264 video encoding device according to claim 13, characterized in that: 所述第二五处理单元用于将所述帧间隔每次减小数值1和/或所述帧间隔每次增加数值1。The second fifth processing unit is used for reducing the frame interval by a value of 1 each time and/or increasing the frame interval by a value of 1 each time. 15.根据权利要求13所述的H.264视频编码装置,其特征在于,还包括:第二八处理单元和第二九处理单元,15. The H.264 video encoding device according to claim 13, further comprising: a second eighth processing unit and a second ninth processing unit, 用于在缓存器中为编码提供存储编码过程产生的参考帧数据的两块编码缓存地址;Two encoding buffer addresses for storing reference frame data generated by the encoding process in the buffer for encoding; 所述第二一处理单元,还用于若所述当前帧的类型是I帧,将所述当前帧的第一标识写入所述当前帧的帧头部,将所述当前帧的写缓存地址初始化为所述两块编码缓存地址中的任一编码缓存地址,以用于存储对所述当前帧进行编码得到的参考帧数据;The second-first processing unit is further configured to, if the type of the current frame is an I frame, write the first identifier of the current frame into the frame header of the current frame, and initialize the write cache address of the current frame to any one of the two encoding cache addresses, so as to store the reference frame data obtained by encoding the current frame; 所述第二九处理单元用于将所述当前帧的所述第一标识写入所述当前帧的帧头部;将所述当前帧的所述第一标识写入所述当前帧的帧头部;判断所述当前帧的前一帧是否为参考帧,The second ninth processing unit is used to write the first identifier of the current frame into the frame header of the current frame; write the first identifier of the current frame into the frame header of the current frame; determine whether the previous frame of the current frame is a reference frame, 若是,则:将所述当前帧的读缓存地址赋值为所述当前帧前一帧的写缓存地址,以在编码时读取所述当前帧前一帧编码得到的参考帧数据,将写缓存地址赋值为所述两块编码缓存地址中除所述当前帧前一帧的写缓存地址外的另一者,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据;If yes, then: assigning the read cache address of the current frame to the write cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the frame before the current frame during encoding, and assigning the write cache address to the other of the two encoding cache addresses except the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame; 若否,则:将所述当前帧的读缓存地址保持与所述当前帧前一帧的读缓存地址一致,以在编码时读取所述当前帧前一帧的参考帧编码得到的参考帧数据,将写缓存地址保持与所述当前帧前一帧的写缓存地址一致,以在当前帧是参考帧时存储所述当前帧编码得到的参考帧数据。If not, then: the read cache address of the current frame is kept consistent with the read cache address of the frame before the current frame, so as to read the reference frame data obtained by encoding the reference frame of the frame before the current frame during encoding, and the write cache address is kept consistent with the write cache address of the frame before the current frame, so as to store the reference frame data obtained by encoding the current frame when the current frame is a reference frame. 16.根据权利要求15所述的H.264视频编码装置,其特征在于,16. The H.264 video encoding device according to claim 15, characterized in that: 所述第二一处理单元和第二三处理单元还用于将所述当前帧的所述第一标识写入所述当前帧的帧头部中的填充网络抽象层单元内。The second-first processing unit and the second-third processing unit are further configured to write the first identifier of the current frame into a padding network abstraction layer unit in a frame header of the current frame. 17.一种存储程序的存储介质,其特征在于,所述程序被处理器执行成如权利要求1-8任一所述的编码方法。17. A storage medium storing a program, characterized in that the program is executed by a processor as the encoding method according to any one of claims 1 to 8.
CN202010568622.XA 2020-06-19 2020-06-19 H.264 video coding method, device and storage equipment Active CN112291566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010568622.XA CN112291566B (en) 2020-06-19 2020-06-19 H.264 video coding method, device and storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010568622.XA CN112291566B (en) 2020-06-19 2020-06-19 H.264 video coding method, device and storage equipment

Publications (2)

Publication Number Publication Date
CN112291566A CN112291566A (en) 2021-01-29
CN112291566B true CN112291566B (en) 2024-07-09

Family

ID=74421111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010568622.XA Active CN112291566B (en) 2020-06-19 2020-06-19 H.264 video coding method, device and storage equipment

Country Status (1)

Country Link
CN (1) CN112291566B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115550688A (en) * 2021-06-30 2022-12-30 华为技术有限公司 Video code stream processing method, medium, program product and electronic device
WO2023246936A1 (en) * 2022-06-24 2023-12-28 杭州海康威视数字技术股份有限公司 Image processing method and apparatus, and device
CN117793367B (en) * 2024-02-26 2024-06-04 此芯科技(上海)有限公司 Image coding method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141636A (en) * 2006-09-08 2008-03-12 联发科技股份有限公司 Data rate control method and video signal encoder
CN101207813A (en) * 2007-12-18 2008-06-25 中兴通讯股份有限公司 Method and system for encoding and decoding video sequence

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5592226A (en) * 1994-01-26 1997-01-07 Btg Usa Inc. Method and apparatus for video data compression using temporally adaptive motion interpolation
US20070199011A1 (en) * 2006-02-17 2007-08-23 Sony Corporation System and method for high quality AVC encoding
CN101674487B (en) * 2008-09-10 2011-11-23 中兴通讯股份有限公司 Video encoding method and device
CN101621688B (en) * 2009-04-30 2011-08-17 武汉大学 Codec method for realizing AVS video standard time domain classification
US9584832B2 (en) * 2011-12-16 2017-02-28 Apple Inc. High quality seamless playback for video decoder clients
KR20160071569A (en) * 2014-12-11 2016-06-22 삼성전자주식회사 Video processing method and therefore video system
CN106817585B (en) * 2015-12-02 2020-05-01 掌赢信息科技(上海)有限公司 Video coding method, electronic equipment and system using long-term reference frame

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141636A (en) * 2006-09-08 2008-03-12 联发科技股份有限公司 Data rate control method and video signal encoder
CN101207813A (en) * 2007-12-18 2008-06-25 中兴通讯股份有限公司 Method and system for encoding and decoding video sequence

Also Published As

Publication number Publication date
CN112291566A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN112291566B (en) H.264 video coding method, device and storage equipment
CN103636220B (en) Method and apparatus for encoding/decoding intra prediction mode
TW201309040A (en) Adaptive configuration of reference frame buffer based on camera and background motion
JPWO2007136093A1 (en) Image decoding device
CN107371029B (en) Content-based video packet priority allocation method
CN112740682B (en) Scalar quantizer decision scheme for dependency scalar quantization
AU2011362462A1 (en) Encoding method and device, and decoding method and device
CN105872556B (en) Video encoding method and apparatus
US20130163670A1 (en) Multiview video coding reference picture selection under a one reference picture constraint
EP2814253A1 (en) Method for encoding digital video data
US9319682B2 (en) Moving image encoding apparatus, control method therefor, and non-transitory computer readable storage medium
US8761239B2 (en) Image coding apparatus, method, integrated circuit, and program
CN109587431A (en) A kind of multi-channel video code stream merging method, device, equipment and storage medium
CN108024114B (en) High-capacity lossless HEVC information hiding method based on flag bit parameter modification
US10567757B2 (en) Dynamic reference picture reconstruction
US20150103895A1 (en) Electronic devices for signaling multiple initial buffering parameters
CN112291569B (en) Encoding method and device of H.264 image group, encoding and decoding chip and electronic equipment
CN108322754A (en) Coding method and corresponding coder and decoder
CN103945221B (en) Video coding-decoding method, device and the video code flow of generation
TWI568238B (en) Method and system for generating side information at a video encoder to differentiate packet data
US20140369424A1 (en) Video codec system and video stream transmission method
WO2012095030A1 (en) Slice encoding method and device and slice decoding method and device
CN101578873B (en) A device and method for decoding multi-view video content
CN112449183B (en) Video encoder, video decoder and video system
WO2015027685A1 (en) Video compression method and video compressor

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519075 No. 333, Kexing Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

Address before: Floor 1-107, building 904, ShiJiHua Road, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant