Image encoding method, device, encoding terminal device and storage medium

By monitoring and adjusting FEC encoding parameters, the problem of increased code flow and packet loss rate caused by the increase in the number of redundant packets is solved, and a lower packet loss rate is achieved during image transmission.

CN111954002BActive Publication Date: 2024-10-18XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010744094.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-29
Publication Date
2024-10-18
Estimated Expiration
2040-07-29

AI Technical Summary

Technical Problem

The increase in the number of redundant packets leads to an increase in code flow, thereby increasing the packet loss rate.

Method used

By monitoring the packet loss rate of the source data packets and redundant data packets of the video image, if it exceeds the preset threshold, the FEC encoding parameters are adjusted, including adjusting the number of source data packets and redundant data packets, to reduce the packet loss rate.

Benefits of technology

It effectively reduces the packet loss rate and avoids the increase in code flow caused by the increase in the number of redundant packets, thus optimizing the image transmission process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111954002B_ABST
    Figure CN111954002B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image encoding method, device, encoding end device and storage medium, which relates to the field of image processing technology and can solve the problem that the increase in the number of redundant packets will directly lead to an increase in the code stream, thereby increasing the packet loss rate. The specific technical scheme is: obtaining the current video image and performing forward error correction FEC encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, and the current video image includes at least one frame of video image to be sent; sending the source data packet and the redundant data packet of the current video image to the decoding end device; if it is determined that within a preset time length, the packet loss rate of the source data packet and the redundant data packet of the current video image is greater than a first preset threshold, then adjusting the FEC encoding parameters of the target video image, the target video image is at least one frame of video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets. The present invention is used to reduce the packet loss rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to an image encoding method, apparatus, encoding terminal device and storage medium. Background Art

[0002] Forward Error Correction (FEC) coding technology adds redundant error correction codes to the transmission code sequence. Under certain conditions, it can automatically correct transmission errors through decoding and reduce the bit error rate of the received signal. The basic principle of FEC coding is that the sender generates a certain amount of redundant packets according to the error correction coding algorithm to achieve a certain error correction capability, and the receiver can restore the lost data packets based on the redundant packets based on the error correction decoding algorithm.

[0003] At present, FEC coding technology is also often used in image transmission systems. This solution is simply that the image transmission system includes a transmitter (encoding device) and a receiver (decoding device), and the encoding device sends the encoded bitstream data to the decoding device. After adding FEC coding technology, its implementation principle is as follows: the encoding device encodes at least one frame of video image in the video sequence based on the set coding algorithm, and generates multiple source data packets after encoding; then, the multiple source data packets are grouped together, and a forward error correction coding algorithm is used to generate a preset number of redundant packets corresponding to the multiple source data packets, and the preset number can be taken as small to large as needed; then, the multiple source data packets and the corresponding preset number of redundant packets are combined into an FEC coding group, and the generated FEC coding group is sent to the decoding device, and the decoding device restores the original video image according to the FEC algorithm.

[0004] In order to reduce the bit error rate of the FEC coding group, the number of redundant packets in the FEC coding group is usually increased. However, the increase in the number of redundant packets will directly lead to an increase in the code stream, thereby increasing the packet loss rate. Summary of the invention

[0005] The embodiments of the present disclosure provide an image coding method, apparatus, coding terminal device and storage medium, which can solve the problem that the increase in the number of redundant packets will directly lead to an increase in the bit stream, thereby increasing the packet loss rate. The technical solution is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image encoding method, the method comprising:

[0007] Acquire a current video image and perform forward error correction coding (FEC) on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent;

[0008] Sending the source data packet and redundant data packet of the current video image to a decoding end device;

[0009] If it is determined that within a preset time length, the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold, the FEC encoding parameters of the target video image are adjusted. The target video image is at least one frame of video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets.

[0010] The image encoding method provided by the embodiment of the present disclosure can obtain a current video image and perform forward error correction (FEC) encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent; the source data packet and the redundant data packet of the current video image are sent to a decoding end device; if it is determined that within a preset time length, the packet loss rate of the source data packet and the redundant data packet of the current video image is greater than a first preset threshold, the FEC encoding parameters of the target video image are adjusted, and the target video image is at least one frame of video image to be sent after the current video image. The FEC encoding parameters include the number of source data packets and the number of redundant data packets, and the FEC encoding parameters of the target video image can be adjusted according to the packet loss rate of the source data packet and the redundant data packet of the current video image, thereby effectively reducing the packet loss rate, and can solve the problem that the increase in the number of redundant packets will directly lead to an increase in the code stream, thereby increasing the packet loss rate.

[0011] In one embodiment, adjusting the FEC encoding parameters of the target video image includes:

[0012] If the packet loss rate of the source data packets and redundant data packets of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameters of the target video image are adjusted to the first FEC encoding parameters; wherein the second preset threshold is greater than the first preset threshold.

[0013] By adjusting the FEC encoding parameters of the target video image to the first FEC encoding parameters when the packet loss rates of the source data packets and redundant data packets of the current video image are greater than the first preset threshold and less than or equal to the second preset threshold, the packet loss rate can be effectively reduced.

[0014] In one embodiment, adjusting the FEC encoding parameters of the target video image includes:

[0015] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than the second preset threshold and less than or equal to the third preset threshold, the FEC encoding parameters of the target video image are adjusted to the second FEC encoding parameters; wherein the third preset threshold is greater than the second preset threshold, and the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the first FEC encoding parameters.

[0016] By adjusting the FEC encoding parameters of the target video image to the second FEC encoding parameters when the packet loss rates of the source data packets and redundant data packets of the current video image are greater than the second preset threshold and less than or equal to the third preset threshold, the packet loss rate can be effectively reduced.

[0017] In one embodiment, adjusting the FEC encoding parameters of the target video image includes:

[0018] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a third preset threshold, the FEC encoding parameters of the target video image are adjusted to third FEC encoding parameters; wherein the ratio of the number of source data packets to the number of redundant data packets in the third FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters.

[0019] By adjusting the FEC encoding parameters of the target video image to the third FEC encoding parameters when the packet loss rates of the source data packets and the redundant data packets of the current video image are greater than the third preset threshold, the packet loss rate can be effectively reduced.

[0020] In one embodiment, after adjusting the FEC encoding parameters of the target video image, the method further includes:

[0021] Performing FEC encoding on the target video image according to the FEC encoding parameters to generate a data packet and a redundant data packet of the target video image;

[0022] Sending the data packet and redundant data packet of the target video image to a decoding end device;

[0023] If it is determined that the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than a fourth preset threshold, the number of redundant data packets in the FEC encoding parameters of the target video image is increased by a preset number until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets;

[0024] The target video image is FEC-encoded according to the FEC encoding parameters after the number of redundant data packets is increased, and sent to the decoding end device.

[0025] By increasing the number of redundant data packets in the FEC encoding parameters of the target video image by a preset number when the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold, until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold, the packet loss rate of the source data packets and the redundant data packets of the target video image can be reduced to the fourth preset threshold.

[0026] In one embodiment, the method further comprises:

[0027] If the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold value when the number of redundant data packets in the FEC coding parameters of the target video image is increased to be equal to the number of redundant data packets, then the target FEC coding parameters of the target video image corresponding to the time when the packet loss rate of the source data packets and the redundant data packets of the target video image is minimum are determined;

[0028] The target video image is FEC-encoded according to the target FEC encoding parameters and sent to the decoding end device.

[0029] By determining the target FEC coding parameters of the target video image corresponding to the time when the packet loss rate of the source data packets and redundant data packets of the target video image is minimized, and performing FEC encoding on the target video image according to the target FEC coding parameters and sending the result to the decoding end device, the packet loss rate of the source data packets and redundant data packets of the target video image can be minimized during the transmission process.

[0030] According to a second aspect of an embodiment of the present disclosure, there is provided an image encoding apparatus, including:

[0031] A current video image encoding module, used to obtain a current video image and perform FEC encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent;

[0032] A current video image sending module, used for sending a source data packet and a redundant data packet of the current video image to a decoding end device;

[0033] The FEC encoding parameter adjustment module is used to adjust the FEC encoding parameters of the target video image if it is determined that the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold within a preset time length. The target video image is at least one frame of video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets.

[0034] In one embodiment, the FEC encoding parameter adjustment module is used to:

[0035] If the packet loss rate of the source data packets and redundant data packets of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameters of the target video image are adjusted to the first FEC encoding parameters; wherein the second preset threshold is greater than the first preset threshold.

[0036] In one embodiment, the FEC encoding parameter adjustment module is used to:

[0037] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than the second preset threshold and less than or equal to the third preset threshold, the FEC encoding parameters of the target video image are adjusted to the second FEC encoding parameters; wherein the third preset threshold is greater than the second preset threshold, and the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the first FEC encoding parameters.

[0038] In one embodiment, the FEC encoding parameter adjustment module is used to:

[0039] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a third preset threshold, the FEC encoding parameters of the target video image are adjusted to third FEC encoding parameters; wherein the ratio of the number of source data packets to the number of redundant data packets in the third FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters.

[0040] In one embodiment, the apparatus further comprises:

[0041] A target video image encoding module, used for performing FEC encoding on the target video image according to the FEC encoding parameters to generate a data packet and a redundant data packet of the target video image;

[0042] A target video image sending module, used for sending the data packet and redundant data packet of the target video image to a decoding end device;

[0043] A redundant data packet adding module, for increasing the number of redundant data packets in the FEC encoding parameters of the target video image by a preset number if it is determined that the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than a fourth preset threshold, until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets;

[0044] The target video image encoding module is also used to perform FEC encoding on the target video image according to the FEC encoding parameters after the number of redundant data packets is increased, and send the FEC encoding to the decoding end device.

[0045] In one embodiment, the apparatus further comprises:

[0046] a target FEC encoding parameter determination module, configured to determine the target FEC encoding parameter of the target video image corresponding to the minimum packet loss rate of the source data packets and the redundant data packets of the target video image when the number of redundant data packets in the FEC encoding parameter of the target video image is increased to be equal to the number of redundant data packets and the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold;

[0047] The target video image encoding module is also used to perform FEC encoding on the target video image according to the target FEC encoding parameters and send the encoding to the decoding end device.

[0048] According to a third aspect of an embodiment of the present disclosure, a coding end device is provided, the coding end device comprising a processor and a memory, the memory storing at least one computer instruction, the instruction being loaded by the processor and executing the steps performed in the image coding method described in any one of the first aspects.

[0049] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein at least one computer instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the steps performed in the image encoding method described in any one of the first aspects.

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0052] Figure 1This is a process of an image encoding method provided by an embodiment of the present disclosure. Figure 1 ;

[0053] Figure 2 This is a process of an image encoding method provided by an embodiment of the present disclosure. Figure 2 ;

[0054] Figure 3 is a flow chart of a FEC coding parameter adjustment method provided by an embodiment of the present disclosure;

[0055] Figure 4 is a schematic diagram of a test data table provided by an embodiment of the present disclosure;

[0056] Figure 5 The structure of an image encoding device provided by the embodiment of the present disclosure is Figure 1 ;

[0057] Figure 6 The structure of an image encoding device provided by the embodiment of the present disclosure is Figure 2 ;

[0058] Figure 7 It is a structural diagram of an encoding terminal device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0060] Figure 1 This is a process of an image encoding method provided by an embodiment of the present disclosure. Figure 1 , this method is applied to the encoding end device. Figure 1 As shown, the method includes:

[0061] S101, acquiring a current video image and performing forward error correction (FEC) encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent.

[0062] Exemplarily, the encoding end device acquires a current video image and performs FEC encoding on the current video image to generate a plurality of source data packets of the current video image and a preset number of redundant data packets corresponding thereto.

[0063] S102: Send the source data packet and redundant data packet of the current video image to a decoding end device.

[0064] Exemplarily, after the encoding end device sends multiple source data packets of the current video image and a preset number of redundant data packets corresponding thereto to the decoding end device, the decoding end device receives the source data packets and redundant data packets of the current video image within a preset time length, and sends the received source data packets and redundant data packets of the current video image to the encoding end device.

[0065] S103. If it is determined that within a preset time length, the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold, the FEC encoding parameters of the target video image are adjusted. The target video image is at least one frame of video image to be sent after the current video image. The FEC encoding parameters include the number of source data packets and the number of redundant data packets.

[0066] Exemplarily, the encoding end device receives the source data packet and redundant data packet of the current video image sent by the decoding end device within a preset time length, and determines the number of the source data packet and redundant data packet of the current video image sent by the decoding end device, and then compares it with the number of multiple source data packets of the current video image sent to the decoding end device and the corresponding preset number of redundant packets, and determines the packet loss rate of the source data packet and redundant data packet of the current video image. If the packet loss rate is greater than a first preset threshold, the FEC encoding parameters of the target video image are adjusted, and the target video image is at least one frame of the video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets. In this embodiment, the first preset threshold can be 3% to 8%, for example, the first preset threshold can be 5%.

[0067] The following describes how the encoding end device adjusts the FEC encoding parameters of the target video image.

[0068] In one embodiment, if the packet loss rate of the source data packet and the redundant data packet of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameter of the target video image is adjusted to a first FEC encoding parameter; wherein the second preset threshold is greater than the first preset threshold.

[0069] For example, in this embodiment, the first preset threshold is 5%, the second preset threshold is 8%, and the first FEC encoding parameter includes 20 source data packets and 5 redundant data packets.

[0070] In another embodiment, if the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than the second preset threshold and less than or equal to the third preset threshold, the FEC encoding parameters of the target video image are adjusted to the second FEC encoding parameters; wherein the third preset threshold is greater than the second preset threshold, and the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the first FEC encoding parameters.

[0071] For example, in this embodiment, the third preset threshold is 15%, and the second FEC encoding parameters include 40 source data packets and 16 redundant data packets.

[0072] In another embodiment, if the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a third preset threshold, the FEC encoding parameters of the target video image are adjusted to third FEC encoding parameters; wherein the ratio of the number of source data packets to the number of redundant data packets in the third FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters.

[0073] For example, in this embodiment, the third FEC encoding parameters include 80 source data packets and 40 redundant data packets.

[0074] Exemplarily, after adjusting the FEC encoding parameters of the target video image, the target video image is FEC encoded according to the FEC encoding parameters to generate data packets and redundant data packets of the target video image, and then the data packets and redundant data packets of the target video image are sent to the decoding end device.

[0075] Furthermore, if it is determined that the packet loss rate of the source data packet and the redundant data packet of the target video image is greater than a fourth preset threshold, the number of redundant data packets in the FEC encoding parameters of the target video image is increased by a preset number until the packet loss rate of the source data packet and the redundant data packet of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets. The target video image is then FEC-encoded according to the FEC encoding parameters after the number of redundant data packets is increased and sent to the decoding end device. In this embodiment, the fourth preset threshold can be 0.005% to 0.02%, for example, the fourth preset threshold can be 0.01%. The preset number can be 1.

[0076] For example, after the FEC encoding parameter of the target video image is adjusted to the first FEC encoding parameter, the decoding end device performs FEC encoding on the target video image, generates 20 source data packets and 5 redundant data packets, and then sends the 20 source data packets and 5 redundant data packets of the target video image to the decoding end device. After receiving the source data packets and redundant data packets of the target video image, the decoding end device sends the source data packets and redundant data packets of the target video image to the encoding end device. The encoding end device receives the source data packets and redundant data packets of the target video image sent by the decoding end device and determines the number of the received source data packets and redundant data packets of the target video image sent by the decoding end device, and then compares them with the number of the 20 source data packets and 5 redundant data packets of the target video image sent by the encoding end to the decoding end device. If it is determined that the packet loss rate of the source data packets and redundant data packets of the target video image is greater than 0.01%, the number of the redundant data packets is increased by 1 until the packet loss rate of the source data packets and redundant data packets of the target video image is less than or equal to 0.01%. The target video image is then FEC-encoded according to the FEC encoding parameters after the number of redundant data packets is increased, and sent to the decoding end device.

[0077] For example, when the number of redundant data packets of the target video image increases to 18, the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to 0.01%, then the target video image is FEC encoded to generate 20 source data packets and 18 redundant data packets, and then the 20 source data packets and 18 redundant data packets of the target video image are sent to the decoding end device.

[0078] It should be noted here that if the number of redundant data packets in the FEC coding parameters of the target video image is increased to be equal to the number of redundant data packets, and the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold, then the target FEC coding parameters of the target video image corresponding to the time when the packet loss rate of the source data packets and the redundant data packets of the target video image is the smallest are determined; and then the target video image is FEC-encoded according to the target FEC coding parameters and sent to the decoding end device.

[0079] For example, when the number of redundant data packets of the target video image increases to 20, the packet loss rate of the source data packets and the redundant data packets of the target video image is still greater than 0.01%, and the target FEC encoding parameters of the target video image corresponding to the packet loss rate of the source data packets and the redundant data packets of the target video image are minimum include 20 source data packets and 16 redundant data packets, then the target video image is FEC encoded to generate 20 source data packets and 16 redundant data packets, and then the 20 source data packets and 16 redundant data packets of the target video image are sent to the decoding end device.

[0080] The image encoding method provided by the embodiment of the present disclosure can obtain a current video image and perform forward error correction (FEC) encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent; the source data packet and the redundant data packet of the current video image are sent to a decoding end device; if it is determined that within a preset time length, the packet loss rate of the source data packet and the redundant data packet of the current video image is greater than a first preset threshold, the FEC encoding parameters of the target video image are adjusted, and the target video image is at least one frame of video image to be sent after the current video image. The FEC encoding parameters include the number of source data packets and the number of redundant data packets, and the FEC encoding parameters of the target video image can be adjusted according to the packet loss rate of the source data packet and the redundant data packet of the current video image, thereby effectively reducing the packet loss rate, and can solve the problem that the increase in the number of redundant packets will directly lead to an increase in the code stream, thereby increasing the packet loss rate.

[0081] Combine the following Figure 2 The embodiment further describes the image encoding method provided by the embodiment of the present disclosure in detail. Figure 2 This is a process of an image encoding method provided by an embodiment of the present disclosure. Figure 2 .like Figure 2 As shown, the method includes:

[0082] S201, the encoding end device monitors the current packet loss rate in real time during the image transmission process;

[0083] The image transmission system of this solution uses FEC technology for encoding and transmission, which is a prerequisite.

[0084] In practical applications, there are many methods for calculating the packet loss rate. Here is an exemplary calculation method:

[0085] By counting the amount of data S sent by the encoding device and the amount of data R received by the decoding device over a period of time, the packet loss rate can be calculated as follows:

[0086] (SR) / S.

[0087] S202, determining whether the current packet loss rate is greater than a first preset threshold value, if it is greater than the first preset threshold value, it indicates that the current packet loss rate is large, and the current FEC encoding parameters need to be adjusted; if it is not greater than the first preset threshold value, it indicates that the current packet loss rate is within an acceptable range, and FEC encoding continues to be performed according to the current parameters, and the parameters do not need to be adjusted;

[0088] The first preset threshold in the present invention is set to 5%, that is, the packet loss rate is acceptable when it is within 5%.

[0089] S203: When the current packet loss rate is greater than the first preset threshold, Figure 3 The FEC encoding parameter adjustment method shown adjusts the FEC encoding parameters.

[0090] Figure 3 FIG. 1 is a flow chart of a method for adjusting FEC encoding parameters provided by an embodiment of the present disclosure. Figure 3 As shown, the method includes:

[0091] S301, determining to which packet loss rate interval the current packet loss rate value belongs;

[0092] Before this step, a mapping table of packet loss rate and preferred FEC encoding parameters needs to be preset, which lists the preferred FEC encoding parameters corresponding to different packet loss rate intervals. The table is manually generated and saved in the database. An exemplary mapping table can be referred to the following table:

[0093] Packet loss rate range Optimize FEC encoding parameters [3%,8%) 20+5 [8%,15%) 40+16 [15%,100%] 80+40

[0094] Table 1

[0095] It should be noted that, generally speaking, the packet loss rate rarely exceeds 20%.

[0096] The preferred FEC mentioned above is the preferred parameter determined after actual testing and verification of the current image transmission system. The test data table obtained by the inventor after verification in actual testing is as follows: Figure 4 After having the above mapping table, the currently determined packet loss rate is compared to which packet loss rate interval in the above mapping table it belongs to. For example, if the real-time packet loss rate is 5%, it is determined to belong to the interval [3%, 8%); for another example, if the real-time packet loss rate is 12%, it is determined to belong to the interval [8%, 15%), and so on.

[0097] S302: After determining to which packet loss rate interval the current packet loss rate belongs, determine the current preferred FEC coding parameter, and adjust the current FEC coding parameter to the preferred FEC coding parameter;

[0098] S303, after adjusting the FEC encoding parameters, monitor whether the packet loss rate within a period of time is reduced to less than a second preset threshold (for example, 0.01%), if not, it is necessary to dynamically adjust the current FEC encoding parameters until the packet loss rate is reduced to less than or equal to the second preset threshold (0.01%);

[0099] Specifically, the dynamic adjustment method is as follows:

[0100] The number of redundant bits is increased according to the preset step value. Assuming that the FEC coding parameter is a+b, that is, the value of b is increased, and each time it is increased by a fixed step value of 1 or 2, and b cannot be greater than a. During the increase process, the change of the packet loss rate is continuously monitored. If the packet loss rate is less than or equal to 0.01%, the adjustment is stopped, otherwise the increase is continued until the packet loss rate is less than or equal to the second preset threshold of 0. Generally, in the process of adjusting in this way, the packet loss rate can be adjusted to below 0.01%. When it is adjusted to below 0.01%, the current FEC coding parameter is recorded, and this FEC coding parameter is used as the current optimal FEC coding parameter, and the FEC coding parameter is no longer adjusted, unless the packet loss rate is greater than the first preset threshold again, then the process is repeated according to step S203.

[0101] If the following special situation occurs: during the adjustment process, the packet loss rate is always greater than 0.01%, it is handled as follows: determine the packet loss rates corresponding to the transmission of various FEC coding parameters during the adjustment process; compare and obtain the FEC coding parameter corresponding to the minimum packet loss rate, determine this parameter as the current optimal FEC coding parameter, and no longer adjust the FEC coding parameter, unless the packet loss rate is greater than the first preset threshold again, then re-process according to step S203.

[0102] Based on the image encoding method described in the above corresponding embodiments, the following is an embodiment of the device disclosed herein, which can be used to execute the embodiment of the method disclosed herein. Figure 5 The structure of an image encoding device provided by the embodiment of the present disclosure is Figure 1 .like Figure 5 As shown, the device 50 comprises:

[0103] The current video image encoding module 501 is used to obtain the current video image and perform FEC encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent;

[0104] The current video image sending module 502 is used to send the source data packet and the redundant data packet of the current video image to the decoding end device;

[0105] The FEC encoding parameter adjustment module 503 is used to adjust the FEC encoding parameters of the target video image if it is determined that the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold within a preset time length. The target video image is at least one frame of video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets.

[0106] In one embodiment, the FEC encoding parameter adjustment module 503 is used to:

[0107] If the packet loss rate of the source data packets and redundant data packets of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameters of the target video image are adjusted to the first FEC encoding parameters; wherein the second preset threshold is greater than the first preset threshold.

[0108] In one embodiment, the FEC encoding parameter adjustment module 503 is used to:

[0109] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than the second preset threshold and less than or equal to the third preset threshold, the FEC encoding parameters of the target video image are adjusted to the second FEC encoding parameters; wherein the third preset threshold is greater than the second preset threshold, and the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the first FEC encoding parameters.

[0110] In one embodiment, the FEC encoding parameter adjustment module 503 is used to:

[0111] If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a third preset threshold, the FEC encoding parameters of the target video image are adjusted to third FEC encoding parameters; wherein the ratio of the number of source data packets to the number of redundant data packets in the third FEC encoding parameters is greater than the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters.

[0112] In one embodiment, Figure 6 As shown, the device 50 also includes:

[0113] The target video image encoding module 504 is used to perform FEC encoding on the target video image according to the FEC encoding parameters to generate a data packet and a redundant data packet of the target video image;

[0114] The target video image sending module 505 is used to send the data packet and redundant data packet of the target video image to the decoding end device;

[0115] A redundant data packet adding module 506 is used to increase the number of redundant data packets in the FEC coding parameters of the target video image by a preset number if it is determined that the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than a fourth preset threshold, until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets;

[0116] The target video image encoding module 504 is also used to perform FEC encoding on the target video image according to the FEC encoding parameters after the number of redundant data packets is increased, and send the FEC encoding to the decoding end device.

[0117] In one embodiment, the apparatus further comprises:

[0118] A target FEC coding parameter determination module 507 is used to determine the target FEC coding parameter of the target video image corresponding to the minimum packet loss rate of the source data packets and the redundant data packets of the target video image when the number of redundant data packets in the FEC coding parameter of the target video image is increased to be equal to the number of redundant data packets and the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold;

[0119] The target video image encoding module 504 is further configured to perform FEC encoding on the target video image according to the target FEC encoding parameters and send the encoding to the decoding end device.

[0120] The image encoding device provided in the embodiment of the present disclosure, its implementation process and technical effects can be seen in the above Figures 1 to 4 The embodiments are not described in detail here.

[0121] Figure 7 A structural diagram of an encoding terminal device provided in an embodiment of the present disclosure, such as Figure 7 As shown, the encoding end device 70 includes:

[0122] A processor 701 and a memory 702 , wherein the memory 702 stores at least one computer instruction, and the instruction is loaded and executed by the processor 701 to implement the image encoding method described in the above method embodiment.

[0123] Based on the above Figures 1 to 4 In accordance with the image encoding method described in the embodiment, the embodiment of the present disclosure further provides a computer-readable storage medium, for example, a non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The storage medium stores computer instructions for executing the above Figures 1 to 4 The image encoding method described in the corresponding embodiment will not be repeated here.

[0124] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0125] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

Claims

1. An image coding method, characterized in that: The method comprises: Acquire a current video image and perform forward error correction (FEC) encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent; Sending the source data packet and redundant data packet of the current video image to a decoding end device; If it is determined that within a preset time period, the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold, then adjusting the FEC encoding parameters of the target video image, the target video image being at least one frame of the video image to be sent after the current video image, and the FEC encoding parameters including the number of source data packets and the number of redundant data packets; After adjusting the FEC encoding parameters of the target video image, the method further includes: Performing FEC encoding on the target video image according to the FEC encoding parameters to generate a data packet and a redundant data packet of the target video image; Sending the data packet and redundant data packet of the target video image to a decoding end device; If it is determined that the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than a fourth preset threshold, the number of redundant data packets in the FEC encoding parameters of the target video image is increased by a preset number until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets; Performing FEC encoding on the target video image according to the FEC encoding parameters after the number of redundant data packets is increased and sending the result to the decoding end device; If the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold value when the number of redundant data packets in the FEC coding parameters of the target video image is increased to be equal to the number of source data packets, then the target FEC coding parameters of the target video image corresponding to the minimum packet loss rate of the source data packets and the redundant data packets of the target video image are determined; The target video image is FEC-encoded according to the target FEC encoding parameters and sent to the decoding end device.

2. The method according to claim 1, characterized in that: The FEC encoding parameters of the target video image are adjusted as follows: If the packet loss rate of the source data packets and redundant data packets of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameters of the target video image are adjusted to the first FEC encoding parameters; wherein the second preset threshold is greater than the first preset threshold.

3. The method according to claim 2, characterized in that The FEC encoding parameters of the target video image are adjusted as follows: If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than the second preset threshold and less than or equal to the third preset threshold, the FEC encoding parameters of the target video image are adjusted to the second FEC encoding parameters; wherein the third preset threshold is greater than the second preset threshold, and the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters is less than the ratio of the number of source data packets to the number of redundant data packets in the first FEC encoding parameters.

4. The method according to claim 3, characterized in that The FEC encoding parameters of the target video image are adjusted as follows: If the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a third preset threshold, the FEC encoding parameters of the target video image are adjusted to third FEC encoding parameters; wherein the ratio of the number of source data packets to the number of redundant data packets in the third FEC encoding parameters is smaller than the ratio of the number of source data packets to the number of redundant data packets in the second FEC encoding parameters.

5. An image encoding device, characterized in that: include: A current video image encoding module, used to obtain a current video image and perform FEC encoding on the current video image to generate a source data packet and a redundant data packet of the current video image, wherein the current video image includes at least one frame of video image to be sent; A current video image sending module, used for sending a source data packet and a redundant data packet of the current video image to a decoding end device; An FEC encoding parameter adjustment module, configured to adjust the FEC encoding parameters of a target video image if it is determined that within a preset time period, the packet loss rate of the source data packets and the redundant data packets of the current video image is greater than a first preset threshold, wherein the target video image is at least one frame of a video image to be sent after the current video image, and the FEC encoding parameters include the number of source data packets and the number of redundant data packets; A target video image encoding module, used for performing FEC encoding on the target video image according to the FEC encoding parameters to generate a data packet and a redundant data packet of the target video image; A target video image sending module, used for sending the data packet and redundant data packet of the target video image to a decoding end device; A redundant data packet adding module, for increasing the number of redundant data packets in the FEC encoding parameters of the target video image by a preset number if it is determined that the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than a fourth preset threshold, until the packet loss rate of the source data packets and the redundant data packets of the target video image is less than or equal to the fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold and the number of redundant data packets after the increase is less than or equal to the number of source data packets; The target video image encoding module is also used to perform FEC encoding on the target video image according to the FEC encoding parameters after the number of redundant data packets is increased and send the FEC encoding to the decoding end device; a target FEC encoding parameter determination module, configured to determine the target FEC encoding parameters of the target video image corresponding to the minimum packet loss rate of the source data packets and the redundant data packets of the target video image when the number of redundant data packets in the FEC encoding parameters of the target video image is increased to be equal to the number of source data packets, and the packet loss rate of the source data packets and the redundant data packets of the target video image is greater than the fourth preset threshold; The target video image encoding module is also used to perform FEC encoding on the target video image according to the target FEC encoding parameters and send the encoding to the decoding end device.

6. The device according to claim 5, characterized in that The FEC encoding parameter adjustment module is used for: If the packet loss rate of the source data packets and redundant data packets of the current video image is greater than a first preset threshold and less than or equal to a second preset threshold, the FEC encoding parameters of the target video image are adjusted to the first FEC encoding parameters; wherein the second preset threshold is greater than the first preset threshold.

7. A coding end device, characterized in that: The encoding end device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the instruction is loaded and executed by the processor to implement the steps performed in the image encoding method according to any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that: The storage medium stores at least one computer instruction, which is loaded and executed by a processor to implement the steps performed in the image encoding method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Real-time multicasting self-adaptation optimization method based on unequal error protection

    CN102546096A

  • Unequal error transmission protection method based on H.264 video message type

    CN106303539A

  • Anti-packet loss method, device and system in real-time communication

    CN107196746A

  • Data transmission method and device

    CN111385055A

  • Data distribution method, repeating system, and computer program

    JP2005065100A