Nothing Special   »   [go: up one dir, main page]

CN112929667B - Encoding and decoding method, device, equipment and readable storage medium - Google Patents

Encoding and decoding method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN112929667B
CN112929667B CN202110325525.2A CN202110325525A CN112929667B CN 112929667 B CN112929667 B CN 112929667B CN 202110325525 A CN202110325525 A CN 202110325525A CN 112929667 B CN112929667 B CN 112929667B
Authority
CN
China
Prior art keywords
image
frame
encoding
consecutive
frames
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
CN202110325525.2A
Other languages
Chinese (zh)
Other versions
CN112929667A (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.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture 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 China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110325525.2A priority Critical patent/CN112929667B/en
Publication of CN112929667A publication Critical patent/CN112929667A/en
Application granted granted Critical
Publication of CN112929667B publication Critical patent/CN112929667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • 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

Landscapes

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

Abstract

The invention provides a coding and decoding method, a device, equipment and a readable storage medium, wherein the coding method comprises the following steps: determining at least two consecutive image frames from a current group of pictures GOP in response to a received instantaneous decoding refresh IDR request; determining a first partial image region from the image regions of each of the at least two consecutive image frames, respectively, as intra-coded image regions of each of the at least two consecutive image frames; wherein, the positions of the respective intra-frame coding image areas in the corresponding image areas can jointly cover the whole image area of a single image frame; in encoding the at least two consecutive image frames, performing: and encoding the intra-frame encoded image area by adopting an intra-frame encoding mode. The scheme well solves the problem that the encoding and decoding scheme aiming at the IDR request in the prior art is easy to cause image quality degradation.

Description

一种编解码方法、装置、设备及可读存储介质A codec method, device, equipment and readable storage medium

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种编解码方法、装置、设备及可读存储介质。The present invention relates to the field of communication technology, in particular to a codec method, device, equipment and readable storage medium.

背景技术Background technique

现有技术中,在网络出现丢包误码时(也即视频出现花屏现象),通常会通过接收端向发送端一个IDR(Instantaneous Decoding Refresh,即时解码刷新)刷新请求,在发送端收到接收端发送的IDR请求后,发送端会立刻编码一个以IDR视频帧为初始帧的视频序列,并将该视频序列发送给接收端,这样,在该IDR视频帧被接收端完全接收解码后,花屏现象即可消失。In the prior art, when there is a packet loss error in the network (that is, the video appears to be blurred), usually an IDR (Instantaneous Decoding Refresh, Instant Decoding Refresh) refresh request is sent from the receiving end to the sending end, and the receiving end is received at the sending end. After the IDR request sent by the terminal, the transmitting terminal will immediately encode a video sequence with the IDR video frame as the initial frame, and send the video sequence to the receiving terminal. In this way, after the IDR video frame is completely received and decoded by the receiving terminal, the blurred screen The phenomenon will disappear.

然而,由于现有技术中通常是按照GOP(Group of Pictures,画面组)的方式去控制码率和发送视频序列,而IDR帧所占带宽一般是P帧(向前预测编码帧)所占带宽的10倍,这样一来,如果当前突然插入新的IDR帧,则可能导致码率突然剧增,引起网络抖动、丢包、阻塞、卡顿,非但不能解决花屏问题,还会引入网络丢包剧增、图像质量突然下降等问题,导致后续视频更加卡顿,更多的解码失败。However, since in the prior art, the code rate is usually controlled and the video sequence is sent in the form of GOP (Group of Pictures), and the bandwidth occupied by the IDR frame is generally the bandwidth occupied by the P frame (forward predictive coding frame) In this way, if a new IDR frame is suddenly inserted, it may cause a sudden increase in the bit rate, causing network jitter, packet loss, congestion, and freeze. Not only cannot solve the problem of blurred screen, but also introduce network packet loss Problems such as sharp increase and sudden drop in image quality lead to further freezes in subsequent videos and more decoding failures.

由上可知,现有针对IDR请求的编解码方案存在易引起图像质量下降等问题。It can be seen from the above that the existing codec scheme for the IDR request has problems such as easy degradation of image quality.

发明内容Contents of the invention

本发明的目的在于提供一种编解码方法、装置、设备及可读存储介质,以解决现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。The purpose of the present invention is to provide a codec method, device, device and readable storage medium to solve the problem in the prior art that the codec scheme for IDR requests easily causes image quality degradation.

为了解决上述技术问题,本发明实施例提供一种编码方法,包括:In order to solve the above technical problems, an embodiment of the present invention provides an encoding method, including:

响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;In response to the received immediate decoding refresh IDR request, from the current group of pictures GOP, determine at least two consecutive image frames;

从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;From the respective image regions of the at least two consecutive image frames, respectively determine the first partial image regions as the respective intra-coded image regions of the at least two consecutive image frames; wherein, the respective intra-frame The position of the coded image area in the corresponding image area can jointly cover the entire image area of a single said image frame;

在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。When encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area in an intra-frame encoding manner.

可选的,所述方法还包括:Optionally, the method also includes:

从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;From the respective image areas of the specified image frames, respectively determine the second partial image areas as the respective interframe coded image areas of the specified image frames; the specified image frame is one of the at least two consecutive image frames Other image frames except the first image frame; the inter-coded image area of each specified image frame satisfies: the image area corresponding to the intra-coded image area of the previous image frame of the specified image frame in the same position;

在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。When encoding the designated image frame, perform: encoding the inter-coded image area by adopting a forward predictive encoding manner.

可选的,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,包括:Optionally, in response to the received immediate decoding refresh IDR request, determine at least two consecutive image frames from the current group of pictures GOP, including:

响应于所述IDR请求,确定表征网络质量的指标值;In response to the IDR request, determine an index value representing network quality;

根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧。The at least two consecutive image frames are determined from the current GOP according to the index value.

可选的,响应于所述IDR请求,确定表征网络质量的指标值,包括:Optionally, in response to the IDR request, determine an index value representing network quality, including:

响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame;

若符合,则确定所述指标值。If so, determine the index value.

可选的,判断当前图像帧是否符合受限图像帧判定条件,包括:Optionally, judging whether the current image frame meets the criteria for judging the restricted image frame includes:

根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件。According to the arrangement position of the current image frame in the current GOP, it is determined whether the current image frame to be encoded meets the determination condition for the limited image frame.

可选的,根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件,包括:Optionally, according to the arrangement position of the current image frame in the current GOP, determining whether the current image frame to be encoded meets the determination condition for the restricted image frame includes:

判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind;

若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame;

若否,则确定所述当前图像帧不符合所述受限图像判定条件。If not, it is determined that the current image frame does not meet the restricted image determination condition.

可选的,所述指标值包括往返时延rtt的值;Optionally, the index value includes a value of round-trip delay rtt;

根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:According to the index value, determining the at least two consecutive image frames from the current GOP includes:

根据所述rtt的值和rtt阈值,确定目标时间窗的大小;Determine the size of the target time window according to the rtt value and the rtt threshold;

根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。According to the size of the target time window, determining a number of consecutive image frames matching the size of the target time window from the GOP as the at least two consecutive image frames.

可选的,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:Optionally, determining the first partial image area from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames includes:

根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area.

本发明实施例还提供了一种解码方法,包括:The embodiment of the present invention also provides a decoding method, including:

发送即时解码刷新IDR请求;Send instant decoding refresh IDR request;

接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;receiving an image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request;

所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, the encoding end performs: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame encoding method;

所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。The respective intra-coded image areas of the at least two consecutive image frames are the first partial image areas of the respective image areas of the at least two consecutive image frames; the respective intra-frame coded image areas are in the corresponding The positions in the image area can collectively cover the entire image area of a single image frame.

本发明实施例还提供了一种编码装置,包括:The embodiment of the present invention also provides an encoding device, including:

第一确定模块,用于响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;The first determining module is configured to determine at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request;

第二确定模块,用于从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;The second determination module is configured to respectively determine the first partial image area from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames; wherein , the positions of the respective intra-coded image areas in the corresponding image areas can jointly cover the entire image area of a single image frame;

第一编码模块,用于在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。The first encoding module is configured to, when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding manner.

可选的,所述装置还包括:Optionally, the device also includes:

第三确定模块,用于从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;The third determination module is used to determine the second partial image area respectively from the respective image areas of the specified image frame as the respective inter-frame coded image areas of the specified image frame; the specified image frame is the at least two other image frames except the first image frame in consecutive image frames; the inter-coded image area of each designated image frame satisfies: The image areas are at the same position in the corresponding image area;

第二编码模块,用于在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。The second encoding module is configured to, when encoding the specified image frame, perform: encoding the inter-frame encoded image area by adopting a forward predictive encoding manner.

可选的,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,包括:Optionally, in response to the received immediate decoding refresh IDR request, determine at least two consecutive image frames from the current group of pictures GOP, including:

响应于所述IDR请求,确定表征网络质量的指标值;In response to the IDR request, determine an index value representing network quality;

根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧。The at least two consecutive image frames are determined from the current GOP according to the index value.

可选的,响应于所述IDR请求,确定表征网络质量的指标值,包括:Optionally, in response to the IDR request, determine an index value representing network quality, including:

响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame;

若符合,则确定所述指标值。If so, determine the index value.

可选的,判断当前图像帧是否符合受限图像帧判定条件,包括:Optionally, judging whether the current image frame meets the criteria for judging the restricted image frame includes:

根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件。According to the arrangement position of the current image frame in the current GOP, it is determined whether the current image frame to be encoded meets the determination condition for the limited image frame.

可选的,根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件,包括:Optionally, according to the arrangement position of the current image frame in the current GOP, determining whether the current image frame to be encoded meets the determination condition for the restricted image frame includes:

判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind;

若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame;

若否,则确定所述当前图像帧不符合所述受限图像判定条件。If not, it is determined that the current image frame does not meet the restricted image determination condition.

可选的,所述指标值包括往返时延rtt的值;Optionally, the index value includes a value of round-trip delay rtt;

根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:According to the index value, determining the at least two consecutive image frames from the current GOP includes:

根据所述rtt的值和rtt阈值,确定目标时间窗的大小;Determine the size of the target time window according to the rtt value and the rtt threshold;

根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。According to the size of the target time window, determining a number of consecutive image frames matching the size of the target time window from the GOP as the at least two consecutive image frames.

可选的,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:Optionally, determining the first partial image area from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames includes:

根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area.

本发明实施例还提供了一种解码装置,包括:The embodiment of the present invention also provides a decoding device, including:

第一发送模块,用于发送即时解码刷新IDR请求;The first sending module is used to send an instant decoding refresh IDR request;

第一接收模块,用于接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;A first receiving module, configured to receive an image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request;

所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, the encoding end performs: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame encoding method;

所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。The respective intra-coded image areas of the at least two consecutive image frames are the first partial image areas of the respective image areas of the at least two consecutive image frames; the respective intra-frame coded image areas are in the corresponding The positions in the image area can collectively cover the entire image area of a single image frame.

本发明实施例还提供了一种编码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器执行所述程序时实现上述编码方法。An embodiment of the present invention also provides an encoding device, including a memory, a processor, and a program stored in the memory and operable on the processor; when the processor executes the program, the above encoding method is realized.

本发明实施例还提供了一种解码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器执行所述程序时实现上述解码方法。An embodiment of the present invention also provides a decoding device, including a memory, a processor, and a program stored in the memory and operable on the processor; when the processor executes the program, the above decoding method is realized.

本发明实施例还提供了一种可读存储介质,其上存储有程序,该程序被处理器执行时实现上述编码方法中的步骤;或者,该程序被处理器执行时实现上述解码方法中的步骤。The embodiment of the present invention also provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in the above-mentioned encoding method are realized; or, when the program is executed by a processor, the steps in the above-mentioned decoding method are realized step.

本发明的上述技术方案的有益效果如下:The beneficial effects of above-mentioned technical scheme of the present invention are as follows:

上述方案中,所述编码方法通过响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。通过本申请实施例的方案,能够实现在接收到IDR请求后,针对多个图像帧的局部图像区域进行帧内编码以达到完整IDR帧的效果,而不是直接将至少一个图像帧分别编码为完整IDR帧进行传输,这样,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,可以降低图像帧占用的带宽,从而避免引起更多丢包、网络抖动以及图像质量下降等问题,很好的解决了现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。In the above solution, the encoding method determines at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request; from the respective image areas of the at least two consecutive image frames In, the first partial image area is respectively determined as the respective intra-coded image areas of the at least two consecutive image frames; wherein, the positions of the respective intra-frame coded image areas in the corresponding image areas can be collectively covering the entire image area of a single image frame; when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area in an intra-frame encoding manner. Through the solution of the embodiment of the present application, after receiving the IDR request, it is possible to perform intra-frame encoding on the partial image areas of multiple image frames to achieve the effect of a complete IDR frame, instead of directly encoding at least one image frame into a complete IDR frame. IDR frames are transmitted. In this way, an IDR frame that occupies a large bandwidth is divided into multiple local intra-frame coding frames that occupy a small bandwidth, which can reduce the bandwidth occupied by image frames, thereby avoiding more packet loss and network jitter. As well as the problem of image quality degradation, it well solves the problem that the codec scheme for IDR request in the prior art easily causes image quality degradation.

附图说明Description of drawings

图1为本发明实施例的编码方法流程示意图;FIG. 1 is a schematic flow chart of an encoding method according to an embodiment of the present invention;

图2为本发明实施例的整个图像区域的覆盖示意图;FIG. 2 is a schematic diagram of coverage of the entire image area in an embodiment of the present invention;

图3为本发明实施例的解码方法流程示意图;FIG. 3 is a schematic flowchart of a decoding method according to an embodiment of the present invention;

图4为本发明实施例的编码方法实现框架示意图;FIG. 4 is a schematic diagram of an implementation framework of an encoding method according to an embodiment of the present invention;

图5为本发明实施例的编码装置结构示意图;FIG. 5 is a schematic structural diagram of an encoding device according to an embodiment of the present invention;

图6为本发明实施例的解码装置结构示意图。FIG. 6 is a schematic structural diagram of a decoding device according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.

本发明针对现有的技术中针对IDR请求的编解码方案易引起图像质量下降的问题,提供编码方法,如图1所示,包括:The present invention aims at the problem that the encoding and decoding schemes for IDR requests in the existing technology can easily cause image quality degradation, and provides an encoding method, as shown in Figure 1, including:

步骤11:响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧。Step 11: In response to the received immediate decoding refresh IDR request, determine at least two consecutive image frames from the current group of pictures GOP.

其中,所述当前GOP,是指接收到所述IDR请求时即将进行编码的第一个图像帧所属的GOP。关于确定的“至少两个连续的图像帧”中的图像帧可以包括第一个图像帧之前的帧、第一个图像帧和/或第一个图像帧之后的帧,在此不作限定。Wherein, the current GOP refers to the GOP to which the first image frame to be encoded belongs when the IDR request is received. The determined image frames in "at least two consecutive image frames" may include frames before the first image frame, the first image frame and/or frames after the first image frame, which are not limited herein.

步骤12:从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。Step 12: From the respective image regions of the at least two consecutive image frames, respectively determine the first partial image regions as the respective intra-coded image regions of the at least two consecutive image frames; wherein the respective The positions of the intra-frame coded image areas in the corresponding image area can collectively cover the entire image area of a single image frame.

其中“共同覆盖单个所述图像帧的整个图像区域”可以理解为:对应于一个图像帧的整个图像区域;不同图像帧的整个图像区域可以是相同的;共同覆盖可以是图像区域存在重叠或者不存在重叠而共同覆盖。以不重叠而共同覆盖的情况为例,假设选出A帧和B帧这连续的两帧,如图2所示,A帧的帧内编码图像区域a和B帧的帧内编码图像区域b能够共同覆盖一个图像帧的整个图像区域c。Wherein "covering the entire image area of a single image frame" can be understood as: corresponding to the entire image area of an image frame; the entire image area of different image frames can be the same; the common coverage can be that the image area overlaps or does not There is overlap and common coverage. Taking the case of non-overlapping and common coverage as an example, assuming that two consecutive frames of A frame and B frame are selected, as shown in Figure 2, the intra-frame coded image area a of A frame and the intra-frame coded image area b of B frame The entire image area c of an image frame can be covered together.

步骤13:在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。Step 13: When encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding manner.

在此步骤中,将IDR请求后反馈的IDR帧的帧内编码部分,拆分成多个连续帧的帧内编码部分分别进行编码,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,从而降低了对带宽的要求,避免丢包和卡顿等情况。In this step, the intra-frame coding part of the IDR frame fed back after the IDR request is split into the intra-frame coding parts of multiple consecutive frames and encoded separately, so that an IDR frame that occupies a large bandwidth is divided into multiple frames that occupy a large bandwidth. Partial intra-frame coding with small bandwidth reduces bandwidth requirements and avoids packet loss and stuttering.

由上,本发明实施例提供的所述编码方法通过响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。通过本申请实施例的方案,能够实现在接收到IDR请求后,针对多个图像帧的局部图像区域进行帧内编码以达到完整IDR帧的效果,而不是直接将至少一个图像帧分别编码为完整IDR帧进行传输,这样,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,可以降低图像帧占用带宽,从而避免引起更多丢包、网络抖动以及图像质量下降等问题;很好的解决了现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。From the above, the encoding method provided by the embodiment of the present invention determines at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request; from the at least two consecutive image frames In the respective image areas of the frames, the first partial image areas are respectively determined as the respective intra-coded image areas of the at least two consecutive image frames; wherein, the respective intra-frame coded image areas are in the corresponding image areas The location can jointly cover the entire image area of a single image frame; when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding method . Through the solution of the embodiment of the present application, after receiving the IDR request, it is possible to perform intra-frame encoding on the partial image areas of multiple image frames to achieve the effect of a complete IDR frame, instead of directly encoding at least one image frame into a complete IDR frame. IDR frames are transmitted. In this way, an IDR frame that occupies a large bandwidth is divided into multiple local intra-frame coded frames that occupy a small bandwidth, which can reduce the bandwidth occupied by image frames, thereby avoiding more packet loss, network jitter, and Problems such as image quality degradation; well solved the problem in the prior art that the encoding and decoding schemes for IDR requests easily cause image quality degradation.

进一步的,所述方法还包括:从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。Further, the method further includes: respectively determining the second partial image area from the respective image areas of the specified image frame as the respective inter-frame coded image areas of the specified image frame; the specified image frame is the Image frames other than the first image frame in at least two consecutive image frames; the inter-coded image area of each specified image frame satisfies: The positions of the intra-coded image areas in the corresponding image areas are the same; when encoding the specified image frame, it is performed: encoding the inter-coded image area by using a forward predictive encoding method.

这样,由于从上述确定至少两个连续的图像帧的首帧(即受限编码的首帧)开始,存在可前向参考的帧内编码帧,从而,从第二帧开始,就可以采用局部前向预测编码方式进行编码。在以上过程中,帧间编码的图像区域与其所参考的前一帧的图像区域一般是相对应的,但是并不以此为限。In this way, starting from the first frame of at least two consecutive image frames determined above (ie, the first frame of restricted coding), there is an intra-frame coding frame that can be referred forward, and thus, starting from the second frame, it is possible to use local Forward predictive coding is used for coding. In the above process, the image area of the inter-frame encoding generally corresponds to the image area of the previous frame it refers to, but it is not limited thereto.

本发明实施中,进一步的,帧间编码图像区域进行编码可以参考前一图像帧中的第一局部图像区域和第二局部图像区域。In the implementation of the present invention, further, the encoding of the inter-frame coded image area may refer to the first partial image area and the second partial image area in the previous image frame.

具体的,本发明实施例中,上述确定第一局部区域图像区域和第二局部图像区域的操作,可以包括:Specifically, in the embodiment of the present invention, the above-mentioned operation of determining the first partial image area and the second partial image area may include:

确定上述至少两个连续的图像帧中各个图像帧的受限区域(包含第一局部区域图像区域和第二局部图像区域);其中,第N+1帧比第N帧多一个受限区域,N为大于或等于0的整数;Determine the restricted area (including the first partial image area and the second partial image area) of each image frame in the above-mentioned at least two consecutive image frames; wherein, the N+1th frame has one more restricted area than the Nth frame, N is an integer greater than or equal to 0;

将每个所述图像帧对应的受限区域中的最后一个受限区域(即上述第一局部图像区域)采用帧内编码的方式进行编码,且在存在剩余受限区域(即上述第二局部图像区域)的情况下,将所述剩余受限区域采用帧间编码的方式进行编码,其中,所述帧间编码参考的是前一图像帧中的所有受限区域。Encoding the last restricted area in the restricted area corresponding to each image frame (ie, the above-mentioned first partial image area) by means of intra-frame coding, and when there are remaining restricted areas (ie, the above-mentioned second partial image area) In the case of an image area), the remaining restricted area is encoded by means of inter-frame coding, wherein the inter-frame coding refers to all restricted areas in the previous image frame.

其中,至少两个连续的图像帧中的首个图像帧(即上述当前图像帧)的受限区域的数量可以为1个,首个图像帧的后一图像帧的受限区域的数量可以为2个,以此类推,后续图像帧的受限区域的数量具体可以是依次递增的;关于“前一图像帧”是指本图像帧(所述剩余受限区域所对应的图像帧)的前一帧。Wherein, the number of restricted areas of the first image frame (ie the above-mentioned current image frame) in at least two consecutive image frames can be 1, and the number of restricted areas of the next image frame of the first image frame can be 2, and so on, the quantity of the restricted area of the subsequent image frame can be increased sequentially; about the "previous image frame" refers to the previous image frame (the image frame corresponding to the remaining restricted area) one frame.

这样本方案可以实现块刷新(帧内编码),这种编码方式可以保证编码后的数据能够实现正常显示;此外,对于帧内编码方式可以保证实现数据刷新,保证后续的正常显示;而帧间编码可以保证参考的是刷新后的数据,从而保证后续的正常显示。In this way, this scheme can realize block refresh (intra-frame coding), and this coding method can ensure that the coded data can be displayed normally; in addition, for the intra-frame coding method, data refresh can be guaranteed to ensure subsequent normal display; Encoding can ensure that the reference is the refreshed data, so as to ensure subsequent normal display.

本发明实施例中,是否采用如图1所示的该方法,可以是根据网络质量来确定的。这是由于,网络质量的好坏,一定程度上决定了进行传统IDR编码是否存在如背景技术中所述的问题。In the embodiment of the present invention, whether to use the method shown in FIG. 1 may be determined according to network quality. This is because, to a certain extent, the quality of the network determines whether the problems described in the background art exist in the traditional IDR encoding.

基于上述考虑,在一种实施方式中,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,可以包括:Based on the above considerations, in one embodiment, in response to the received immediate decoding refresh IDR request, determining at least two consecutive image frames from the current group of pictures GOP may include:

响应于所述IDR请求,确定表征网络质量的指标值;In response to the IDR request, determine an index value representing network quality;

根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧。The at least two consecutive image frames are determined from the current GOP according to the index value.

具体的,在确定所述指标值之前,可以响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件(后文将进行说明)。若符合,则确定所述指标值。其中,指标值可以包括rtt(round-trip time,往返时延)的值。Specifically, before determining the index value, in response to the IDR request, it may be determined whether the current image frame meets the condition for determining a restricted image frame (described later). If so, determine the index value. Wherein, the index value may include the value of rtt (round-trip time, round trip delay).

本发明实施例中,在网络质量相对较好的情况下,rtt的值相对较小,可以依据rtt的值确定相对较少数量的需要受限处理的图像帧;在网络质量相对较差的情况下,rtt的值相对较大,可以依据rtt的值确定相对较多数量的需要受限处理的图像帧;从而保证不管网络质量如何,都尽量较好的实现帧刷新;即,由上这样可以依据网络质量确定需要受限处理的图像帧,从而以保证更好的实现帧刷新,并避免卡顿等问题。In the embodiment of the present invention, when the network quality is relatively good, the value of rtt is relatively small, and a relatively small number of image frames requiring limited processing can be determined according to the value of rtt; in the case of relatively poor network quality Next, the value of rtt is relatively large, and a relatively large number of image frames that need to be processed can be determined according to the value of rtt; thereby ensuring that no matter how the network quality is, the frame refresh is as good as possible; that is, by the above, it can be Determine the image frames that need to be processed according to the network quality, so as to ensure better frame refresh and avoid problems such as stuttering.

其中,当前图像帧即上述涉及的第一个图像帧,关于“确定所述指标值”也可理解为获取所述指标值。Wherein, the current image frame is the first image frame mentioned above, and "determining the index value" can also be understood as obtaining the index value.

本发明实施例中,判断当前图像帧是否符合受限图像帧判定条件,包括:根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件。In the embodiment of the present invention, judging whether the current image frame meets the condition for judging the restricted image frame includes: determining whether the current image frame to be encoded meets the restricted image frame according to the arrangement position of the current image frame in the current GOP. Image frame judgment condition.

本发明实施例中,根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件,包括:判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;若是,则确定所述当前图像帧符合所述受限图像帧判定条件;若否,则确定所述当前图像帧不符合所述受限图像判定条件。In the embodiment of the present invention, according to the arrangement position of the current image frame in the current GOP, determining whether the current image frame to be encoded meets the determination condition of the restricted image frame includes: determining whether the current image frame is in the current GOP Whether the arrangement position in the current GOP is relatively front or relatively backward; if so, then determine that the current image frame meets the condition for determining the restricted image frame; if not, then determine that the current image frame does not meet the restricted image frame Limited image judgment conditions.

关于是否相对靠前或相对靠后是指当前图像帧在整个当前GOP中的位置情况是否相对靠前或靠后。例如,当前图像帧在整个当前GOP中的位置为最前,则可认为是相对靠前;或者,当前图像帧在整个当前GOP中的位置为最后,则可认为是相对靠后。About whether it is relatively front or relatively back refers to whether the position of the current image frame in the entire current GOP is relatively front or back. For example, if the current image frame is at the front in the entire current GOP, it may be considered as relatively front; or if the current image frame is at the end in the entire current GOP, it may be considered as relatively behind.

排列位置可通过位置占比来表示,就是根据当前图像帧在当前GOP中的位置情况,确定是否符合上述判定条件。所述位置占比指的是:当前图像帧在当前GOP中的位置排序值(即编号M)和(所述GOP对应的时长T以及帧频fps)之间的比值。The arrangement position can be represented by the position ratio, which is to determine whether the above determination condition is met according to the position of the current image frame in the current GOP. The position ratio refers to the ratio between the position ranking value (namely number M) of the current image frame in the current GOP and (the duration T and frame frequency fps corresponding to the GOP).

具体的,可以是判断排列位置所对应的位置占比是否在预设数值范围内,预设数值范围为0~0.2,或者,0.8~1。也就是,判断排列位置是否在整个GOP的前20%或者后20%。就是针对靠前的帧或者靠后的帧进行特殊处理——这是因为靠前(或靠后)会比较接近上一个(或下一个)画面组的IDR帧,所占带宽大,会导致卡顿,这样特殊处理,可以在一定程度上减低所占带宽,避免卡顿。也可理解为:本发明实施例中,之所以考虑在GOP中前后各取20%进行受限编码,因为太过靠前的帧若作为IDR,出现的问题:刚发了一个IDR,又发一个IDR,就会占用带宽过多。类似地,太过靠后的帧若作为IDR,出现的问题:后一个IDR会受到影响。因此,需要将这两部分帧选出来做受限编码。Specifically, it may be determined whether the position ratio corresponding to the arrangement position is within a preset value range, and the preset value range is 0-0.2, or 0.8-1. That is, it is judged whether the arrangement position is in the top 20% or bottom 20% of the entire GOP. It is to perform special processing on the front frame or the back frame - this is because the front (or back) will be closer to the IDR frame of the previous (or next) picture group, which occupies a large bandwidth and will cause the card Frame, this special treatment can reduce the occupied bandwidth to a certain extent and avoid Frame. It can also be understood as: in the embodiment of the present invention, the reason why it is considered to take 20% before and after the GOP to carry out restricted coding is because if the frame that is too far ahead is used as IDR, the problem that occurs: an IDR has just been sent, and it is sent again. An IDR will take up too much bandwidth. Similarly, if a frame that is too late is used as an IDR, there will be a problem: the latter IDR will be affected. Therefore, it is necessary to select these two parts of frames for restricted coding.

本发明实施例中,上述预设数值范围的两端数值之差的绝对值乘以所述GOP对应的总帧数,大于或等于3帧,但并不以此为限。In the embodiment of the present invention, the absolute value of the difference between the two ends of the preset value range multiplied by the total number of frames corresponding to the GOP is greater than or equal to 3 frames, but it is not limited thereto.

本发明实施例中,所述指标值包括rtt(round-trip time,往返时延)的值;根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:根据所述rtt的值和rtt阈值,确定目标时间窗的大小;根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。In the embodiment of the present invention, the index value includes the value of rtt (round-trip time, round-trip delay); according to the index value, determining the at least two continuous image frames from the current GOP includes: According to the value of the rtt and the rtt threshold value, determine the size of the target time window; according to the size of the target time window, determine from the GOP the number of consecutive image frames that match the size of the target time window, as The at least two consecutive image frames.

这样可以控制实现用最少的帧去实现I帧刷新的效果。rtt阈值大于或等于100ms,且小于或等于300ms,具体可为200ms。In this way, it can be controlled to achieve the effect of refreshing the I frame with the fewest frames. The rtt threshold is greater than or equal to 100ms and less than or equal to 300ms, specifically 200ms.

具体的,在所述rtt值小于或等于所述rtt阈值的情况下,采用第一公式,确定所述目标时间窗的大小(具体可为所对应的帧数量);在所述rtt值大于所述rtt阈值的情况下,采用第二公式,确定所述目标时间窗的大小;其中,所述第一公式为:W=min(3,max(500/rtt,5));所述第二公式为:W=max(3,500/rtt);W表示所述目标时间窗的大小,rtt表示所述rtt的值。第一公式表示取500/rtt和5中的最大值,然后取最大值与3中的最小值;第二公式表示取3和500/rtt中的最大值。Specifically, when the rtt value is less than or equal to the rtt threshold, the first formula is used to determine the size of the target time window (specifically, it may be the corresponding frame number); when the rtt value is greater than the rtt threshold In the case of the rtt threshold, the second formula is used to determine the size of the target time window; wherein, the first formula is: W=min(3,max(500/rtt,5)); the second The formula is: W=max(3,500/rtt); W represents the size of the target time window, and rtt represents the value of the rtt. The first formula means to take the maximum value of 500/rtt and 5, and then take the maximum value and the minimum value of 3; the second formula means to take the maximum value of 3 and 500/rtt.

这样如果rtt≤rtt阈值,则W等于3;若rtt>rtt阈值,则W最小等于3,且在500/rtt大于3的情况下,随着rtt的增大,W在减小;此外,W越小则受限区域越大,W越大则受限区域越小;因此,在一定程度上rtt与W成反比,rtt与受限区域成正比,从而可以实现在网络传输时延大的时候尽量用最少的帧去实现I帧刷新的效果。In this way, if rtt≤rtt threshold, W is equal to 3; if rtt>rtt threshold, W is at least equal to 3, and when 500/rtt is greater than 3, W is decreasing as rtt increases; in addition, W The smaller the value, the larger the restricted area, and the larger the W, the smaller the restricted area; therefore, to a certain extent, rtt is inversely proportional to W, and rtt is proportional to the restricted area, so that when the network transmission delay is large, Try to use the least number of frames to achieve the effect of I frame refresh.

本发明实施例中,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。In the embodiment of the present invention, determining the first partial image area respectively from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames includes: According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area.

这样可以准确的确定每个图像帧的帧内编码图像区域,并且最后完整覆盖单个所述图像帧的整个图像区域。In this way, the intra-coded image area of each image frame can be accurately determined, and finally the entire image area of a single image frame can be completely covered.

具体的,所述第一局部图像区域的高度大小可以为Height/W行,所述Height表示图像帧的高度值,W表示所述目标时间窗的大小;上述涉及的N+1小于或等于W。第二局部图像区域的高度大小也可以为Height/W行。关于第一、第二局部图像区域的宽度大小具体可为图像帧的宽度尺寸。Specifically, the height of the first partial image area may be Height/W lines, the Height represents the height value of the image frame, and W represents the size of the target time window; the N+1 involved above is less than or equal to W . The height of the second partial image area may also be Height/W lines. The width of the first and second partial image areas may specifically be the width of an image frame.

这样可以保证各局部图像区域之间无重叠,从而最大程度的减少帧内编码区域,以降低占宽。In this way, it can be ensured that there is no overlap between the partial image areas, thereby minimizing the intra-frame coding area to reduce the occupied width.

本发明实施例还提供了一种解码方法,如图3所示,包括:The embodiment of the present invention also provides a decoding method, as shown in Figure 3, including:

步骤31:发送即时解码刷新IDR请求;Step 31: Send an instant decoding refresh IDR request;

步骤32:接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。Step 32: Receive the image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request; when the encoding end encodes the at least two continuous image frames, perform: using An intra-frame encoding method, encoding the respective intra-frame coded image regions of the at least two consecutive image frames; the respective intra-frame coded image regions of the at least two consecutive image frames are the at least two consecutive The first partial image area of each image area of the image frame; the positions of the respective intra-coded image areas in the corresponding image area can jointly cover the entire image area of a single image frame.

其中的编码端即编码设备。The encoding end is the encoding device.

本发明实施例提供的所述解码方法通过发送即时解码刷新IDR请求;接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。通过本申请实施例的方案,能够支撑实现在编码端接收到IDR请求后,针对多个图像帧的局部图像区域进行帧内编码以达到完整IDR帧的效果,而不是直接将至少一个图像帧分别编码为完整IDR帧进行传输,这样,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,可以降低图像帧占用的带宽,从而避免引起更多丢包、网络抖动以及图像质量下降等问题;很好的解决了现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。The decoding method provided by the embodiment of the present invention sends an instant decoding refresh IDR request; receives an image frame obtained by encoding at least two consecutive image frames in response to the IDR request at the encoding end; When encoding the at least two consecutive image frames, perform: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame coding method; each of the at least two consecutive image frames The intra-frame coded image area is the first partial image area of the respective image areas of the at least two consecutive image frames; the positions of the respective intra-frame coded image areas in the corresponding image area can jointly cover The entire image area of a single said image frame. Through the solution of the embodiment of the present application, it is possible to support the implementation of intra-frame encoding for partial image areas of multiple image frames after receiving the IDR request at the encoding end to achieve the effect of a complete IDR frame, instead of directly dividing at least one image frame into Encoded into a complete IDR frame for transmission, so that an IDR frame that occupies a large bandwidth is divided into multiple partial intra-frame coding frames that occupy a small bandwidth, which can reduce the bandwidth occupied by the image frame, thereby avoiding more packet loss , network jitter, image quality degradation, and other problems; it solves the problem that the encoding and decoding scheme for IDR requests in the prior art easily causes image quality degradation.

下面对本发明实施例提供的所述编码方法和解码方法进行进一步说明,以下IDR请求以解码端发送为例,编码端以发送端为例,解码端以接收端为例。The encoding method and decoding method provided by the embodiments of the present invention are further described below. The following IDR requests are sent by a decoding end as an example, the encoding end is an example of a sending end, and the decoding end is an example of a receiving end.

针对上述技术问题,本发明实施例提供了一种编码方法和解码方法,具体可实现为一种实时音视频的快速刷新方法,该方法在接收端统计到大量的丢包误码时,向发送端请求快速IDR帧刷新(具体的,向发送端发送IDR请求)。发送端根据预设条件选择2种方式中的一种:一种是编码完整IDR帧;另一种是根据网络情况发送受限P帧或B帧;以此来避免庞大的IDR帧占用带宽,引起更多丢包、网络抖动以及图像质量下降等问题。In view of the above technical problems, the embodiment of the present invention provides an encoding method and a decoding method, which can be implemented as a fast refresh method of real-time audio and video. The end requests a fast IDR frame refresh (specifically, sends an IDR request to the sender). The sender chooses one of the two methods according to the preset conditions: one is to encode a complete IDR frame; the other is to send a restricted P frame or B frame according to the network situation; in order to avoid the bandwidth occupied by huge IDR frames, Causes more packet loss, network jitter, and image quality degradation.

首先,对本发明实施例涉及的内容具体举例介绍如下:First of all, the specific examples of the content involved in the embodiments of the present invention are introduced as follows:

(1)发送端A向接收端B发起音视频通话。(1) The sending end A initiates an audio and video call to the receiving end B.

(2)接收端B接受发送端A的邀请,并建立通信链接。(2) Receiver B accepts the invitation from sender A and establishes a communication link.

(3)发送端A的摄像头采集YUV数据(颜色编码数据),按照视频编码标准编码成ES流(Elementary Stream,基本码流)后,封装成RTP(Real-time Transport Protocol,实时传输协议)包通过RTP-RTCP(Real-time Transport Control Protocol,实时传输控制协议)发送视频数据给接收端B,音频数据按同样的方式处理。(3) The camera at the sending end A collects YUV data (color-coded data), encodes it into an ES stream (Elementary Stream, basic stream) according to the video coding standard, and encapsulates it into an RTP (Real-time Transport Protocol, real-time transport protocol) package The video data is sent to the receiving end B through RTP-RTCP (Real-time Transport Control Protocol), and the audio data is processed in the same way.

(4)接收端B接收到发送端A的音视频流后,进行解码、渲染。同时,接收端B所属设备的发送端也采集YUV数据和麦克风数据等,进行编码压缩、封装,并将流传输给发送端A所属设备的接收端。(4) After the receiver B receives the audio and video stream from the transmitter A, it decodes and renders it. At the same time, the sending end of the device belonging to the receiving end B also collects YUV data and microphone data, etc., encodes, compresses, encapsulates, and transmits the stream to the receiving end of the device belonging to the sending end A.

(5)在网络正常的情况下,以上(3)和(4)会一直执行。但是,假设在移动环境中,接收端B网络突然变差。接收端B发现大量丢包、误码和乱序帧等,导致接收端B解码失败,出现花屏、卡顿等现象,也可以理解为是网络质量较差的状况。接收端B发送IDR请求给发送端A。(5) When the network is normal, the above (3) and (4) will always be executed. However, suppose that in a mobile environment, the receiver B network suddenly goes bad. Receiver B found a large number of packet loss, bit errors, and out-of-sequence frames, which caused receiver B to fail to decode and appear blurred screens and freezes. This can also be understood as a situation of poor network quality. Receiver B sends an IDR request to sender A.

(6)发送端A处理接收端B的IDR请求,可以立即编码当前帧为IDR帧,并发送给接收端B;还可以参见图4所示的处理框架(图4示意的A21编码参考A11,A31和A32编码参考A21和A22,图中的N为大于0的整数),针对在弱网(即网络质量较低)情况下,接收端出现花屏、卡顿、丢包、解码失败等,需要发送端快速刷新,以适应弱网情况。本方案提供了一种稳定有效的刷新机制,即可以快速解决花屏、卡顿,又不会引起网络抖动和更多的丢包,可以大大提升用户体验。具体可如下:(6) The sending end A processes the IDR request of the receiving end B, and can immediately encode the current frame as an IDR frame, and send it to the receiving end B; also refer to the processing framework shown in Figure 4 (the A21 coding shown in Figure 4 refers to A11, A31 and A32 encoding refer to A21 and A22, N in the figure is an integer greater than 0), in the case of a weak network (that is, low network quality), the receiving end has blurred screen, freeze, packet loss, decoding failure, etc., need The sender refreshes quickly to adapt to weak network conditions. This solution provides a stable and effective refresh mechanism, which can quickly solve blurred screens and freezes without causing network jitter and more packet loss, which can greatly improve user experience. The details can be as follows:

(1)发送端A处理接收端B的IDR请求。(1) The sender A processes the IDR request of the receiver B.

在此步骤中,可通过服务器得到当前网络rtt包的值(即上述rtt的值)。或者,也可在以下操作(3)之后,即判断上述当前图像帧符合受限图像帧判定条件时再确定所述rtt的值。In this step, the value of the current network rtt packet (that is, the value of the above-mentioned rtt) can be obtained through the server. Alternatively, the value of rtt may be determined after the following operation (3), that is, when it is judged that the current image frame meets the determination condition of the restricted image frame.

(2)启动网络带宽预估模块和受限参考帧模块。(2) Start the network bandwidth estimation module and the restricted reference frame module.

(3)网络带宽预估模块根据当前帧(当前将要编码和发送的帧,即上述当前图像帧)在整个GOP中的位置(即上述排列位置),以及预设条件,确定当前帧是否进入受限参考帧模块。其中,预设条件为:排列位置对应的位置占比=M/(T×fps)≤0.2,或者位置占比=M/(T×fps)≥0.8;其中,T表示GOP的时长(即上述所述GOP对应的时长),比如为T秒;M表示当前图像帧在GOP中的编号(即上述当前图像帧在所述GOP中的编号);fps表示帧频;若根据上式计算得到的结果小于或等于0.2,或者大于或等于0.8,则进入受限参考帧模块。否则,可以立即编码当前帧为IDR帧,并发送给接收端B。(3) The network bandwidth estimation module determines whether the current frame enters the receiving frame according to the position of the current frame (the frame to be encoded and sent at present, that is, the above-mentioned current image frame) in the entire GOP (that is, the above-mentioned arrangement position) and preset conditions. Only reference frame modules. Among them, the preset condition is: the position ratio corresponding to the arrangement position=M/(T×fps)≤0.2, or the position ratio=M/(T×fps)≥0.8; wherein, T represents the duration of the GOP (that is, the above-mentioned The corresponding duration of the GOP), such as T seconds; M represents the numbering of the current image frame in the GOP (that is, the numbering of the above-mentioned current image frame in the GOP); fps represents the frame rate; if calculated according to the above formula If the result is less than or equal to 0.2, or greater than or equal to 0.8, enter the restricted reference frame module. Otherwise, the current frame can be immediately encoded as an IDR frame and sent to the receiving end B.

这样可以针对靠前的帧或者靠后的帧进行特殊处理;因为靠前(或靠后)会比较接近上一个(或下一个)画面组的较大的IDR帧,所占带宽大,会导致卡顿,这样特殊处理,可以在一定程度上减低所占带宽,避免卡顿。In this way, special processing can be performed on the front frame or the back frame; because the front (or back) will be closer to the larger IDR frame of the previous (or next) picture group, which occupies a large bandwidth and will cause Caton, this special treatment can reduce the occupied bandwidth to a certain extent, and avoid Caton.

本发明实施例中可以是:0.2×T×fps≥3。涉及的GOP是编码器定制的,包含30帧或100帧等。In the embodiment of the present invention, it may be: 0.2×T×fps≧3. The GOP involved is customized by the encoder, containing 30 frames or 100 frames, etc.

(4)受限参考帧模块:根据rtt的值(即上述rtt包的值)确定(受限)参考帧滑动窗口大小W(即上述目标时间窗的大小)。如果rtt≤Tm,则滑动窗口大小为W=min(3,max(500/rtt,5))。其中Tm为一个事先设定的阈值(即上述rtt阈值,具体可大于或等于100ms,且小于或等于300ms),表示延时的时间,一般取200ms。如果rtt>Tm,则滑动窗口大小为W=max(3,500/rtt)。这样可以实现在网络传输时延大的时候尽量用最少的帧去实现I帧刷新的效果:(4) Restricted reference frame module: determine (restricted) the sliding window size W of the reference frame (ie the size of the target time window) according to the value of rtt (ie the value of the above-mentioned rtt packet). If rtt≤Tm, the sliding window size is W=min(3,max(500/rtt,5)). Wherein Tm is a preset threshold (that is, the above-mentioned rtt threshold, which may be greater than or equal to 100ms and less than or equal to 300ms), indicating the delay time, which is generally 200ms. If rtt>Tm, then the sliding window size is W=max(3,500/rtt). In this way, when the network transmission delay is large, the minimum number of frames can be used to achieve the effect of I frame refresh:

因此,如果rtt≤Tm,则W等于3;若rtt>Tm,则W最小等于3,且在500/rtt大于3的情况下,随着rtt的增大,W在减小;此外,W越小则受限区域越大,W越大则受限区域越小。因此,在一定程度上rtt的值与W成反比,rtt的值与受限区域成正比,从而可以实现在网络传输时延大的时候尽量用最少的帧去实现I帧刷新的效果。Therefore, if rtt≤Tm, then W is equal to 3; if rtt>Tm, then W is at least equal to 3, and when 500/rtt is greater than 3, W is decreasing as rtt increases; A smaller value means a larger restricted area, and a larger W means a smaller restricted area. Therefore, to a certain extent, the value of rtt is inversely proportional to W, and the value of rtt is directly proportional to the restricted area, so that when the network transmission delay is large, the effect of I frame refresh can be realized with the fewest frames as possible.

(5)计算滑动窗口内每帧的参考帧(P帧)受限区域(上述图像帧的受限区域的一种具体实现),受限区域的图像高度为(Height/W)行。也可理解为本方案中根据rtt的值确定参考帧受限区域大小。(5) Calculate the reference frame (P frame) restricted area of each frame in the sliding window (a specific implementation of the restricted area of the above-mentioned image frame), and the image height of the restricted area is (Height/W) row. It can also be understood that in this solution, the size of the restricted area of the reference frame is determined according to the value of rtt.

(6)从当前第0帧(即上述当前图像帧)开始到第W-1帧,继续编码为P或B帧(双向预测内插编码帧),以下涉及对受限区域做特殊编码:(6) From the current 0th frame (i.e. the above-mentioned current image frame) to the W-1th frame, continue to be encoded as a P or B frame (bidirectional predictive interpolation encoding frame), the following involves special encoding of the restricted area:

1)第0帧只有一个受限区域,具体为高度从0到(Height/W)行、宽度为图像帧宽度的区域;当前帧此区域编码方式为帧内编码。其他区域正常编码(根据编码需求正常编码)。比如第0帧原本是B帧或P帧,则受限区域以外的区域则依照原本的原则编码为B帧或P帧;其中,P帧属于前向预测的帧间编码,只参考前面最靠近它的I帧或P帧;B帧是双向预测编码帧,以前面的I或P帧和后面的P帧为参考帧进行帧间编码。1) There is only one restricted area in the 0th frame, specifically the area whose height is from 0 to (Height/W) lines and whose width is the width of the image frame; the encoding method of this area in the current frame is intra-frame encoding. Other areas are normally coded (normally coded according to coding requirements). For example, the 0th frame is originally a B frame or a P frame, and the area outside the restricted area is coded as a B frame or a P frame according to the original principle; among them, the P frame belongs to the inter-frame coding of forward prediction, and only refers to the front closest frame. Its I frame or P frame; B frame is a bidirectional predictive coding frame, and inter-frame coding is performed with the previous I or P frame and the following P frame as reference frames.

2)第1帧有2个受限区域,具体为高度从0到(Height/W)行、从(Height/W)到2×(Height/W)行的两个区域,这两个区域的宽度为图像帧宽度的区域。当前帧第一个受限区域采用帧间编码,参考第0帧的第一个受限区域(帧间编码是需要参考前一帧,这里限定参考前一帧的受限区域)。当前帧第二个受限区域采用帧内编码。其他区域正常编码。2) There are two restricted areas in the first frame, specifically two areas with heights from 0 to (Height/W) lines and from (Height/W) to 2×(Height/W) lines. A region whose width is the width of the image frame. The first restricted area of the current frame adopts inter-frame coding, and refers to the first restricted area of the 0th frame (inter-frame coding needs to refer to the previous frame, and here the restricted area referred to in the previous frame is limited). The second restricted area of the current frame is intra-coded. Other regions are coded normally.

3)第2帧有3个受限区域,具体为高度从0到(Height/W)行、从(Height/W)到2×(Height/W)行、从2×(Height/W)行到3×(Height/W)行的三个区域,这三个区域的宽度为图像帧宽度的区域。当前帧的第一、第二受限区采用帧间编码,参考第1帧的第一和第二个受限区域。当前帧的第三个受限区域采用帧内编码。其他区域正常编码。3) There are 3 restricted areas in the second frame, specifically, the height is from 0 to (Height/W) lines, from (Height/W) to 2×(Height/W) lines, and from 2×(Height/W) lines Three areas to 3×(Height/W) lines, the width of these three areas is the area of the image frame width. The first and second restricted areas of the current frame adopt inter-frame coding, referring to the first and second restricted areas of the first frame. The third restricted area of the current frame is intra-coded. Other regions are coded normally.

以此类推,后续第3帧至第W-2帧的受限区域以及编码可参见以上内容进行类似处理;By analogy, the restricted area and encoding of the subsequent frame 3 to frame W-2 can be similarly processed by referring to the above content;

4)第W-1帧有W个受限区域,具体为高度从0到(Height/W)行、从(Height/W)到2×(Height/W)行、从2×(Height/W)行到3×(Height/W)行、···从(W-1)×(Height/W)行到W×(Height/W)行,这W个区域的宽度为图像帧宽度的区域。当前帧的第一、第二···到第W-1个受限区采用帧间编码,参考第W-2帧的第一、第二···到W-1个受限区域。当前帧第W个受限区域采用帧内编码。其他区域正常编码。4) There are W restricted areas in frame W-1, specifically, the height is from 0 to (Height/W) rows, from (Height/W) to 2×(Height/W) rows, from 2×(Height/W) ) line to 3×(Height/W) line, from (W-1)×(Height/W) line to W×(Height/W) line, the width of these W areas is the area of the image frame width . The first, second ... to W-1 restricted areas of the current frame adopt inter-frame coding, and refer to the first, second ... to W-1 restricted areas of the W-2th frame. The W th restricted area of the current frame adopts intra-frame coding. Other regions are coded normally.

这样可以实现块刷新(帧内编码),这种编码方式可以保证编码后的数据能够实现正常显示;对于帧内编码方式可以保证实现数据刷新,保证后续的正常显示;而帧间编码可以保证参考的是刷新后的数据,从而保证后续的正常显示。In this way, block refresh (intra-frame encoding) can be realized. This encoding method can ensure that the encoded data can be displayed normally; for intra-frame encoding, it can ensure data refresh and subsequent normal display; while inter-frame encoding can ensure reference What is displayed is the refreshed data, so as to ensure the subsequent normal display.

5)超过滑动窗口的帧按正常编码。5) Frames beyond the sliding window are coded normally.

由上,本发明实施例提供的方案可以实现:弱网下可以在不引起网络抖动的情况下实现快速刷新;受限参考帧只对特定受限区域进行帧内编码,可以保证弱网时的图像质量更优。From the above, the solution provided by the embodiment of the present invention can realize: under the weak network, fast refresh can be realized without causing network jitter; the restricted reference frame only performs intra-frame encoding on a specific restricted area, which can ensure the weak network. Image quality is better.

本发明实施例还提供了一种编码装置,如图5所示,包括:The embodiment of the present invention also provides an encoding device, as shown in Figure 5, including:

第一确定模块51,用于响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;The first determining module 51 is configured to determine at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request;

第二确定模块52,用于从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;The second determination module 52 is configured to respectively determine the first partial image area from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames; Wherein, the positions of the respective intra-coded image areas in the corresponding image areas can jointly cover the entire image area of a single image frame;

第一编码模块53,用于在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。The first encoding module 53 is configured to, when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding manner.

本发明实施例提供的所述编码装置通过响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码。通过本申请实施例的方案,能够实现在接收到IDR请求后,针对多个图像帧的局部图像区域进行帧内编码以达到完整IDR帧的效果,而不是直接将至少一个图像帧分别编码为完整IDR帧进行传输,这样,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,可以降低图像帧占用的带宽,从而避免引起更多丢包、网络抖动以及图像质量下降等问题,很好的解决了现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。The encoding device provided in the embodiment of the present invention determines at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request; from each of the at least two consecutive image frames In the image area, the first partial image area is respectively determined as the respective intra-frame coded image areas of the at least two consecutive image frames; wherein, the positions of the respective intra-frame coded image areas in the corresponding image areas , which can jointly cover the entire image area of a single image frame; when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area in an intra-frame encoding manner. Through the solution of the embodiment of the present application, after receiving the IDR request, it is possible to perform intra-frame encoding on the partial image areas of multiple image frames to achieve the effect of a complete IDR frame, instead of directly encoding at least one image frame into a complete IDR frame. IDR frames are transmitted. In this way, an IDR frame that occupies a large bandwidth is divided into multiple local intra-frame coding frames that occupy a small bandwidth, which can reduce the bandwidth occupied by image frames, thereby avoiding more packet loss and network jitter. As well as the problem of image quality degradation, it well solves the problem that the codec scheme for IDR request in the prior art easily causes image quality degradation.

进一步的,所述装置还包括:第三确定模块,用于从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;第二编码模块,用于在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。Further, the device further includes: a third determining module, configured to respectively determine the second partial image area from the respective image areas of the specified image frame as the respective inter-frame coded image areas of the specified image frame; The designated image frame is an image frame other than the first image frame in the at least two consecutive image frames; the interframe coded image area of each designated image frame satisfies: the same as the previous one of the designated image frame The intra-coded image areas of the frame image frame are at the same position in the corresponding image area; the second encoding module is used to perform when encoding the specified image frame: adopting a forward predictive encoding method to The inter-coded picture regions are coded.

本发明实施例中,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,包括:响应于所述IDR请求,确定表征网络质量的指标值;根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧。In the embodiment of the present invention, in response to the received immediate decoding refresh IDR request, determining at least two consecutive image frames from the current group of pictures GOP includes: determining an index value representing network quality in response to the IDR request; The at least two consecutive image frames are determined from the current GOP according to the index value.

其中,响应于所述IDR请求,确定表征网络质量的指标值,包括:响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;若符合,则确定所述指标值。Wherein, in response to the IDR request, determining an index value representing network quality includes: in response to the IDR request, judging whether the current image frame meets a condition for judging a restricted image frame; if so, determining the index value.

本发明实施例中,判断当前图像帧是否符合受限图像帧判定条件,包括:根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件。In the embodiment of the present invention, judging whether the current image frame meets the condition for judging the restricted image frame includes: determining whether the current image frame to be encoded meets the restricted image frame according to the arrangement position of the current image frame in the current GOP. Image frame judgment condition.

其中,根据所述当前图像帧在所述当前GOP中的排列位置,确定待编码的当前图像帧是否符合所述受限图像帧判定条件,包括:判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;若是,则确定所述当前图像帧符合所述受限图像帧判定条件;若否,则确定所述当前图像帧不符合所述受限图像判定条件。Wherein, according to the arrangement position of the current image frame in the current GOP, determining whether the current image frame to be encoded meets the determination condition of the restricted image frame includes: determining that the current image frame is in the current GOP Whether the arrangement position is relatively front or relatively back; if so, then determine that the current image frame meets the limited image frame determination condition; if not, then determine that the current image frame does not meet the limited image determination condition .

本发明实施例中,所述指标值包括往返时延rtt的值;根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:根据所述rtt的值和rtt阈值,确定目标时间窗的大小;根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。In the embodiment of the present invention, the index value includes a value of round-trip delay rtt; according to the index value, determining the at least two consecutive image frames from the current GOP includes: according to the value of rtt and The rtt threshold is used to determine the size of the target time window; according to the size of the target time window, determine from the GOP a number of consecutive image frames that match the size of the target time window as the at least two consecutive image frame.

本发明实施例中,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。In the embodiment of the present invention, determining the first partial image area respectively from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames includes: According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area.

其中,上述编码方法的所述实现实施例均适用于该编码装置的实施例中,也能达到相同的技术效果。Wherein, the implementation embodiments of the above encoding method are all applicable to the embodiment of the encoding device, and can also achieve the same technical effect.

本发明实施例还提供了一种解码装置,如图6所示,包括:The embodiment of the present invention also provides a decoding device, as shown in Figure 6, including:

第一发送模块61,用于发送即时解码刷新IDR请求;The first sending module 61 is configured to send an instant decoding refresh IDR request;

第一接收模块62,用于接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;The first receiving module 62 is configured to receive an image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request;

所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, the encoding end performs: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame encoding method;

所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。The respective intra-coded image areas of the at least two consecutive image frames are the first partial image areas of the respective image areas of the at least two consecutive image frames; the respective intra-frame coded image areas are in the corresponding The positions in the image area can collectively cover the entire image area of a single image frame.

本发明实施例提供的所述解码装置通过发送即时解码刷新IDR请求;接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域。通过本申请实施例的方案,能够支撑实现在编码端接收到IDR请求后,针对多个图像帧的局部图像区域进行帧内编码以达到完整IDR帧的效果,而不是直接将至少一个图像帧分别编码为完整IDR帧进行传输,这样,使得一个占带宽较大的IDR帧,分为了多个占带宽较小的局部帧内编码帧,可以降低图像帧占用的带宽,从而避免引起更多丢包、网络抖动以及图像质量下降等问题;很好的解决了现有技术中针对IDR请求的编解码方案易引起图像质量下降的问题。The decoding device provided in the embodiment of the present invention sends an immediate decoding refresh IDR request; receives an image frame obtained by encoding at least two consecutive image frames in response to the IDR request at the encoding end; When encoding the at least two consecutive image frames, perform: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame coding method; each of the at least two consecutive image frames The intra-frame coded image area is the first partial image area of the respective image areas of the at least two consecutive image frames; the positions of the respective intra-frame coded image areas in the corresponding image area can jointly cover The entire image area of a single said image frame. Through the solution of the embodiment of the present application, it is possible to support the implementation of intra-frame encoding for partial image areas of multiple image frames after receiving the IDR request at the encoding end to achieve the effect of a complete IDR frame, instead of directly dividing at least one image frame into Encoded into a complete IDR frame for transmission, so that an IDR frame that occupies a large bandwidth is divided into multiple partial intra-frame coding frames that occupy a small bandwidth, which can reduce the bandwidth occupied by the image frame, thereby avoiding more packet loss , network jitter, image quality degradation, and other problems; it solves the problem that the encoding and decoding scheme for IDR requests in the prior art easily causes image quality degradation.

其中,上述解码方法的所述实现实施例均适用于该解码装置的实施例中,也能达到相同的技术效果。Wherein, the implementation embodiments of the above decoding method are all applicable to the embodiment of the decoding device, and can also achieve the same technical effect.

本发明实施例还提供了一种编码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器执行所述程序时实现上述编码方法。An embodiment of the present invention also provides an encoding device, including a memory, a processor, and a program stored in the memory and operable on the processor; when the processor executes the program, the above encoding method is realized.

其中,上述编码方法的所述实现实施例均适用于该编码设备的实施例中,也能达到相同的技术效果。Wherein, the implementation embodiments of the above encoding method are all applicable to the embodiments of the encoding device, and can also achieve the same technical effect.

本发明实施例还提供了一种解码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器执行所述程序时实现上述解码方法。An embodiment of the present invention also provides a decoding device, including a memory, a processor, and a program stored in the memory and operable on the processor; when the processor executes the program, the above decoding method is implemented.

其中,上述解码方法的所述实现实施例均适用于该解码设备的实施例中,也能达到相同的技术效果。Wherein, the implementation embodiments of the above-mentioned decoding method are all applicable to the embodiment of the decoding device, and can also achieve the same technical effect.

本发明实施例还提供了一种可读存储介质,其上存储有程序,该程序被处理器执行时实现上述编码方法中的步骤;或者,The embodiment of the present invention also provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in the above encoding method are implemented; or,

该程序被处理器执行时实现上述解码方法中的步骤。When the program is executed by the processor, the steps in the above decoding method are realized.

其中,上述编码方法或解码方法的所述实现实施例均适用于该可读存储介质的实施例中,也能达到对应相同的技术效果。Wherein, the implementation embodiments of the above-mentioned encoding method or decoding method are all applicable to the embodiment of the readable storage medium, and can also achieve the corresponding same technical effect.

需要说明的是,此说明书中所描述的许多功能部件都被称为模块,以便更加特别地强调其实现方式的独立性。It should be noted that many functional components described in this specification are called modules, in order to more particularly emphasize the independence of their implementation.

本发明实施例中,模块可以用软件实现,以便由各种类型的处理器执行。举例来说,一个标识的可执行代码模块可以包括计算机指令的一个或多个物理或者逻辑块,举例来说,其可以被构建为对象、过程或函数。尽管如此,所标识模块的可执行代码无需物理地位于一起,而是可以包括存储在不同位里上的不同的指令,当这些指令逻辑上结合在一起时,其构成模块并且实现该模块的规定目的。In the embodiments of the present invention, the modules may be implemented by software so as to be executed by various types of processors. An identified module of executable code may, by way of example, comprise one or more physical or logical blocks of computer instructions which may, for example, be structured as an object, procedure, or function. Notwithstanding, the executable code of an identified module need not be physically located together, but may include distinct instructions stored in different bits which, when logically combined, constitute the module and implement the specified Purpose.

实际上,可执行代码模块可以是单条指令或者是许多条指令,并且甚至可以分布在多个不同的代码段上,分布在不同程序当中,以及跨越多个存储器设备分布。同样地,操作数据可以在模块内被识别,并且可以依照任何适当的形式实现并且被组织在任何适当类型的数据结构内。所述操作数据可以作为单个数据集被收集,或者可以分布在不同位置上(包括在不同存储设备上),并且至少部分地可以仅作为电子信号存在于系统或网络上。Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs and across multiple memory devices. Likewise, operational data may be identified within modules, and may be implemented in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed in different locations (including on different storage devices), and may exist, at least in part, only as electronic signals on a system or network.

在模块可以利用软件实现时,考虑到现有硬件工艺的水平,所以可以以软件实现的模块,在不考虑成本的情况下,本领域技术人员都可以搭建对应的硬件电路来实现对应的功能,所述硬件电路包括常规的超大规模集成(VLSI)电路或者门阵列以及诸如逻辑芯片、晶体管之类的现有半导体或者是其它分立的元件。模块还可以用可编程硬件设备,诸如现场可编程门阵列、可编程阵列逻辑、可编程逻辑设备等实现。When the module can be realized by software, considering the level of the existing hardware technology, the module that can be realized by software, regardless of the cost, those skilled in the art can build the corresponding hardware circuit to realize the corresponding function. The hardware circuit includes conventional very large scale integration (VLSI) circuits or gate arrays as well as existing semiconductors such as logic chips, transistors, or other discrete components. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices, and the like.

以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述原理前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。What has been described above is a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, some improvements and modifications can also be made without departing from the principle of the present invention. These improvements and modifications should also be considered as Be the protection scope of the present invention.

Claims (13)

1.一种编码方法,其特征在于,包括:1. A coding method, characterized in that, comprising: 响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;In response to the received immediate decoding refresh IDR request, from the current group of pictures GOP, determine at least two consecutive image frames; 从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;From the respective image regions of the at least two consecutive image frames, respectively determine the first partial image regions as the respective intra-coded image regions of the at least two consecutive image frames; wherein, the respective intra-frame The position of the coded image area in the corresponding image area can jointly cover the entire image area of a single said image frame; 在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding method; 其中,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,包括:Wherein, in response to the received immediate decoding refresh IDR request, from the current group of pictures GOP, determine at least two consecutive image frames, including: 响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;若符合,则确定表征网络质量的指标值;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame; if so, determine the index value representing the network quality; 根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧;determining the at least two consecutive image frames from the current GOP according to the index value; 其中,判断当前图像帧是否符合受限图像帧判定条件,包括:Wherein, judging whether the current image frame meets the condition for judging the restricted image frame includes: 判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind; 若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame; 若否,则确定所述当前图像帧不符合所述受限图像帧判定条件。If not, it is determined that the current image frame does not meet the condition for judging the limited image frame. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;From the respective image areas of the specified image frames, respectively determine the second partial image areas as the respective interframe coded image areas of the specified image frames; the specified image frame is one of the at least two consecutive image frames Other image frames except the first image frame; the inter-coded image area of each specified image frame satisfies: the image area corresponding to the intra-coded image area of the previous image frame of the specified image frame in the same position; 在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。When encoding the designated image frame, perform: encoding the inter-coded image area by adopting a forward predictive encoding manner. 3.根据权利要求1所述的方法,其特征在于,所述指标值包括往返时延rtt的值;3. The method according to claim 1, wherein the index value comprises the value of round-trip delay rtt; 根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:According to the index value, determining the at least two consecutive image frames from the current GOP includes: 根据所述rtt的值和rtt阈值,确定目标时间窗的大小;Determine the size of the target time window according to the rtt value and the rtt threshold; 根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。According to the size of the target time window, determining a number of consecutive image frames matching the size of the target time window from the GOP as the at least two consecutive image frames. 4.根据权利要求3所述的方法,其特征在于,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:4. The method according to claim 3, characterized in that, from the respective image regions of the at least two consecutive image frames, the first partial image regions are respectively determined as the respective image regions of the at least two consecutive image frames Intra-coded image regions, including: 根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area. 5.一种解码方法,其特征在于,包括:5. A decoding method, characterized in that, comprising: 发送即时解码刷新IDR请求;Send instant decoding refresh IDR request; 接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;receiving an image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request; 所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, the encoding end performs: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame encoding method; 所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;The respective intra-coded image areas of the at least two consecutive image frames are the first partial image areas of the respective image areas of the at least two consecutive image frames; the respective intra-frame coded image areas are in the corresponding The position in the image area can jointly cover the entire image area of a single said image frame; 所述至少两个连续的图像帧,是由所述编码端通过如下方式确定的:The at least two consecutive image frames are determined by the encoding end in the following manner: 响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;若符合,则确定表征网络质量的指标值;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame; if so, determine the index value representing the network quality; 根据所述指标值,从当前GOP中确定所述至少两个连续的图像帧;determining the at least two consecutive image frames from the current GOP according to the index value; 其中,判断当前图像帧是否符合受限图像帧判定条件,包括:Wherein, judging whether the current image frame meets the condition for judging the restricted image frame includes: 判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind; 若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame; 若否,则确定所述当前图像帧不符合所述受限图像帧判定条件。If not, it is determined that the current image frame does not meet the condition for judging the limited image frame. 6.一种编码装置,其特征在于,包括:6. An encoding device, characterized in that it comprises: 第一确定模块,用于响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧;The first determining module is configured to determine at least two consecutive image frames from the current group of pictures GOP in response to the received immediate decoding refresh IDR request; 第二确定模块,用于从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域;其中,所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;The second determination module is configured to respectively determine the first partial image area from the respective image areas of the at least two consecutive image frames as the respective intra-coded image areas of the at least two consecutive image frames; wherein , the positions of the respective intra-coded image areas in the corresponding image areas can jointly cover the entire image area of a single image frame; 第一编码模块,用于在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述帧内编码图像区域进行编码;The first encoding module is configured to, when encoding the at least two consecutive image frames, perform: encoding the intra-frame encoded image area by using an intra-frame encoding method; 其中,响应于接收到的即时解码刷新IDR请求,从当前画面组GOP中,确定至少两个连续的图像帧,包括:Wherein, in response to the received immediate decoding refresh IDR request, from the current group of pictures GOP, determine at least two consecutive image frames, including: 响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;若符合,则确定表征网络质量的指标值;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame; if so, determine the index value representing the network quality; 根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧;determining the at least two consecutive image frames from the current GOP according to the index value; 其中,判断当前图像帧是否符合受限图像帧判定条件,包括:Wherein, judging whether the current image frame meets the condition for judging the restricted image frame includes: 判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind; 若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame; 若否,则确定所述当前图像帧不符合所述受限图像帧判定条件。If not, it is determined that the current image frame does not meet the condition for judging the limited image frame. 7.根据权利要求6所述的装置,其特征在于,所述装置还包括:7. The device according to claim 6, further comprising: 第三确定模块,用于从指定图像帧各自的图像区域中,分别确定第二局部图像区域,作为所述指定图像帧各自的帧间编码图像区域;所述指定图像帧,是所述至少两个连续的图像帧中的除第一个图像帧外的其他图像帧;每个指定图像帧的帧间编码图像区域均满足:与该指定图像帧的前一帧图像帧的所述帧内编码图像区域在对应的图像区域中所处位置相同;The third determination module is used to determine the second partial image area respectively from the respective image areas of the specified image frame as the respective inter-frame coded image areas of the specified image frame; the specified image frame is the at least two other image frames except the first image frame in consecutive image frames; the inter-coded image area of each designated image frame satisfies: The image areas are at the same position in the corresponding image area; 第二编码模块,用于在对所述指定图像帧进行编码时,执行:采用前向预测编码方式,对所述帧间编码图像区域进行编码。The second encoding module is configured to, when encoding the specified image frame, perform: encoding the inter-frame encoded image area by adopting a forward predictive encoding manner. 8.根据权利要求6所述的装置,其特征在于,所述指标值包括往返时延rtt的值;8. The device according to claim 6, wherein the index value comprises a value of round-trip delay rtt; 根据所述指标值,从所述当前GOP中确定所述至少两个连续的图像帧,包括:According to the index value, determining the at least two consecutive image frames from the current GOP includes: 根据所述rtt的值和rtt阈值,确定目标时间窗的大小;Determine the size of the target time window according to the rtt value and the rtt threshold; 根据所述目标时间窗的大小,从所述GOP中确定与所述目标时间窗的大小相匹配的数量的连续图像帧,作为所述至少两个连续的图像帧。According to the size of the target time window, determining a number of consecutive image frames matching the size of the target time window from the GOP as the at least two consecutive image frames. 9.根据权利要求8所述的装置,其特征在于,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域,包括:9. The device according to claim 8, characterized in that, from the respective image regions of the at least two consecutive image frames, the first partial image regions are respectively determined as the respective image regions of the at least two consecutive image frames Intra-coded image regions, including: 根据所述目标时间窗的大小以及所述图像帧的高度值,从所述至少两个连续的图像帧各自的图像区域中,分别确定第一局部图像区域,作为所述至少两个连续的图像帧各自的帧内编码图像区域。According to the size of the target time window and the height value of the image frame, respectively determine a first partial image area from the respective image areas of the at least two consecutive image frames as the at least two consecutive images The frame's respective intra-coded picture area. 10.一种解码装置,其特征在于,包括:10. A decoding device, characterized in that, comprising: 第一发送模块,用于发送即时解码刷新IDR请求;The first sending module is used to send an instant decoding refresh IDR request; 第一接收模块,用于接收由编码端响应于所述IDR请求对至少两个连续的图像帧编码而得到的图像帧;A first receiving module, configured to receive an image frame obtained by encoding at least two consecutive image frames by the encoding end in response to the IDR request; 所述编码端在对所述至少两个连续的图像帧进行编码时,执行:采用帧内编码方式,对所述至少两个连续的图像帧各自的帧内编码图像区域进行编码;When encoding the at least two consecutive image frames, the encoding end performs: encoding the respective intra-coded image areas of the at least two consecutive image frames by using an intra-frame encoding method; 所述至少两个连续的图像帧各自的帧内编码图像区域,是所述至少两个连续的图像帧各自的图像区域的第一局部图像区域;所述各自的帧内编码图像区域在对应的图像区域中所处位置,能够共同覆盖单个所述图像帧的整个图像区域;The respective intra-coded image areas of the at least two consecutive image frames are the first partial image areas of the respective image areas of the at least two consecutive image frames; the respective intra-frame coded image areas are in the corresponding The position in the image area can jointly cover the entire image area of a single said image frame; 所述至少两个连续的图像帧,是由所述编码端通过如下方式确定的:The at least two consecutive image frames are determined by the encoding end in the following manner: 响应于所述IDR请求,判断当前图像帧是否符合受限图像帧判定条件;若符合,则确定表征网络质量的指标值;In response to the IDR request, determine whether the current image frame meets the condition for judging the restricted image frame; if so, determine the index value representing the network quality; 根据所述指标值,从当前GOP中确定所述至少两个连续的图像帧;determining the at least two consecutive image frames from the current GOP according to the index value; 其中,判断当前图像帧是否符合受限图像帧判定条件,包括:Wherein, judging whether the current image frame meets the condition for judging the restricted image frame includes: 判断所述当前图像帧在所述当前GOP中的排列位置是否相对靠前或相对靠后;judging whether the arrangement position of the current image frame in the current GOP is relatively front or relatively behind; 若是,则确定所述当前图像帧符合所述受限图像帧判定条件;If so, then determine that the current image frame meets the condition for judging the restricted image frame; 若否,则确定所述当前图像帧不符合所述受限图像帧判定条件。If not, it is determined that the current image frame does not meet the condition for judging the limited image frame. 11.一种编码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;其特征在于,所述处理器执行所述程序时实现如权利要求1至4中任一项所述的编码方法。11. A coding device, comprising a memory, a processor, and a program stored on the memory and operable on the processor; it is characterized in that, when the processor executes the program, the program according to claims 1 to 1 is realized. The encoding method described in any one of 4. 12.一种解码设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;其特征在于,所述处理器执行所述程序时实现如权利要求5所述的解码方法。12. A decoding device, comprising a memory, a processor, and a program stored on the memory and operable on the processor; it is characterized in that, when the processor executes the program, the program described in claim 5 is implemented. The decoding method described above. 13.一种可读存储介质,其上存储有程序,其特征在于,该程序被处理器执行时实现如权利要求1至4中任一项所述的编码方法中的步骤;或者,该程序被处理器执行时实现如权利要求5所述的解码方法中的步骤。13. A readable storage medium on which a program is stored, characterized in that, when the program is executed by a processor, the steps in the encoding method according to any one of claims 1 to 4 are realized; or, the program When executed by a processor, the steps in the decoding method as claimed in claim 5 are realized.
CN202110325525.2A 2021-03-26 2021-03-26 Encoding and decoding method, device, equipment and readable storage medium Active CN112929667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110325525.2A CN112929667B (en) 2021-03-26 2021-03-26 Encoding and decoding method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110325525.2A CN112929667B (en) 2021-03-26 2021-03-26 Encoding and decoding method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112929667A CN112929667A (en) 2021-06-08
CN112929667B true CN112929667B (en) 2023-04-28

Family

ID=76176183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110325525.2A Active CN112929667B (en) 2021-03-26 2021-03-26 Encoding and decoding method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112929667B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117412053A (en) * 2022-07-08 2024-01-16 中兴通讯股份有限公司 Video encoding method, video encoding device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105163117A (en) * 2015-08-26 2015-12-16 华为技术有限公司 Image coding and processing methods and devices
CN106998328A (en) * 2017-03-30 2017-08-01 北京奇艺世纪科技有限公司 A kind of video transmission method and device
CN110784740A (en) * 2019-11-25 2020-02-11 北京三体云时代科技有限公司 Video processing method, device, server and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11265599B2 (en) * 2019-06-11 2022-03-01 Nvidia Corporation Re-encoding predicted picture frames in live video stream applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105163117A (en) * 2015-08-26 2015-12-16 华为技术有限公司 Image coding and processing methods and devices
CN106998328A (en) * 2017-03-30 2017-08-01 北京奇艺世纪科技有限公司 A kind of video transmission method and device
CN110784740A (en) * 2019-11-25 2020-02-11 北京三体云时代科技有限公司 Video processing method, device, server and readable storage medium

Also Published As

Publication number Publication date
CN112929667A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
WO2016131223A1 (en) Frame loss method for video frame and video sending apparatus
CN107231328B (en) Real-time video transmission method, device, equipment and system
WO2017219896A1 (en) Method and device for transmitting video stream
JP5043096B2 (en) Channel changing method and digital video apparatus
US20100125768A1 (en) Error resilience in video communication by retransmission of packets of designated reference frames
RU2283543C2 (en) Method for processing error code of compressed image during transmission
US10142644B2 (en) Decoding frames
CN111641804A (en) Video data processing method and device, terminal, camera and video conference system
CN111263192A (en) Video processing method and related equipment
US10819976B2 (en) Long-term reference for error recovery without back channel
CN112929667B (en) Encoding and decoding method, device, equipment and readable storage medium
CN113676404A (en) Data transmission method, device, apparatus, storage medium, and program
WO2021057478A1 (en) Video encoding and decoding method and related apparatus
CN110996035B (en) Information sending method and device
WO2020237466A1 (en) Video transmission method and apparatus, and aircraft, playback device, and storage medium
CN112995214B (en) Real-time video transmission system, method and computer readable storage medium
US8270312B2 (en) Communication system, communication method, communication device, and program
JP2008211579A (en) Video equality estimating method and video communication system
US11265583B2 (en) Long-term reference for error recovery in video conferencing system
WO2013071460A1 (en) Reducing amount op data in video encoding
CN112437319A (en) Method for switching multiple video streams based on webrtc
JP2002010265A (en) Transmitting device and its method and receiving device and it method
CN112153413B (en) Method and server for processing screen splash in one-screen broadcast
CN115412763A (en) Video data transmission method, terminal and server
JP2001086153A (en) Data communication equipment, data communication system, data communication method and storage medium

Legal Events

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