Summary of the invention
The present invention provides RS coding redundancy bag distribution method and the transmission equipment of a kind of real-time video transmission,
During using RS coding that real time video data is carried out asymmetric redundancy protecting, by redundancy packet is entered
Row distribution optimization processes, and while ensureing the transmission reliability of real time video data, improves real-time video
The quality of data so that it is there is lower distortion level.
The present invention provides the RS coding redundancy bag distribution method of a kind of real-time video transmission, including:
Generating video sequence, described video sequence includes the Frame of predetermined number, in each Frame
Including fixed-size multiple packets;
According to current network availability bandwidth and video code rate, determine the redundancy distributing to described video sequence
Bag sum;
Data packet number according to each Frame described in described video sequence, described redundancy packet sum and
The Y-PSNR of described each Frame calculates the redundancy packet allocation vector in described video sequence, described
Redundancy packet allocation vector makes the distortion factor minimum of described video sequence, and described redundancy packet allocation vector describes
Distribution condition to described redundancy packet sum;
Use described redundancy packet allocation vector that described video sequence carries out RS based on extended window coding,
And send the video sequence after coding.
The present invention provides a kind of transmission equipment, including:
Generation module, is used for generating video sequence, and described video sequence includes the Frame of predetermined number,
Each Frame includes fixed-size multiple packet;
Determine module, for according to current network availability bandwidth and video code rate, determine described in distributing to
The redundancy packet sum of video sequence;
Computing module, for the data packet number according to each Frame described in described video sequence, institute
The Y-PSNR stating the total and described each Frame of redundancy packet calculates the redundancy packet in described video sequence
Allocation vector, described redundancy packet allocation vector makes the distortion factor minimum of described video sequence, described redundancy packet
Allocation vector describes the distribution condition to described redundancy packet sum;
Coding module, is used for using described redundancy packet allocation vector to carry out described video sequence based on extension
The RS coding of window;
Sending module, the video sequence after sending coding.
The RS coding redundancy bag distribution method of the real-time video transmission that the present invention provides and the equipment of transmission, send
After the terminal of end is arranged on each video sequence generating video data to be sent, current by combining
Network availability bandwidth and video code rate determine the redundancy packet sum distributing to video sequence.And then with video
The minimum constraint of the distortion factor of sequence, according to data packet number, the redundancy of Frame each in video sequence
The Y-PSNR wrapping total and each Frame calculates the redundancy packet allocation vector in video sequence.Right
During video sequence carries out RS based on extended window coding, this redundancy packet allocation vector is used to be retouched
The redundancy packet distribution that the distribution condition to redundancy packet sum stated carries out in cataloged procedure processes, owing to this is superfluous
Remaining bag distribution condition is that the minimum constraint of the distortion factor with above-mentioned video sequence determines and obtains, therefore, and base
The RS coding distributed in this redundancy packet can be greatly improved transmission reliability and the video of real time video data
The quality of data.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
What the RS coding redundancy bag distribution method that Fig. 1 is the embodiment of the present invention one real-time video transmission provided
Flow chart, the described method that the present embodiment provides can be performed by the transmission equipment of video data.Such as figure
Shown in 1, the method includes:
Step 101, generation video sequence, described video sequence includes the Frame of predetermined number, often
Individual Frame includes fixed-size multiple packet.
Specifically, video transmission equipment is when needing the transmission carrying out vedio data content, first
H.264, the vedio data produced is encoded, in the process H.264 encoded and prior art one
Cause, do not repeat.After treating H.264 to encode, enter through the described vedio data H.264 encoded
Row video sequence divides, and obtains each video sequence.Due to similar to the processing procedure of each video sequence,
Therefore, the present embodiment only illustrates as a example by the process to a current video sequence.
In the present embodiment, a video sequence is all frames between two I frames, for realizing real-time
Here the video sequence applied does not includes B frame.Each video sequence comprises 30 two field pictures and i.e. comprises 30
Individual Frame, composition structure is IPPP ... video sequence.Each Frame cutting is fixed size
Packet, to ensure, when network transmits, router subpackage to occur.What deserves to be explained is, each data
The size of the packet comprised in frame is all fixing, is i.e. formed objects, but, each Frame
Size is but unfixed, i.e. each Frame can have different sizes.
Step 102, according to current network availability bandwidth and video code rate, determine and distribute to described video
The redundancy packet sum of sequence.
Owing to the real-time of radio network information channel environment changes, network availability bandwidth the most in the same time is different
, additionally, the also selection on transmission of video code check of different network environments has certain impact, different
Video code rate also has material impact for transmission and the video image quality of video.Therefore, this enforcement
In example, determine the redundancy distributing to current video sequence according to current network availability bandwidth and video code rate
Bag sum.
When implementing, determine according to current network availability bandwidth and video code rate and distribute to current video
The redundancy packet sum of sequence, including:
According to current network availability bandwidth C and video code rate B, determine that the maximum that network can load is superfluous
Remaining rate u is: u=(C-B)/B;
According to described maximum redundancy rate u, determine that the redundancy packet sum R distributing to described video sequence is:Wherein, kgFor the packet comprised in the g Frame in described video sequence
Number.
Step 103, according to the data packet number of each Frame described in described video sequence, described superfluous
The remaining Y-PSNR wrapping total and described each Frame calculates the redundancy packet distribution in described video sequence
Vector, described redundancy packet allocation vector makes the distortion factor minimum of described video sequence, and described redundancy packet is distributed
The vector description distribution condition to described redundancy packet sum.
In the present embodiment, above-mentioned calculated available maximum redundancy bag quantity after, in order to really
Make the redundancy packet method of salary distribution of optimum, it is provided that a kind of minimum constraints of the distortion factor with video sequence
Optimization method.The distortion factor of video sequence by the data packet number of Frame each in video sequence is
The packet of video sequence is distributed, the impact of the Y-PSNR of the total and each Frame of redundancy packet.
The characteristic of the RS coding according to extended window, if a certain Frame can decode, then before it
All Frames the most necessarily can decode.The most there is not the distortion propagation problem between Frame.Every number
The distortion caused when individually be there is frame losing according to the distortion of frame by this Frame is weighed, and criterion used is peak
Value signal to noise ratio.Calculating according to the calculating of Y-PSNR in prior art of the Y-PSNR of Frame is public
Formula calculates.
Under given network bandwidth conditions, in the video of a constant bit rate each video sequence can distribute superfluous
Remaining bag sum is fixing, and these redundancy packet can be assigned arbitrarily each Frame at this video sequence
On.These distribution methods there is a kind of overall distortion factor being capable of above-mentioned video sequence minimize, because of
This, solve the main purpose that the distribution of this optimal redundancy bag is i.e. the present embodiment within the acceptable time.
But the mode that a kind of fairly simple complexity is higher is to travel through whole solution space, therefrom determines optimum
Solve, the optimum redundancy packet method of salary distribution that optimal solution is the most corresponding.
Relative to traveling through whole solution space, the present embodiment proposes the greedy algorithm of a kind of suboptimum and climbs the mountain calculation
Method, makes solution procedure be reduced to linear complexity by exponential complexity.Specifically, by current video sequence
The data packet number of each Frame, the Y-PSNR conduct of the total and each Frame of redundancy packet in row
The input parameter of hill-climbing algorithm, uses hill-climbing algorithm to calculate the redundancy packet allocation vector in video sequence.
Specifically, during calculating, divide according to the redundancy packet that equation below calculates in video sequence
Orientation amount:
Wherein,For the distortion factor of described video sequence,For described redundancy packet allocation vector, andN is the number of the Frame comprised in described video sequence, and γ (n) represents nth
According to the Y-PSNR of frame, P (n) represents the drop probabilities of nth data frame;Wherein, P (n) is according to such as
Lower formula determines:
Wherein, r1Represent the redundancy packet quantity distributing to first Frame;k1Represent in first Frame
The data packet number comprised;rnRepresent the redundancy packet quantity distributing to front n Frame;knRepresent n-th
The data packet number comprised in individual Frame;F(k1+r1, i, p) represent under the network condition that packet loss is p,
At k1+r1In individual bag, packet loss quantity is the probability of i, according to formulaDetermine;For
The equivalent packet loss of each packet in front n-1 Frame, according to formula Determine.
Total redundancy packet quantity is by r1Be added to rnAdd and determine.
In P (n) formula corresponding for above-mentioned n=1, add and the upper limit of part is r1, this is RS coding techniques energy
The condition being enough successfully decoded.To k1Individual source data packet adds r1After individual redundancy packet, if recipient's success
Receive this k1+r1Any k in individual bag1Individual bag or more (are no matter source data packet or redundancy packet all may be used
With), original k just can be successfully decoded out1Individual source data packet.
In P (n) formula of above-mentioned n > 1 correspondence, when the implication of first part F adding sum and n=1 above
Implication be similar to, for: under the network condition that packet loss is p, at all kn+rnPacket loss in individual packet
Quantity is the probability of q.3rd meaning added with part is the 1 total packet arriving n-1 Frame
Number, namely add up kz, so the implication of later F be exactly in 1 to n-1 Frame packet loss quantity be
The probability of m.It is noted that used P here, it is i.e. equivalence packet loss, r1To rn-1Shadow
Ring and be integrated into the inside.Adding with part in the middle of then is to add up all acceptable packet loss quantity,
That meet here is q+m≤rn。
When implementing, hill-climbing algorithm is started from scratch and is added redundancy packet one by one, adds to every time and can make video
On the frame that the sequence entirety distortion factor is minimum, until redundancy packet sum reaches the upper limit.Algorithm logic is as follows:
Simplicity of explanation is: algorithm maintains a redundancy packet allocation vectorAnd be initialized as (0,
0).Each taking turns one redundancy packet of increase, this redundancy packet attempts being added on each Frame also respectively
Calculate corresponding total distortion valueTake the position that total distortion value can be made minimum and place this redundancy packet more
NewlyUntil the total quantity of redundancy packet arrives upper limit R.
Step 104, described redundancy packet allocation vector is used to carry out described video sequence based on extended window
RS coding, and send the video sequence after coding.
Finally, based on optimal redundancy bag allocation vector obtained above, video sequence is carried out based on extension
The RS coding of window, and send the video sequence after coding.Receiving terminal video after receiving this coding
After sequence, carry out RS based on extended window decoding and H.264 decode, i.e. can obtain this video sequence.
In the present embodiment, the terminal of transmitting terminal is arranged on each video sequence generating video data to be sent
Afterwards, by combining current network availability bandwidth and video code rate determines and distributes to the superfluous of video sequence
Remaining bag sum.And then with the minimum constraint of the distortion factor of video sequence, according to data each in video sequence
The Y-PSNR of the total and each Frame of the data packet number of frame, redundancy packet calculates in video sequence
Redundancy packet allocation vector.During video sequence is carried out RS based on extended window coding, use
The distribution condition to redundancy packet sum described by this redundancy packet allocation vector carries out the redundancy in cataloged procedure
Bag distribution processes, owing to this redundancy packet distribution condition is the minimum constraint of the distortion factor with above-mentioned video sequence
Determining and obtain, therefore, the RS coding distributed based on this redundancy packet can be greatly improved real time video data
Transmission reliability and video frequency data quality.
The structural representation sending equipment that Fig. 2 provides for the embodiment of the present invention two, as in figure 2 it is shown, should
Transmission equipment includes:
Generation module 11, is used for generating video sequence, and described video sequence includes the data of predetermined number
Frame, each Frame includes fixed-size multiple packet;
Determine module 12, for according to current network availability bandwidth and video code rate, determine and distribute to institute
State the redundancy packet sum of video sequence;
Computing module 13, for according to the data packet number of each Frame described in described video sequence,
The Y-PSNR of the total and described each Frame of described redundancy packet calculates the redundancy in described video sequence
Bag allocation vector, described redundancy packet allocation vector makes the distortion factor minimum of described video sequence, described redundancy
Bag allocation vector describes the distribution condition to described redundancy packet sum;
Coding module 14, is used for using described redundancy packet allocation vector to carry out described video sequence based on expansion
The RS coding of exhibition window;
Sending module 15, the video sequence after sending coding.
Further, described generation module 11 is additionally operable to:
Produce vedio data, H.264 the described vedio data produced is encoded;
Carry out video sequence division to through the described vedio data H.264 encoded, obtain each video
Sequence.
Further, described determine that module 12 is additionally operable to:
According to current network availability bandwidth C and video code rate B, determine that the maximum that network can load is superfluous
Remaining rate u is: u=(C-B)/B;
According to described maximum redundancy rate u, determine that the redundancy packet sum R distributing to described video sequence is:Wherein, kgFor the packet comprised in the g Frame in described video sequence
Number.
Further, described computing module 13 is additionally operable to:
By the data packet number of each Frame described in described video sequence, described redundancy packet sum and institute
State the Y-PSNR input parameter as hill-climbing algorithm of each Frame, use described hill-climbing algorithm meter
Calculate the redundancy packet allocation vector in described video sequence.
Further, described computing module 13 is additionally operable to:
Redundancy packet allocation vector according in the equation below described video sequence of calculating:
Wherein,For the distortion factor of described video sequence,For described redundancy packet allocation vector, andN is the number of the Frame comprised in described video sequence, and γ (n) represents nth
According to the Y-PSNR of frame, P (n) represents the drop probabilities of nth data frame;Wherein, P (n) is according to such as
Lower formula determines:
Wherein, r1Represent the redundancy packet quantity distributing to first Frame;k1Represent in first Frame
The data packet number comprised;rnRepresent the redundancy packet quantity distributing to front n Frame;knRepresent n-th
The data packet number comprised in individual Frame;F(k1+r1, i, p) represent under the network condition that packet loss is p,
At k1+r1In individual bag, packet loss quantity is the probability of i, according to formulaDetermine;For
The equivalent packet loss of each packet in front n-1 Frame, according to formula Determine.
The transmission equipment of the present embodiment may be used for performing the technical scheme of embodiment of the method shown in Fig. 1, its
Realizing principle similar with technique effect, here is omitted.
One of ordinary skill in the art will appreciate that: realize all or part of step of said method embodiment
Can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer-readable
Taking in storage medium, this program upon execution, performs to include the step of said method embodiment;And it is aforementioned
Storage medium include: the various media that can store program code such as ROM, RAM, magnetic disc or CD.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it
Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area
Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or
Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.