Dispatching method based on the low time delay multimedia transmission coding/decoding of time-division processing
Technical field
The present invention relates to a kind of low time delay multimedia transmission coding/decoding dispatching method, belong to the encoding and decoding processing technology field in the multimedia transmission based on time-division processing.
Background technology
21 century will be the century of information industry sustained and rapid development, and the mankind have entered the age of Internet economy.Rapid development of network technology makes that utilizing group technology to come transmitting multimedia to become may and come true.Tradition mechanics of communication and group technology convergence are more and more obvious, because the Media Stream coded system of transmitting in traditional communication network and the modern packet communications network is different, therefore the binding site at legacy network and packet network need carry out the conversion of media stream code/decode mode.Because the existence of codec can be introduced encoding and decoding time delay and scheduling time delay, the existence meeting of this time delay impacts the quality of media flow transmission, particularly aspect voice, big time-delay is that both call sides is unacceptable, so encoding and decoding time delay size becomes a key factor weighing network quality.
Network both sides code encoding/decoding mode does not just need encoding and decoding conversion simultaneously.With the voice transfer is example, and in the gateway of fixed-line telephone network IP phone, the encoding and decoding conversion device is in circuit domain and the packet domain place that combines.In the legacy circuit-switched circuit, what transmit generally is to modulate code stream through the real-time pulse of A rule or the compression of U rule, and its transmission rate is 64k bps, if not encoded, directly be translated into packet data transmission and need take very big bandwidth, this is very uneconomic.Between circuit domain and IP packet domain, increase the encoding and decoding speech function for this reason, pulse modulated speech data is compressed into the very little compress coding data of occupied bandwidth transmits again.G.729 the encoding and decoding conversion device generally should support ITU-T, G.723.1, ITU-T waits voice compression algorithm, when being connected, generally should support the code decode algorithms such as AMR of GSM-FR, GSM-HR and 3G, when multimedia transmission, also need to support image processing algorithm with wireless network.Insert density in order to improve circuit, each encoding and decoding conversion device can be handled the encoding and decoding of many circuits usually, and each bar circuit is called a passage.
For the packetizing process of every kind of encoding and decoding agreement, every kind of code encoding/decoding mode all has the frame sign and the frame format of regulation.For example for ITU-T encryption algorithm G.729, be to be transferred to the packet network side after speech data with every 10ms length compresses; For ITU-T encryption algorithm G.723.1, be to be transferred to the packet network side after speech data with every 30ms length compresses.Unipath speech is generally: frame data of receiving specific length earlier from the circuit domain side joint, then these frame data are carried out encoding process, after processing finishes coded data is sent to network side, definition is called the coding time delay from the time delay that begins to receive frame data and send to the packet network side behind this frame data coding usually.
For the coding of multipath, adopt the method for batch process usually; The framing of supposing coded data is spaced apart T, then will accomplish real-time data processing, and the time of handling all N passage should be smaller or equal to T, i.e. the data of all passages of framing before T handled in the time.Suppose that ideally the time of handling all N passage just in time equals T, then concrete batch processing method is as follows:
1) from data flow,, intercepts first frame data by being fixed into frame time T by N passage input;
2) to first frame data of N passage obtaining, carry out encoding process one by one by passage;
3) data after the encoding process are sent to the packet switching network side.
4) repeat above step.
The framing of batch process and processing scheduling sequential are as shown in Figure 1.As can be seen from Figure 1, initial 0 constantly before T in the time all N channel data enter encoder, all intercept at first frame data of 0 constantly all N passage and to finish, in ensuing 0 to the moment of T, the data of all N passage are encoded, constantly data are sent to packet network at T then, arrive to finish from first data and be sent to the packet network side and need the 2T time, so the coding staff of passage is 2T to processing delay up to this data processing.Figure 2 shows that the processing scheduling sequential chart of general multichannel batch decoding in the prior art.
The method of above batch process, its advantage are to adopt identical timing framing and encoding and decoding to handle to all passages, clear process, and task scheduling is simple, therefore uses more.
But its shortcoming is that the encoding and decoding maximum delay of passage is bigger, with the G723 coding method is example, form frame data and need 30ms, so T=30ms, when adopting batch processing method, coding staff to the time delay of processing be 30+T=60ms, add a time delay 7.5ms that fixedly looks ahead (referring to the ITUTG729 agreement) by the algorithm decision, coding staff to overall delay be 67.5ms, this time delay is still bigger as can be seen, especially in voice transfer, postpone a meeting or conference when big and greatly reduce voice call quality.
Summary of the invention
The objective of the invention is at the shortcoming that exists in the prior art, a kind of low time delay multimedia transmission coding/decoding dispatching method based on time-division processing is proposed, scheme to the multichannel batch process is improved, and to reduce the scheduler latency of encoding and decoding, improves multimedia transmission quality.
The low time delay multimedia transmission coding/decoding dispatching method based on time-division processing that the present invention proposes may further comprise the steps:
1, will encode or decode time T is divided into K timeslice, each timeslice is T/K, and handling the overall channel number is N, with a kind of algorithm with N channel allocation in K timeslice, the port number of the interior processing of each timeslice is N/K, wherein K=1,2 ... K;
2, by time slot sequence the data of each passage input are encoded or decoding processing, the data output after handling.
What the present invention proposed based on the low time delay multimedia transmission coding of time-division processing or the characteristics and the effect of decoding scheduling method is, the maximum coding or the decoding processing time T that allow are divided into K timeslice, each timeslice size is T/K, if the largest passages number of handling still is N, then the port number of handling in each timeslice is N/K, so just will encode originally or interior N the passage of handling of decoding processing time T, be assigned in the little timeslice, thereby reduced channel time delay, the K value is big more, be that timeslice is short more, then the time delay of Jian Shaoing is many more.And from the inventive method as can be seen, the largest passages that coding or decoder can be handled is counted N, relevant with the disposal ability of coding or decoder, but have nothing to do with the coding of passage or the time delay of decoding direction, therefore to reduce time delay, as long as maximum coding or decoding processing time T are divided into a plurality of timeslices.
Description of drawings
Fig. 1 is a general multichannel batch coded scheduling schematic flow sheet in the prior art.
Fig. 2 is a general multichannel batch decoding scheduling flow schematic diagram in the prior art.
Fig. 3 is the time-division processing coded scheduling schematic flow sheet that the present invention proposes.
Fig. 4 is the time-division processing decoding scheduling schematic flow sheet that the present invention proposes.
Embodiment
Low time delay multimedia transmission coding or decoding scheduling method that the present invention proposes based on time-division processing, its process is at first will encode or decode time T is divided into K timeslice, each timeslice is T/K, if handling the overall channel number is N, with a kind of algorithm N channel allocation arrived in K the timeslice, then the port number of handling in each timeslice is N/K, K=1 wherein, 2, K, i.e. first group of 1~N/K passage handling in first 0~(T/K) time of timeslice, second timeslice T/K~2T/K handles second group of (N/K)+1~2N/K passage, to the last, K timeslice handle K group (K-1) (N/K)+1~N passage; Zero hour of first timeslice that begins an encoding and decoding period T then, will be by the data of first group of 1~N/K passage input, in 0~(T/K) time of this timeslice,, handle one by one by passage to first frame data of N/K passage of input; (T/K) that finish in timeslice constantly, with the data output after handling.The rest may be inferred, up to K timeslice, handles all N passages of K group, enters the next processing cycle then.
To be encoded to example, it handles sequential as shown in Figure 3, as seen from Figure 3, passage 1 is assigned in first timeslice T/K to passage N/K and handles, passage (N/K)+1~2N/K is assigned in second timeslice T/K~2T/K and handles, and the like, (K-1) * (N/K)+1 passage~N passage is assigned to interior processing of T/K time of K timeslice (K-1) T/K~T.In 0 moment, will press frameing time T by the data flow of 1~N/K passage input, intercept first frame data; In 0~(T/K) time,, encode one by one by passage to first frame data of N/K passage of intercepting; At (T/K) constantly, the data behind the coding are sent to the packet network side, and will press frameing time T by the data flow of (N/K)+1~2 (N/K) passage input, first frame data of N/K passage of intercepting; At T/K~2 (T/K) in the time, first frame data of N/K passage of intercepting are encoded one by one by passage, and at 2 (T/K) constantly, the data after encoding are sent to the packet network side; The rest may be inferred, at (K-1) * T/K constantly, and with the data flow of a last N/K passage, press frameing time T, intercept first frame data, and at K timeslice T-T/K~T in the time, encode one by one by passage, and the data after T will encode constantly send to the packet network side; Repeat above process, each frame data after handling.
Below as can be seen, first frame data that first timeslice is handled, the coding staff of passage to processing delay be T+T/K.(first frame data of (N/K)+1~2N/K), the processing delay of the encoding and decoding direction of passage still are T+T/K to the passage of second timeslice processing.And the like as can be seen, the coding staff of all passages to processing delay all be T+T/K, the 2T of time delay during than batch process reduced T-T/K, reached the purpose that reduces channel coding direction time delay, the time delay of the big more minimizing of K value is many more.The N that mentions among the present invention is the largest passages number that codec can be handled, and it is relevant with the disposal ability of codec, the coding staff that does not influence passage to time delay.
Being decoded as example, it handles sequential as shown in Figure 4, and as seen from Figure 4, decode time T is divided into K timeslice, and each timeslice is T/K, and the port number of processing is N/K in each timeslice, wherein K=1,2 ... K, N are the overall channel number.In 0 moment, input is by the first frame coded data of 1~N/K passage; At 0~T/K in the time,, decode one by one by passage with the first frame coded data of N/K passage of input; At T/K constantly, decoded data are sent to the circuit-switched network side, simultaneously the first frame coded data of input (N/K)+1~2N/K passage; At T/K~2T/K in the time, with the first frame coded data of N/K passage of input, decode one by one by passage, in the 2T/K moment, decoded data are sent to the circuit-switched network side; The rest may be inferred, at (K-1) * T/K~T in the time, with the first frame coded data of last N/K passage of input, decodes one by one by passage, in the T moment, decoded data sent to the circuit-switched network side; Repeat above process, handle each later frame data.
Introduce two embodiment of the present invention below:
First embodiment of the present invention is, with ITU-T G723.1 decoding method, form frame data, need 30ms, so T=30ms, the time-division processing method adopted, T is divided into 6 timeslices, each timeslice is T/K=5ms, and the codec handling way is N=60, handles 10 passages in each 5ms timeslice.Therefore the encoding and decoding direction processing delay that obtains is 30+T/K=35ms, add a time delay 7.5ms that fixedly looks ahead (referring to ITU-T G723.1 agreement) by the algorithm decision, the overall delay of encoding and decoding direction is 35+7.5=42.5ms, 67.5ms when this time delay is than batch process as can be seen reduces 25ms, the time delay of encoding and decoding direction has bigger reduction, can also further reduce time delay by increasing the number of timeslice K simultaneously.
An alternative embodiment of the invention is, use the AMR code decode algorithm, frameing time is T=20ms, T is divided into 4 timeslices, each timeslice is T/K=5ms, codec handling way N=40, handle N/K=10 path in each timeslice, because the time delay of fixedly looking ahead of AMR algorithm is 5ms, therefore the overall delay that obtains system's encoding and decoding direction is T+T/K+5=30ms, and the overall delay of system's encoding and decoding direction is not T+T+5=45ms when not adopting dispatching method of the present invention, and the time delay of AMR encoding and decoding direction has reduced 45-30=15ms as can be seen.This application has proved that this dispatching method can reduce the time delay of system's encoding and decoding direction.
The low time delay multimedia transmission coding/decoding dispatching method based on time-division processing that the present invention proposes can be respectively applied for coded scheduling or decoding scheduling, or is used for the coding and decoding scheduling simultaneously.
Method of the present invention can be applied to the encoding and decoding of encoding and decoding speech, image processing and other kind media stream.