WO2016000448A1 - 数据帧的处理方法和装置 - Google Patents

数据帧的处理方法和装置 Download PDF

Info

Publication number
WO2016000448A1
WO2016000448A1 PCT/CN2015/071635 CN2015071635W WO2016000448A1 WO 2016000448 A1 WO2016000448 A1 WO 2016000448A1 CN 2015071635 W CN2015071635 W CN 2015071635W WO 2016000448 A1 WO2016000448 A1 WO 2016000448A1
Authority
WO
WIPO (PCT)
Prior art keywords
length
data
duration
adjustment
data frame
Prior art date
Application number
PCT/CN2015/071635
Other languages
English (en)
French (fr)
Inventor
张兴涛
刘泽新
苗磊
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016000448A1 publication Critical patent/WO2016000448A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/24Accounting or billing

Definitions

  • the embodiments of the present invention relate to communication technologies, and in particular, to a method and an apparatus for processing a data frame.
  • VoIP Voice over Internet Protocol
  • packet jitter is generated during transmission.
  • packet loss occurs, resulting in distortion of speech and audio and degradation of VoIP quality.
  • the receiver can compensate the delay jitter of the network through efficient jitter buffer processing (JitterBuffer Management, JBM for short) to solve the problem of audio distortion and VoIP quality degradation.
  • JBM jitterBuffer Management
  • the receiving end will further perform shrink processing after decoding the current speech audio frame, thereby avoiding data loss; if the data packet is received for a long time
  • the receiving end further performs an extension process after decoding the current speech and audio frame, thereby avoiding data discontinuity.
  • TSM Time Scale Modification
  • the current speech and audio frames are usually cached. Specifically, if the length of the data in the buffer reaches the frame length, one frame of the audio signal is output; otherwise, the next audio frame is continuously decoded and buffered until the data length in the buffer reaches the frame length. When the length of the data in the buffer does not reach the frame length, the audio frame of the next language needs to be decoded. At this time, the complexity of the algorithm at the receiving end is high.
  • the embodiment of the invention provides a method and a device for processing a data frame, so as to overcome the defect that the complexity of the algorithm at the receiving end is high in the process of reducing the existing TSM technology.
  • an embodiment of the present invention provides a method for processing a data frame, including:
  • the data frame is subjected to a duration reduction process according to the actual duration adjustment length.
  • the data length of the current cache data in the binding buffer and the expected length adjustment length are determined, and the actual duration adjustment length corresponding to the data frame is determined.
  • the performing the duration reduction processing on the data frame according to the actual duration adjustment length includes:
  • the data length of the current cache data in the binding buffer and the expected length adjustment length are determined, and the actual length adjustment length corresponding to the data frame is determined.
  • the performing the duration reduction processing on the data frame according to the actual duration adjustment length includes:
  • the method further includes:
  • the method further includes:
  • the data frame to be outputted by the data frame to be output whose number of cycles of the repeated data is less than the threshold is performed by zero-filling or noise filling.
  • the length of the stretch treatment is performed by zero-filling or noise filling.
  • an embodiment of the present invention provides a data frame processing apparatus, including:
  • An obtaining module configured to obtain a data frame to be output and an expected length adjustment length corresponding to the data frame, and if it is determined that the data frame needs to be reduced in length, the data length and the current cached data in the buffer are combined. Determining the length of the expected duration, and determining the actual length adjustment length corresponding to the data frame;
  • the duration reduction processing module is configured to perform length reduction processing on the data frame according to the actual duration adjustment length.
  • the acquiring module is specifically configured to:
  • the duration reduction processing module is specifically configured to:
  • the length reduction length of the data frame is performed by directly removing the sample point according to the actual length adjustment length.
  • the acquiring module is specifically configured to:
  • the duration reduction processing module is specifically configured to:
  • the duration reduction process of the data frame is performed by a method of windowing and splicing the repeated data.
  • the device further includes:
  • a sampling module configured to perform a down sampling process on the data frame to be output according to a preset sampling rate, and acquire a length of the repeated data.
  • the device further includes:
  • a length stretching processing module configured to: if it is determined that the data frame needs to be stretched for a length of time, for the data frame to be output whose number of periods of the repeated data included is less than a threshold, zero-value padding or noise is used. Filling method for stretching the length of the data frame Reason.
  • the method and device for processing a data frame provided by the embodiment of the present invention determine the data by combining the data length of the current cached data in the buffer with the expected length of the data frame corresponding to the data frame when determining that the data frame needs to be reduced in length.
  • the actual length adjustment length corresponding to the frame is such that the actual length adjustment length of the data frame duration reduction processing is correlated with the data length of the current buffer data in the buffer, and after the data frame is length-reduced and processed according to the actual length adjustment length,
  • the data frame that has undergone the duration reduction process is buffered into the buffer, so that the buffer performs the length reduction processing on the data frame to be output obtained by the decoding at the receiving end, and outputs a buffer data of a data frame frame length, thereby implementing the control buffer output.
  • the receiving end decodes one frame of data to reduce the maximum complexity of the receiving end.
  • the receiving end decodes one frame of data, and the buffer
  • the length of the data in the data does not reach one frame long and needs to be decoded by the receiving end.
  • the case of the data frame length causing problems of high complexity algorithm receiving end.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for processing a data frame according to the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of a method for processing a data frame according to the present invention
  • Embodiment 3 is a flowchart of Embodiment 3 of a method for processing a data frame according to the present invention
  • Embodiment 4 is a schematic structural diagram of Embodiment 1 of a data frame processing apparatus according to the present invention.
  • Embodiment 2 of a data frame processing apparatus according to the present invention
  • FIG. 6 is a schematic structural diagram of Embodiment 3 of a data frame processing apparatus according to the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a method for processing a data frame according to the present invention. As shown in FIG. 1 , the method in this embodiment may include:
  • Step 101 Obtain a data frame to be output and an expected length adjustment length corresponding to the data frame. If it is determined that the data frame needs to be reduced in length, the data length of the current cached data in the buffer and the expected duration are adjusted. Determine the actual length adjustment length corresponding to the data frame.
  • the duration adjustment processing includes a duration reduction process and a duration stretching process.
  • the receiving end receives the data packet sent by the transmitting end, parses the data packet, and obtains information such as the time stamp of the data packet. According to the information such as the timestamp, it is determined whether the data frame to be output needs to be adjusted in time, and the timestamp records the time when the receiving end receives the data packet.
  • the time adjustment process is not performed. If the time stamp interval of each data packet continuously received by the receiving end is less than the preset threshold, the time reduction process needs to be performed. It can be understood that if the receiving end continuously receives the received value, If the time stamp interval of each data packet is greater than the preset threshold, the length stretching process is required, and the time interval is to be lost.
  • the data frame is received by the receiver and parsing packets obtained by decoding. For example, when the receiving end receives a large number of data packets in a short time, after parsing and decoding the data packet, the data frame to be output needs to be subjected to the duration reduction processing.
  • the data length of the currently cached data in the buffer and the expected length of the length of the buffer are determined, and the actual length of the data frame is determined.
  • the data frame to be output may be different in different manners.
  • the data length of the currently cached data is adjusted as the actual duration; if the expected length adjustment length does not exceed the data length of the current cached data in the buffer, the expected length adjustment length is taken as the actual duration adjustment length; wherein the expected duration adjustment length is the middle
  • the adjustment length of the duration and the adjustment of the maximum duration are smaller.
  • the length of the intermediate length is obtained according to the frame length.
  • the maximum length adjustment length is the maximum duration adjustment length corresponding to the frame length; that is, when the data frame needs to be reduced in duration.
  • the intermediate length adjustment length is obtained according to the frame length, and the intermediate duration adjustment length is compared with the maximum duration adjustment length corresponding to the frame length, and the smaller of the two is selected as the expected duration adjustment length.
  • the method of obtaining the expected length adjustment length in the foregoing manner is a preferred manner.
  • the length of the expected length adjustment period may be an intermediate length adjustment length obtained according to the frame length, or the expected length adjustment length may be a maximum length adjustment length corresponding to the frame length.
  • the data frame to be outputted with the number of periods of the repeated data is smaller than the threshold, and the threshold may be a fixed value, and the number of periods of the repeated data is compared with the threshold to determine the data frame to be outputted. Periodically, when the number of periods of repeated data is less than the threshold, it can be known that the data frame to be output is periodically weak.
  • the actual length adjustment length is obtained by using the foregoing manner, that is, when the expected length adjustment length exceeds the data length of the current cache data in the buffer, the data length of the current cache data in the buffer is used as the actual length adjustment length.
  • the buffer can use the actual length adjustment length to reduce the length of the data frame to be output after decoding, because the actual length adjustment length is the same as the data length of the current cache data in the buffer.
  • the buffer stores the data frame to be outputted after the length reduction process.
  • the data length of the buffered data in the buffer is one frame long, so that the buffer outputs one frame long data; when the expected length adjustment length does not exceed The data length of the currently cached data in the buffer, the length of the expected length adjustment is used as the actual length adjustment length.
  • the setting is because the expected length adjustment length does not exceed the data length of the current cache data, and the expected length adjustment length is used to reduce the duration.
  • Processed data frame to be output When stored in the buffer, the data length of the buffered data of the buffer exceeds one frame at this time, so that the buffer can output one frame of data, so that the receiving end can decode one frame of data buffer and output one frame long. The data.
  • the expected length adjustment length is the length of the repeated data of the data frame.
  • the length of the repeated data of the data frame is the gene period of the data frame.
  • the actual length adjustment length of the duration reduction processing is set to be the same as the periodically weak data frame to be outputted, so that the receiving end decodes the data buffer output of one frame long.
  • Frame length data due to the periodicity of the periodicity of the data frame to be outputted, the appropriate splicing point is found to obtain the high-quality time adjustment of the data frame to be output, when the data frame to be output
  • the actual length adjustment length is set to 0, so that the setting can still satisfy the data decoding output by the receiving end to decode one frame long by one frame long.
  • Step 102 Perform a length reduction process on the data frame according to the actual length adjustment length.
  • the data frame needs to be reduced in length according to the actual length adjustment length, and the specific processing is performed.
  • the way can be:
  • the length is adjusted according to the actual duration, and the length reduction processing of the data frame is performed by directly removing the sample.
  • the method of directly removing the sample point can be used for the length reduction process.
  • the window length reduction method can also be used to reduce the duration, but to reduce The complexity of the algorithm, for the data frame to be outputted with a weak period, this embodiment adopts the method of directly removing the sample point, which can ensure the quality of the data frame after the length reduction processing can also effectively reduce the complexity of the receiving end algorithm.
  • the duration of the data frame is reduced by adding and splicing the repeated data.
  • the data frame processed by the step 102 is buffered into the buffer for the buffer to output the buffered data of the data frame length.
  • the data buffer of the one-frame length is outputted by the receiving end to output a frame length of data.
  • the processing method of the data frame in this embodiment may be based on a preset before the foregoing steps.
  • the sampling rate, the data frame to be output is downsampled, and the length of the repeated data is obtained, and the data frame to be output is subjected to a length reduction process, which can further reduce the algorithm complexity of the processing method of the data frame.
  • the processing method of the data frame in this embodiment after determining whether to adjust the duration of the data frame, if it is determined that the data frame needs to be stretched for the duration of the data frame, the period of the repeated data included is determined.
  • the data frame to be output that is smaller than the threshold (that is, the data frame that is periodically weak) is subjected to the length stretching process of the data frame by zero-filling or noise filling.
  • the length stretching process of the data frame may also be performed by using a similar segment windowing and splicing method.
  • the data length of the current cache data in the buffer and the expected length of the data frame corresponding to the data frame are adjusted to determine the actual length adjustment length corresponding to the data frame, so that the data is
  • the actual length adjustment length of the frame duration reduction processing is associated with the data length of the current buffer data in the buffer.
  • the data frame subjected to the duration reduction processing is buffered to In the buffer, the buffer performs the duration reduction process on the data frame to be output obtained by the decoding at the receiving end, and outputs a buffer data of a data frame frame length, thereby implementing decoding of the receiving end when the control buffer outputs a frame length of the data frame.
  • One frame long data is used to reduce the maximum complexity of the receiving end, so that in the process of reducing the existing TSM technology, the receiving end decodes one frame long data, and the data length in the buffer does not reach one frame length.
  • the receiver needs to decode the next frame of long data, resulting in a receiver algorithm. Miscellaneous issues high.
  • Embodiment 2 is a flowchart of Embodiment 2 of a method for processing a data frame according to the present invention. As shown in FIG. 2, the method in this embodiment may include:
  • Step 201 Receive an RTP packet, and put the received RTP packet into a jitter buffer.
  • RTP Real-time Transport Protocol
  • RTP packets RTP packets
  • VoIP also uses IP networks to deliver voice, fax, video and data services.
  • Step 202 Parse the RTP packet to obtain a bit stream, decode the bit stream to obtain a data frame to be output, and obtain a data length of the current cache data in the buffer.
  • the receiving end unpacks the received RTP packet, obtains a bit stream, and then performs a decoding operation, and decodes the bit stream to obtain a data frame to be output.
  • the receiving end parses the RTP packet, and can obtain information such as a sequence number and a timestamp of the RTP packet, and determines whether the data frame to be output needs to be adjusted according to the serial number and the timestamp.
  • the receiving end receives a large number of RTP packets in a short time, after parsing and decoding the RTP packets, the data frames to be output need to be reduced in duration to avoid data loss.
  • the data frame to be output needs to be stretched for a long time to avoid data discontinuity.
  • Step 203 Determine whether the data frame to be output is an ACTIVE frame and adjust the duration. If yes, go to step 204. If no, go to step 206.
  • Step 204 Combine the data length of the current cached data in the buffer, and obtain an actual length adjustment length corresponding to the data frame.
  • step 204 may include: (1) analyzing energy information of the data frame to be output. (2) In the case where the energy of the data frame to be output is small (slow periodicity), the first time is used to obtain the actual length adjustment length corresponding to the data frame to be output. For the case where the data frame to be output is large (periodic), the second method is used to obtain the actual length adjustment length corresponding to the data frame to be output.
  • the method 1 is specifically: using an existing algorithm to obtain an intermediate length adjustment length according to a data frame frame length, comparing the length adjustment length with a maximum duration adjustment length corresponding to the frame length, and selecting a smaller one as the expected duration adjustment length. . Further determining whether the expected length adjustment length exceeds the data length of the current data in the buffer, and if yes, the data length of the current cache data in the buffer is used as the actual length adjustment length; if not, the expected duration adjustment length is taken as The actual length is adjusted.
  • the data frame to be output is subjected to similar segment search processing. Taking the gene period of the data frame to be output, that is, obtaining the expected length adjustment length of the data frame to be output. Further, determining whether the expected length adjustment length exceeds the data length of the current cache data in the buffer, if yes, setting the actual duration adjustment length to 0; if not, determining the expected duration adjustment length as the actual duration adjustment length.
  • the occurrence of the maximum complexity of the receiving end algorithm is usually performed when the data frame to be output is subjected to the duration reduction processing. Therefore, in order to avoid the above-mentioned maximum complexity, the specific implementation manner of the above step 204 is applicable to the duration.
  • the duration of the adjustment is reduced.
  • the existing algorithm can be used to obtain the length adjustment length, and the length adjustment length can be directly used as the actual length adjustment length.
  • Step 205 Perform a time adjustment process on the data frame to be output according to the actual length adjustment length.
  • the time length reduction process is performed on the data frame to be output according to the actual length adjustment length. Specifically, for the data frame to be output with small energy (slow periodicity), the length is adjusted according to the actual duration, and the method for directly removing the sample is adopted. The time-length reduction process is performed; for the data frame to be output with large energy (periodicity), the similarity segment in the data frame to be output is windowed and spliced to perform the time-length reduction process.
  • the length of the data frame to be outputted may be adjusted for the data frame to be output with small energy (periodically weak) according to the actual duration, and filled with zero value or noise.
  • the method performs the length stretching process; for the data frame to be output with large energy (periodic strong), the similar segment in the data frame to be output is windowed and spliced to perform the length stretching process.
  • the time length reduction or the length stretching process of the output data frame may be performed by windowing and splicing similar segments, except that for the length reduction processing, specifically searching for similar segments according to the data frame to be output, For the length stretching process, specifically, the similar segments are searched for in combination with the data frame to be output and the previous data frame.
  • Step 206 Perform buffer processing on the data frame to be output, and update the data length of the current cache data in the buffer.
  • the data frame to be output processed after the step 205 or the step 203 is received that is, the data frame to be output after the time length adjustment process or the time length adjustment process is not buffered.
  • Step 207 Determine whether the data length of the current cached data in the buffer reaches a frame length. If yes, execute step 208.
  • the data frame to be output is stored in the buffer, and the data length of the current cache data must be equal to or greater than one frame length, so There is no such thing as no.
  • Step 208 Output a frame of the data frame to be output, and update the data length of the current cached data in the buffer.
  • the receiving end parses and decodes the RTP packet, and determines whether the time length adjustment is needed.
  • the data of the current cache data in the buffer is used.
  • the length is associated with the actual length adjustment length of the duration reduction processing, that is, the data length of the current buffer data in the buffer and the expected length adjustment length corresponding to the data frame are used to determine the actual length adjustment length, and the data to be output is adjusted according to the actual duration.
  • the frame is adjusted in duration, and the data frame to be output, which needs to be processed for the duration adjustment, is buffered and buffered for output after the time adjustment process, so that the buffer performs the length of the data frame to be output obtained by the decoder at the receiving end.
  • the buffer data of the data frame frame length is output, so that when the control buffer outputs one frame long data frame, the receiving end decodes one frame long data to reduce the maximum complexity of the receiving end.
  • FIG. 3 is a flowchart of Embodiment 3 of a method for processing a data frame according to the present invention. As shown in FIG. 3, the method in this embodiment may include:
  • Step 301 Receive an RTP packet, and put the received RTP packet into a jitter buffer.
  • Step 302 Parse the RTP packet to obtain a bit stream and a sampling rate corresponding to the bit stream, decode the bit stream to obtain a data frame to be output, and obtain a data length of the current cache data in the buffer.
  • the receiving end unpacks the received RTP packet, obtains a bit stream, and then performs a decoding operation, and decodes the bit stream to obtain a data frame to be output.
  • the receiving end parses the RTP packet, and can obtain information such as a sequence number, a timestamp, and a sampling rate of the RTP packet, and determines whether the data frame to be output needs to be adjusted according to the sequence number and the timestamp.
  • the receiving end receives a large number of RTP packets in a short time, after parsing and decoding the RTP packets, the data frames to be output need to be reduced in duration to avoid data loss.
  • the data frame to be output needs to be processed. Perform length stretching to avoid data discontinuities.
  • Step 303 Determine whether the data frame to be output is an ACTIVE frame and adjust the duration. If yes, go to step 304. If no, go to step 306.
  • Step 304 Combine the data length of the current cache data in the buffer with the preset sampling rate, and obtain an actual length adjustment length corresponding to the data frame.
  • step 304 may include: (1) performing a downsampling process on the data frame to be output in combination with the preset sampling rate. (2) analyzing the energy information of the data frame to be output after the downsampling process. (3) For the case where the energy is small (the periodicity is weak), the first time is used to obtain the actual length adjustment length. For the case of large energy (periodic strong), the second method is used to obtain the actual length adjustment length.
  • the sampling rate of the data frame to be output may be obtained in step 302. If the sampling rate is higher, for example, the sampling rate is greater than 16 kHz, the data frame to be output may be downsampled according to a preset sampling rate. Further reduce the complexity of the algorithm.
  • the actual length adjustment length is obtained by using the corresponding method.
  • the method 1 in the step 204 in the second embodiment shown in FIG. 2 and details are not described herein again.
  • the second method is specifically: performing a similar segment search process on the data frame to be output after the downsampling process, and acquiring a gene period of the data frame to be output after the downsampling process.
  • the gene period of the data frame to be output after the downsampling process is doubled, and the gene period of the data frame to be output that has not been downsampled is obtained, and it is further determined whether the gene period of the data frame to be output exceeds the buffer. If the data length of the current cached data is exceeded, the actual length adjustment length is set to 0; if not, the gene period of the data frame to be output is used as the actual duration adjustment length.
  • the data frame to be output is subjected to the length reduction processing. Therefore, in order to avoid the above-mentioned maximum complexity, the specific implementation of the above step 304 is applicable to The duration of the adjustment in the duration is reduced.
  • the existing algorithm can be used to obtain the length adjustment length, and the length adjustment length can be directly used as the actual length adjustment length.
  • Step 305 Perform a time adjustment process on the data frame to be output according to the actual length adjustment length.
  • Step 306 Perform buffer processing on the data frame to be output, and update the data length of the current cache data in the buffer.
  • Step 307 Determine whether the data length of the current cached data in the buffer reaches a frame length. If yes, execute step 308.
  • Step 308 Output a frame of data frames to be output, and update the data length of the current cached data in the buffer.
  • steps 305 to 308 For the specific implementation of the steps 305 to 308, refer to steps 205 to 208 in the embodiment shown in FIG. 2, and details are not described herein again.
  • the data frame to be output is downsampled according to a preset sampling rate, and the receiving end decodes a frame when the control buffer outputs a frame length of the data frame.
  • Long data is based on reducing the maximum complexity of the receiver, further reducing the complexity of the algorithm.
  • the present embodiment can reduce the algorithm complexity of the existing duration adjustment algorithm by performing down-sampling processing on the data frames to be output.
  • the method of the embodiment is more effective for reducing the complexity of the algorithm for data with high sampling rate.
  • the apparatus in this embodiment may include: an obtaining module 11 and a duration reducing processing module 12, wherein the receiving module 11 is configured to obtain The output data frame and the expected length adjustment length corresponding to the data frame. If it is determined that the data frame needs to be reduced in length, the data length of the current cache data in the buffer and the expected length adjustment length are determined. The actual duration adjustment length corresponding to the data frame, the duration reduction processing module 12 is configured to perform length reduction processing on the data frame according to the actual duration adjustment length.
  • the obtaining module 11 obtains the data frame to be output, and when determining that the data frame needs to be reduced in length, the data frame is obtained by obtaining the actual length adjustment length corresponding to the data frame according to the data length of the current buffer data in the buffer.
  • the actual length adjustment length of the duration reduction process is associated with the data length of the current cache data in the buffer.
  • the duration reduction processing module 12 reduces the length of the data frame after the length reduction process is performed according to the actual length adjustment length.
  • the frame is buffered into the buffer, so that the buffer performs the length reduction processing on the data frame to be output obtained by the decoding at the receiving end, and then outputs the buffer data of the data frame frame length, thereby implementing the control buffer outputting a frame length of the data frame.
  • Receiver decodes one frame Long data.
  • the obtaining module 11 is specifically configured to: determine, for the data frame to be output that the number of periods of the repeated data included in the repeated data is less than a threshold, whether the length of the expected duration adjustment exceeds the data of the current cached data in the buffer a length, if the expected length adjustment length exceeds a data length of the current cache data in the buffer, the data length of the current cache data in the buffer is used as the actual duration adjustment length; if the expected duration is adjusted If the data length of the current cached data in the buffer is not exceeded, the expected length adjustment length is used as the actual duration adjustment length; wherein the expected duration adjustment length is the intermediate duration adjustment length and the maximum duration adjustment length.
  • the intermediate length adjustment length is obtained according to the frame length, and the maximum duration adjustment length is a maximum duration adjustment length corresponding to the frame length.
  • the duration reduction processing module 12 is specifically configured to perform length reduction processing of the data frame by directly removing the sample point according to the actual length adjustment length.
  • the obtaining module 11 is further configured to: determine, for the data frame to be output that the number of cycles of the repeated data that is included is greater than or equal to a threshold, whether the length of the expected duration adjustment exceeds a current value in the buffer.
  • the length of the data of the cached data if the expected length of the expected length exceeds the data length of the current cached data in the buffer, the actual length adjustment length is set to 0; if the expected duration adjustment length does not exceed the cache
  • the data length of the currently cached data is used to adjust the length of the expected duration as the actual duration adjustment length; wherein the expected duration adjustment length is the length of the repeated data.
  • the duration reduction processing module 12 is specifically configured to: perform length reduction processing of the data frame by performing windowing and splicing on the repeated data according to the actual length adjustment length.
  • the acquiring unit 11 is specifically configured to adjust the data length of the currently cached data in the buffer as the actual duration when the expected length of the data length exceeds the data length of the current cached data in the buffer.
  • the length so that the buffer can decode the data frame to be output after decoding by using the actual length adjustment length after the receiver decodes one frame of data, so that the buffer stores the output to be output after the reduced processing time.
  • the data frame the data length of the current cached data can satisfy one frame length.
  • the expected duration is Adjusting the length as the actual length adjustment length.
  • the setting is because the expected length adjustment length does not exceed the data length of the current cache data, and the data frame to be output processed by the expected length adjustment length is used to be stored in the buffer. At this time, the data length of the current buffer data of the buffer exceeds one frame, so that the buffer can output one frame of data, so that the receiving end can decode one frame long data buffer and output one frame long data.
  • the obtaining unit 11 is specifically configured to be the same as the periodically weak data frame to be output, and the actual length adjustment length of the duration reduction processing is set to achieve decoding of the frame length by the receiving end.
  • the data buffer outputs a frame length of data, but, due to considering the inherent periodicity of the periodically strong data frame to be output, finding a suitable splicing point for obtaining a high-quality data frame to be output is adjusted.
  • the expected length of the data frame to be output exceeds the data length of the current cached data, the actual length adjustment length is set to 0, so that the setting can still satisfy the data decoding output by the receiving end to decode one frame long.
  • the duration reduction processing is performed according to the actual duration adjustment length.
  • the device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1 , and the implementation principle and technical effects are similar, and details are not described herein again.
  • FIG. 5 is a schematic structural diagram of a second embodiment of a data frame processing apparatus according to the present invention.
  • the apparatus of this embodiment is further configured to include: a sampling module 13 according to the apparatus structure shown in FIG. And performing the down sampling processing on the data frame to be output according to a preset sampling rate, and acquiring the length of the repeated data.
  • the sampling module 13 is added, so that the data frame to be output can be downsampled before the time-length reduction process is performed, thereby further reducing the complexity of the algorithm. That is, before the data frame to be output by the obtaining unit 11 is processed, the data frame to be output is first processed by the sampling module 13.
  • the device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1 , and the implementation principle and technical effects are similar, and details are not described herein again.
  • FIG. 6 is a schematic structural diagram of Embodiment 3 of a data frame processing apparatus according to the present invention.
  • the apparatus of this embodiment may further include: a duration stretching processing module 14 according to the foregoing apparatus structure.
  • a duration stretching processing module 14 For judging that it is necessary to perform length stretching processing on the data frame, the number of periods to be outputted for the number of periods of the repeated data included is less than a threshold According to the frame, the length stretching process of the data frame is performed by a method of zero value filling or noise filling.
  • the stretch processing module 14 processes the data frames to be output.
  • the device in this embodiment may be used to implement the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明实施例提供一种数据帧的处理方法和装置。本发明数据帧的处理方法,包括:获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度;根据所述实际时长调整长度对所述数据帧进行时长缩减处理,并将经过时长缩减处理的数据帧缓存到所述缓存器中,以供所述缓存器输出时长达到所述数据帧帧长的缓存数据。本发明实施例实现控制缓存器输出一帧长的数据帧时接收端解码一帧长的数据,从而有效降低接收端的最大复杂度。

Description

数据帧的处理方法和装置 技术领域
本发明实施例涉及通信技术,尤其涉及一种数据帧的处理方法和装置。
背景技术
在VoIP(Voice over Internet Protocol)通信系统中,分组包在传输过程中会产生时延抖动(delay jitter),严重时会产生数据包丢失,造成语音频失真,VoIP质量下降。接收端可以通过高效的抖动缓存处理(JitterBuffer Management,简称JBM)来补偿网络的延迟抖动,以解决音频失真、VoIP质量下降的问题。
在JBM处理过程中,如果短时间内接收到大量的数据包,接收端在解码当前语音频帧后将进一步进行缩减(shrink)处理,从而避免数据丢失;如果较长时间内才能接收到数据包,接收端在解码当前语音频帧后将进一步进行拉伸(extend)处理,从而避免数据不连续。其中,缩减和拉伸处理需要结合时长调整(Time Scale Modification,简称TSM)技术。
在通过TSM技术进行缩减处理过程中,为了保持输出语音频的连贯性,当前语音频帧通常会进行缓存处理。具体地,如果缓存器中数据长度达到帧长,则输出一帧语音频信号;否则继续解码下一语音频帧并进行缓存处理,直至缓存器中数据长度达到帧长为止。当缓存器中的数据长度未达到帧长,则需要解码下一语音频帧,此时接收端算法复杂度较高。
发明内容
本发明实施例提供一种数据帧的处理方法和装置,以克服现有TSM技术进行缩减处理过程中,接收端算法复杂度较高的缺陷。
第一方面,本发明实施例提供一种数据帧的处理方法,包括:
获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若 判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度;
根据所述实际时长调整长度对所述数据帧进行时长缩减处理。
结合第一方面,在第一方面的第一种可能的实现方式中,所述结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度包括:
对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述缓存器中当前缓存数据的数据长度作为所述实际时长调整长度;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,所述中间时长调整长度是根据所述帧长获得的,所述最大时长调整长度是所述帧长对应的最大时长调整长度。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述根据所述实际时长调整长度对所述数据帧进行时长缩减处理包括:
根据所述实际时长调整长度,采用直接去掉样点的方法进行所述数据帧的时长缩减处理;
结合第一方面,在第一方面的第三种可能的实现方式中,所述结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度包括:
对于包括的重复数据的周期个数大于或等于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述实际时长调整长度设置为0;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为 所述重复数据的长度。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述根据所述实际时长调整长度对所述数据帧进行时长缩减处理包括:
根据所述实际时长调整长度,采用对所述重复数据进行加窗并叠接的方法进行所述数据帧的时长缩减处理。
结合第一方面、第一方面的第一种至第一方面的第四种任一种可能的实现方式,在第一方面的第五种可能的实现方式中,所述方法还包括:
根据预设的采样率,对所述待输出的数据帧进行降采样处理,并获取所述重复数据的长度。
结合第一方面、第一方面的第一种至第五种任一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述方法还包括:
若判断获知需要对所述数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,则采用零值填充或噪声填充的方法进行所述数据帧的时长拉伸处理。
第二方面,本发明实施例提供一种数据帧的处理装置,包括:
获取模块,用于获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度;
时长缩减处理模块,用于根据所述实际时长调整长度对所述数据帧进行时长缩减处理。
结合第二方面,在第二方面的第一种可能的实现方式中,所述获取模块具体用于:
对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述缓存器中当前缓存数据的数据长度作为所述实际时长调整长度;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的 数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,所述中间时长调整长度是根据所述帧长获得的,所述最大时长调整长度是所述帧长对应的最大时长调整长度。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述时长缩减处理模块具体用于:
根据所述实际时长调整长度,采用直接去掉样点的方法进行所述数据帧的时长缩减处理。
结合第二方面,在第二方面的第三种可能的实现方式中,所述获取模块具体用于:
对于包括的重复数据的周期个数大于或等于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述实际时长调整长度设置为0;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整时长为所述重复数据的长度。
结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述时长缩减处理模块具体用于:
采用对所述重复数据进行加窗并叠接的方法进行所述数据帧的时长缩减处理。
结合第二方面、第二方面的第一种至第四种任一种可能的实现方式,在第二方面的第五种可能的实现方式中,所述装置还包括:
采样模块,用于根据预设的采样率,对所述待输出的数据帧进行降采样处理,并获取所述重复数据的长度。
结合第二方面、第二方面的第一种至第五种任一种可能的实现方式,在第二方面的第六种可能的实现方式中,所述装置还包括:
时长拉伸处理模块,用于若判断获知需要对所述数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,则采用零值填充或噪声填充的方法进行所述数据帧的时长拉伸处 理。
本发明实施例提供的数据帧的处理方法和装置,当判断获知需要对数据帧进行时长缩减处理时,通过结合缓存器中当前缓存数据的数据长度和数据帧对应的预期时长调整长度,确定数据帧对应的实际时长调整长度,使得数据帧进行时长缩减处理的实际时长调整长度与缓存器中当前缓存数据的数据长度相互关联,在根据该实际时长调整长度对数据帧进行时长缩减处理后,将该经过时长缩减处理的数据帧缓存到缓存器中,使得缓存器在接收端对解码获得的待输出的数据帧进行时长缩减处理后输出一数据帧帧长的缓存数据,从而实现控制缓存器输出一帧长的数据帧时接收端解码一帧长的数据,以降低接收端的最大复杂度,从而解决现有TSM技术进行缩减处理过程中,会出现接收端解码一帧长的数据,而缓存器中的数据长度未达到一帧长,需要接收端解码下一帧长数据的情况,造成接收端算法复杂度高的问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明数据帧的处理方法实施例一的流程图;
图2为本发明数据帧的处理方法实施例二的流程图;
图3为本发明数据帧的处理方法实施例三的流程图;
图4为本发明数据帧的处理装置实施例一的结构示意图;
图5为本发明数据帧的处理装置实施例二的结构示意图;
图6为本发明数据帧的处理装置实施例三的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合 本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为本发明数据帧的处理方法实施例一的流程图,如图1所示,本实施例的方法可以包括:
步骤101、获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和预期时长调整长度,确定数据帧对应的实际时长调整长度。
其中,获得待输出的数据帧后,根据现有的语音激活检测(Voice Active Detector,简称VAD)技术,判断该数据帧是否为有效(ACTIVE)帧,若该数据帧为有效帧,则进一步判断是否对该数据帧进行时长调整处理,时长调整处理包括时长缩减处理和时长拉伸处理,具体地,接收端接收发送端发送的数据包,对数据包进行解析,获取数据包的时间戳等信息,根据该时间戳等信息判断是否需要对待输出的数据帧进行时长调整处理,时间戳记录了接收端接收到数据包的时间,如果接收端连续接收到的各数据包的时间戳间隔相同且等于预设阀值,则不做时长调整处理,如果接收端连续接收到的各数据包的时间戳间隔小于预设阀值,则需要进行时长缩减处理,可以理解的,如果接收端连续接收到的各数据包的时间戳间隔大于预设阀值,则需要进行时长拉伸处理,其中待输出的数据帧是对接收端接收到的数据包进行解析并进行解码获得的。举例而言,当接收端在短时间内接收到大量的数据包,则在解析并解码数据包后,需要对待输出的数据帧进行时长缩减处理。
可选地,在结合缓存器中当前缓存数据的数据长度和预期时长调整长度,确定数据帧对应的实际时长调整长度,具体针对不同的待输出的数据帧可以采用不同的方式,具体可以为:
(1)对于包括的重复数据的周期个数小于阈值的待输出的数据帧,判断预期时长调整长度是否超过缓存器中当前缓存数据的数据长度,若预期时长调整长度超过缓存器中当前缓存数据的数据长度,则将缓存器 中当前缓存数据的数据长度作为实际时长调整长度;若预期时长调整长度不超过缓存器中当前缓存数据的数据长度,则将预期时长调整长度作为实际时长调整长度;其中,预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,中间时长调整长度是根据帧长获得的,最大时长调整长度是帧长对应的最大时长调整长度;即,当需要对数据帧进行时长缩减处理时,根据帧长获得中间时长调整长度,将中间时长调整长度与帧长对应的最大时长调整长度进行比较,选择两者中较小的作为预期时长调整长度。上述方式获取预期时长调整长度是一种优选的方式,还可以设置预期时长调整长度为根据帧长获得的中间时长调整长度,也可以设置预期时长调整长度为帧长对应的最大时长调整长度。
其中,包括的重复数据的周期个数小于阈值的待输出的数据帧,该阈值可以为一固定值,将重复数据的周期个数与该阈值进行比较,用以确定该待输出的数据帧的周期性,当重复数据的周期个数小于阈值,则可以获知该待输出的数据帧周期性弱。
对于周期性弱的数据帧采用上述方式获得实际时长调整长度,即当预期时长调整长度超过缓存器中当前缓存数据的数据长度,则将缓存器中当前缓存数据的数据长度作为实际时长调整长度,缓存器可以在接收端解码一帧数据后,使用该实际时长调整长度对解码后获得的待输出的数据帧进行时长缩减处理,由于实际时长调整长度与缓存器中当前缓存数据的数据长度相同,缓存器存储该经过时长缩减处理后的待输出的数据帧,此时缓存器中缓存数据的数据长度为一帧长,从而可以使得缓存器输出一帧长的数据;当预期时长调整长度不超过缓存器中当前缓存数据的数据长度,则将预期时长调整长度作为实际时长调整长度,这样设置是由于预期时长调整长度不超过当前缓存数据的数据长度,则将使用该预期时长调整长度进行时长缩减处理的待输出的数据帧,存储于缓存器时,此时缓存器的缓存数据的数据长度超过一帧,从而可以使得缓存器输出一帧长的数据,这样便可以实现接收端解码一帧长的数据缓存器输出一帧长的数据。
(2)对于包括的重复数据的周期个数大于或等于阈值的待输出的数据帧,判断预期时长调整长度是否超过缓存器中当前缓存数据的数据长 度,若预期时长调整长度超过缓存器中当前缓存数据的数据长度,则将实际时长调整长度设置为0;若预期时长调整长度不超过缓存器中当前缓存数据的数据长度,则将预期时长调整作为实际时长调整长度;
其中,预期时长调整长度为数据帧的重复数据的长度。该数据帧的重复数据的长度即为该数据帧的基因周期。
对于周期性强的待输出的数据帧,与周期性弱的待输出的数据帧相同,其进行时长缩减处理的实际时长调整长度的设置是为了实现接收端解码一帧长的数据缓存器输出一帧长的数据,但是,由于考虑周期性强的待输出的数据帧的固有周期性,为其找到合适的拼接点以获取高质量待输出的数据帧的时长调整,当待输出的数据帧的重复数据的长度超过当前缓存数据的数据长度时,设置实际时长调整长度为0,这样设置仍可以满足接收端解码一帧长的数据缓存器输出一帧长的数据。
步骤102、根据实际时长调整长度对数据帧进行时长缩减处理。
可选地,在结合缓存器中当前缓存数据的数据长度和预期时长调整长度,确定数据帧对应的实际时长调整长度后,需要根据该实际时长调整长度对数据帧进行时长缩减处理,其具体处理方式可以为:
(1)对于包括的重复数据的周期个数小于阈值的待输出的数据帧(周期性弱),根据实际时长调整长度,采用直接去掉样点的方法进行数据帧的时长缩减处理。这里由于待输出的数据帧周期性弱,则可以采用直接去掉样点的方法进行时长缩减处理,当然,可以理解的,也可以使用加窗并叠接的方法进行时长缩减处理,然而为减小算法复杂度,对于周期弱的待输出的数据帧本实施例采用直接去掉样点的方式,既可以保证进行时长缩减处理后的数据帧质量还可以有效降低接收端算法复杂度。
(2)对于包括的重复数据的周期个数大于或等于阈值的待输出的数据帧(周期性强),采用对重复数据进行加窗并叠接的方法进行数据帧的时长缩减处理。
将经过步骤102处理后的数据帧缓存到缓存器中,以供缓存器输出时长达到数据帧帧长的缓存数据,可以实现接收端解码一帧长的数据缓存器输出一帧长的数据。
本实施例的数据帧的处理方法在上述步骤之前,还可以根据预设的 采样率,对待输出的数据帧进行降采样处理,并获取重复数据的长度,对待输出的数据帧进行时长缩减处理,这样可以进一步降低该数据帧的处理方法的算法复杂度。
可选地,在本实施例的数据帧的处理方法中还可以,在判断是否对数据帧进行时长调整后,若判断获知需要对数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的待输出的数据帧(即周期性弱的数据帧),则采用零值填充或噪声填充的方法进行数据帧的时长拉伸处理。可选的,也可以采用相似段加窗并叠接的方法进行数据帧的时长拉伸处理。
本实施例,当判断获知需要对数据帧进行时长缩减处理时,通过结合缓存器中当前缓存数据的数据长度和数据帧对应的预期时长调整长度,确定数据帧对应的实际时长调整长度,使得数据帧进行时长缩减处理的实际时长调整长度与缓存器中当前缓存数据的数据长度相互关联,在根据该实际时长调整长度对数据帧进行时长缩减处理后,将该经过时长缩减处理的数据帧缓存到缓存器中,使得缓存器在接收端对解码获得的待输出的数据帧进行时长缩减处理后输出一数据帧帧长的缓存数据,从而实现控制缓存器输出一帧长的数据帧时接收端解码一帧长的数据,以降低接收端的最大复杂度,从而解决现有TSM技术进行缩减处理过程中,会出现接收端解码一帧长的数据,而缓存器中的数据长度未达到一帧长,需要接收端解码下一帧长数据的情况,造成接收端算法复杂度高的问题。
下面采用两个具体的实施例,对图1所示方法实施例的技术方案进行详细说明。以下两个实施例具体应用于DTX on编码模式下的数据帧处理方法。
图2为本发明数据帧的处理方法实施例二的流程图,如图2所示,本实施例的方法可以包括:
步骤201、接收RTP包,将接收到的RTP包放入抖动缓存器(jitter buffer)中。
RTP(Real-time Transport Protocol,实时传输协议)是用于流媒体业务的标准传输协议,在所有流媒体相关业务中,几乎所有的媒体内 容在IP网络上进行传输之前都需要封装为RTP数据包(RTP包)的形式,RTP用来为IP网上的语音、图像、传真等多种需要实时传输的多媒体数据提供端到端的实时传输服务,VoIP也是利用IP网络完成传送语音、传真、视频和数据等业务。
步骤202、解析RTP包获得比特流,解码比特流获得待输出的数据帧,并获取缓存器中当前缓存数据的数据长度。
接收端对接收到的RTP包进行解包,获得比特流,然后进行解码操作,解码该比特流获得待输出的数据帧。其中,接收端对RTP包进行解析,可以获取RTP包的序列号和时间戳等信息,根据该序列号和时间戳等信息判断是否需要对待输出的数据帧进行时长调整处理。当接收端在短时间内接收到大量的RTP包,则在解析并解码RTP包后,需要对待输出的数据帧进行时长缩减处理,以避免数据丢失。当在较长时间内才能接收到RTP包,则在解析并解码RTP包后,需要对待输出的数据帧进行时长拉伸处理,以避免数据不连续。
步骤203、判断待输出的数据帧是否为ACTIVE帧且需要调整时长,若是,则执行步骤204,若否,则执行步骤206。
步骤204、结合缓存器中当前缓存数据的数据长度,获得数据帧对应的实际时长调整长度。
具体地,步骤204可以包括:(1)分析待输出的数据帧的能量信息。(2)对于待输出的数据帧能量小(周期性弱)的情况,使用方式一获得待输出的数据帧对应的实际时长调整长度。对于待输出的数据帧能量大(周期性强)的情况,使用方式二获得待输出的数据帧对应的实际时长调整长度。
其中,方式一,具体为,利用已有算法根据数据帧帧长获得中间时长调整长度,将该时长调整长度与该帧长对应的最大时长调整长度进行比较,选取较小的作为预期时长调整长度。进一步判断该预期时长调整长度是否超过缓存器中当前数据的数据长度,若超过,则将缓存器中当前缓存数据的数据长度作为实际时长调整长度;若不超过,则将该预期时长调整长度作为实际时长调整长度。
方式二,具体为,对待输出的数据帧进行基于相似段搜索处理,获 取该待输出的数据帧的基因周期,即获得该待输出的数据帧的预期时长调整长度。进一步判断该预期时长调整长度是否超过缓存器中当前缓存数据的数据长度,若超过,则将实际时长调整长度设置为0;若不超过,则将该预期时长调整长度作为实际时长调整长度。
需要说明的是,一般接收端算法最大复杂度的出现情况通常在对待输出的数据帧进行时长缩减处理时,因此,为避免出现上述最大复杂度的情况,上述步骤204的具体实现方式适用于时长调整中的时长缩减处理。对于需要进行时长拉伸处理的情况,可以使用已有算法获取时长调整长度,直接使用该时长调整长度作为实际时长调整长度。
步骤205、根据实际时长调整长度对待输出的数据帧进行时长调整处理。
其中,对于根据实际时长调整长度对待输出的数据帧进行时长缩减处理,具体可以为,对于能量小(周期性弱)的待输出的数据帧,根据实际时长调整长度,采用直接去掉样点的方法进行时长缩减处理;对于能量大(周期性强)的待输出的数据帧,采用对待输出的数据帧中的相似段进行加窗并叠接的方法进行时长缩减处理。
对于根据实际时长调整长度对待输出的数据帧进行时长拉伸处理,具体可以为,对于能量小(周期性弱)的待输出的数据帧,根据实际时长调整长度,采用零值填充或噪声填充的方法进行时长拉伸处理;对于能量大(周期性强)的待输出的数据帧,采用对待输出的数据帧中的相似段进行加窗并叠接的方法进行时长拉伸处理。
对待输出的数据帧进行时长缩减或者时长拉伸处理均可以采用对相似段进行加窗并叠接的方法,不同之处在于,对于时长缩减处理,具体是根据待输出的数据帧搜索相似段,而对于时长拉伸处理,具体是结合待输出的数据帧和前一数据帧搜索相似段。
步骤206、对待输出的数据帧进行缓存处理,并更新缓存器中当前缓存数据的数据长度。
具体地,接收经过步骤205或者步骤203处理后的待输出的数据帧,即对经过时长调整处理或者未经过时长调整处理后的待输出的数据帧进行缓存。
步骤207、判断缓存器中当前缓存数据的数据长度是否达到一帧长,若是,则执行步骤208。
需要说明的是,由于经过步骤207之前的步骤处理后的待输出的数据帧,将该待输出的数据帧存储于缓存器中,其当前缓存数据的数据长度一定等于或者大于一帧长,所以不存在否的情况。
步骤208、输出一帧的待输出的数据帧,并更新缓存器中当前缓存数据的数据长度。
本实施例,接收端在接收到RTP包后,对RTP包进行解析并解码,判断是否需要进行时长调整,在需要进行时长调整并进行时长缩减处理时,通过将缓存器中当前缓存数据的数据长度与进行时长缩减处理的实际时长调整长度进行关联,即结合缓存器中当前缓存数据的数据长度和数据帧对应的预期时长调整长度确定实际时长调整长度,根据该实际时长调整长度对待输出的数据帧进行时长调整处理,并将需要进行时长调整处理的待输出的数据帧,经过时长调整处理后缓存到缓存器中进行输出,使得缓存器在接收端对解码获得的待输出的数据帧进行时长缩减处理后输出一数据帧帧长的缓存数据,从而实现控制缓存器输出一帧长的数据帧时接收端解码一帧长的数据,以降低接收端的最大复杂度。
图3为本发明数据帧的处理方法实施例三的流程图,如图3所示,本实施例的方法可以包括:
步骤301、接收RTP包,将接收到的RTP包放入抖动缓存器(jitter buffer)中。
步骤302、解析RTP包获得比特流和该比特流对应的采样率,解码比特流获得待输出的数据帧,并获取缓存器中当前缓存数据的数据长度。
接收端对接收到的RTP包进行解包,获得比特流,然后进行解码操作,解码该比特流获得待输出的数据帧。其中,接收端对RTP包进行解析,可以获取RTP包的序列号、时间戳以及采样率等信息,根据该序列号和时间戳等信息判断是否需要对待输出的数据帧进行时长调整处理。当接收端在短时间内接收到大量的RTP包,则在解析并解码RTP包后,需要对待输出的数据帧进行时长缩减处理,以避免数据丢失。当在较长时间内才能接收到RTP包,则在解析并解码RTP包后,需要对待输出的数据帧 进行时长拉伸处理,以避免数据不连续。
步骤303、判断待输出的数据帧是否为ACTIVE帧且需要调整时长,若是,则执行步骤304,若否,则执行步骤306。
步骤304、结合缓存器中当前缓存数据的数据长度和预设采样率,获得数据帧对应的实际时长调整长度。
具体地,步骤304可以包括:(1)结合预设采样率对待输出的数据帧进行降采样处理。(2)分析经过降采样处理后的待输出的数据帧的能量信息。(3)对于能量小(周期性弱)的情况,使用方式一获得实际时长调整长度。对于能量大(周期性强)的情况,使用方式二获得实际时长调整长度。
其中,在步骤302中可以获取待输出的数据帧的采样率,若该采样率较高,例如采样率大于16kHz,则可以对该待输出的数据帧根据预设采样率进行降采样处理,以进一步降低算法复杂度。
对于经过降采样处理后的待输出的数据帧进行能量分析后,使用相应方式获取实际时长调整长度。具体地,方式一可以参见图2所示实施例二中步骤204中的方式一,此处不再赘述。
方式二,具体为,对降采样处理后的待输出的数据帧进行基于相似段搜索处理,获取该降采样处理后的待输出的数据帧的基因周期。对该降采样处理后的待输出的数据帧的基因周期进行加倍,获取未经过降采样处理的待输出的数据帧的基因周期,进一步判断该待输出的数据帧的基因周期是否超过缓存器中当前缓存数据的数据长度,若超过,则将实际时长调整长度设置为0;若不超过,则将该待输出的数据帧的基因周期作为实际时长调整长度。
需要说明的是,一般接收端算法出现最大复杂度的情况通常出现在对待输出的数据帧进行时长缩减处理时,因此,为避免出现上述最大复杂度的情况,上述步骤304的具体实现方式适用于时长调整中的时长缩减处理。对于需要进行时长拉伸处理的情况,可以使用已有算法获取时长调整长度,直接使用该时长调整长度作为实际时长调整长度。
步骤305、根据实际时长调整长度对待输出的数据帧进行时长调整处理。
步骤306、对待输出的数据帧进行缓存处理,并更新缓存器中当前缓存数据的数据长度。
步骤307、判断缓存器中当前缓存数据的数据长度是否达到一帧长,若是,则执行步骤308。
步骤308、输出一帧的待输出的数据帧,并更新缓存器中当前缓存数据的数据长度。
其中,步骤305-步骤308的具体实施方式可以参见图2所示实施例中步骤205-步骤208,此处不再赘述。
本实施例,在图2所示实施例的基础上,根据预设采样率,对待输出的数据帧进行降采样处理,可以在实现控制缓存器输出一帧长的数据帧时接收端解码一帧长的数据,以降低接收端的最大复杂度的基础上,进一步降低算法复杂度。可以理解的,无论是对于时长缩减处理还是时长拉伸处理,本实施通过对待输出的数据帧进行降采样处理,都可以实现降低现有时长调整算法的算法复杂度。本实施例的方法对于高采样率的数据,其降低算法复杂度的效果更为明显。
图4为本发明数据帧的处理装置实施例一的结构示意图,如图4所示,本实施例的装置可以包括:获取模块11和时长缩减处理模块12,其中,接收模块11用于获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度,时长缩减处理模块12用于根据所述实际时长调整长度对所述数据帧进行时长缩减处理。
其中,获取模块11获得待输出的数据帧,当判断获知需要对数据帧进行时长缩减处理时,通过根据缓存器中当前缓存数据的数据长度获得数据帧对应的实际时长调整长度,使得数据帧进行时长缩减处理的实际时长调整长度与缓存器中当前缓存数据的数据长度相互关联,时长缩减处理模块12在根据该实际时长调整长度对数据帧进行时长缩减处理后,将该经过时长缩减处理的数据帧缓存到缓存器中,使得缓存器在接收端对解码获得的待输出的数据帧进行时长缩减处理后输出一数据帧帧长的缓存数据,从而实现控制缓存器输出一帧长的数据帧时接收端解码一帧 长的数据。
进一步地,获取模块11具体可以用于,对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述缓存器中当前缓存数据的数据长度作为所述实际时长调整长度;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,所述中间时长调整长度是根据所述帧长获得的,所述最大时长调整长度是所述帧长对应的最大时长调整长度。
相应地,时长缩减处理模块12具体用于,根据所述实际时长调整长度,采用直接去掉样点的方法进行所述数据帧的时长缩减处理。
可选地,获取模块11具体还可以用于,对于包括的重复数据的周期个数大于或等于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述实际时长调整长度设置为0;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中所述预期时长调整长度为所述重复数据的长度。
相应地,时长缩减处理模块12具体用于,根据所述实际时长调整长度,采用对所述重复数据进行加窗并叠接的方法进行所述数据帧的时长缩减处理。
具体地,获取单元11,具体针对周期性弱的待输出的数据帧,当预期时长调整长度超过缓存器中当前缓存数据的数据长度,则将缓存器中当前缓存数据的数据长度作为实际时长调整长度,这样缓存器可以在接收端解码一帧数据后,使用该实际时长调整长度对解码后获得的待输出的数据帧进行时长缩减处理,这样缓存器存储该经过时长缩减处理后的待输出的数据帧,其当前缓存数据的数据长度可以满足一帧长,当预期时长调整长度不超过缓存器中当前缓存数据的数据长度,则将预期时长 调整长度作为实际时长调整长度,这样设置是由于预期时长调整长度不超过当前缓存数据的数据长度,则将使用该预期时长调整长度进行时长缩减处理的待输出的数据帧,存储于缓存器时,此时缓存器当前缓存数据的数据长度超过一帧,从而可以使得缓存器输出一帧长的数据,这样便可以实现接收端解码一帧长的数据缓存器输出一帧长的数据。而获取单元11,具体针对周期性强的待输出的数据帧,与周期性弱的待输出的数据帧相同,其进行时长缩减处理的实际时长调整长度的设置是为了实现接收端解码一帧长的数据缓存器输出一帧长的数据,但是,由于考虑周期性强的待输出的数据帧的固有周期性,为其找到合适的拼接点以获取高质量待输出的数据帧的时长调整,当待输出的数据帧预期时长调整长度超过当前缓存数据的数据长度时,设置实际时长调整长度为0,这样设置仍可以满足接收端解码一帧长的数据缓存器输出一帧长的数据。
时长缩减处理模块12在通过获取单元11获取到实际时长调整长度后,根据该实际时长调整长度对待输出的数据帧进行时长缩减处理。
本实施例的装置,可以用于执行图1所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图5为本发明数据帧的处理装置实施例二的结构示意图,如图5所示,本实施例的装置在图4所示装置结构的基础上,进一步地,还可以包括:采样模块13,用于根据预设的采样率,对所述待输出的数据帧进行降采样处理,并获取所述重复数据的长度。
在图4所示装置结构的基础上,增加采样模块13,这样可以在进行时长缩减处理之前,对待输出的数据帧进行降采样处理,从而可以实现进一步降低算法复杂度的效果。即在获取单元11对待输出的数据帧进行处理之前,先将该待输出的数据帧经过采样模块13处理。
本实施例的装置,可以用于执行图1所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图6为本发明数据帧的处理装置实施例三的结构示意图,如图6所示,本实施例的装置在上述装置结构的基础上,进一步地,还可以包括:时长拉伸处理模块14,用于若判断获知需要对所述数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的数 据帧,则采用零值填充或噪声填充的方法进行所述数据帧的时长拉伸处理。
其中,在待输出的数据帧经过获取模块11处理后,若判断获知需要进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的所述数据帧,则由时长拉伸处理模块14对待输出的数据帧进行处理。
本实施例的装置,可以用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (14)

  1. 一种数据帧的处理方法,其特征在于,包括:
    获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度;
    根据所述实际时长调整长度对所述数据帧进行时长缩减处理。
  2. 根据权利要求1所述的方法,其特征在于,所述结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度包括:
    对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述缓存器中当前缓存数据的数据长度作为所述实际时长调整长度;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,所述中间时长调整长度是根据所述帧长获得的,所述最大时长调整长度是所述帧长对应的最大时长调整长度。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述实际时长调整长度对所述数据帧进行时长缩减处理包括:
    根据所述实际时长调整长度,采用直接去掉样点的方法进行所述数据帧的时长缩减处理。
  4. 根据权利要求1所述的方法,其特征在于,所述结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度包括:
    对于包括的重复数据的周期个数大于或等于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述实际时长调整长度设置为0;若所述预期时长调整 长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为所述重复数据的长度。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述实际时长调整长度对所述数据帧进行时长缩减处理包括:
    根据所述实际时长调整长度,采用对所述重复数据进行加窗并叠接的方法进行所述数据帧的时长缩减处理。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,在所述结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度之前,还包括:
    根据预设的采样率,对所述待输出的数据帧进行降采样处理,并获取所述重复数据的长度。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述方法还包括:
    若判断获知需要对所述数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,则采用零值填充或噪声填充的方法进行所述数据帧的时长拉伸处理。
  8. 一种数据帧的处理装置,其特征在于,包括:
    获取模块,用于获得待输出的数据帧以及所述数据帧对应的预期时长调整长度,若判断获知需要对所述数据帧进行时长缩减处理,则结合缓存器中当前缓存数据的数据长度和所述预期时长调整长度,确定所述数据帧对应的实际时长调整长度;
    时长缩减处理模块,用于根据所述实际时长调整长度对所述数据帧进行时长缩减处理。
  9. 根据权利要求8所述的装置,其特征在于,所述获取模块具体用于:
    对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述缓存器中当前缓存数据的数据长度作为所述实际时长调 整长度;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中,所述预期时长调整长度为中间时长调整长度与最大时长调整长度中较小的,所述中间时长调整长度是根据所述帧长获得的,所述最大时长调整长度是所述帧长对应的最大时长调整长度。
  10. 根据权利要求9所述的装置,其特征在于,所述时长缩减处理模块具体用于:
    根据所述实际时长调整长度,采用直接去掉样点的方法进行所述数据帧的时长缩减处理。
  11. 根据权利要求8所述的装置,其特征在于,所述获取模块具体用于:
    对于包括的重复数据的周期个数大于或等于阈值的所述待输出的数据帧,判断所述预期时长调整长度是否超过所述缓存器中当前缓存数据的数据长度,若所述预期时长调整长度超过所述缓存器中当前缓存数据的数据长度,则将所述实际时长调整长度设置为0;若所述预期时长调整长度不超过所述缓存器中当前缓存数据的数据长度,则将所述预期时长调整长度作为所述实际时长调整长度;其中所述预期时长调整长度为所述重复数据的长度。
  12. 根据权利要求11所述的装置,其特征在于,所述时长缩减处理模块具体用于:
    根据所述实际时长调整长度,采用对所述重复数据进行加窗并叠接的方法进行所述数据帧的时长缩减处理。
  13. 根据权利要求8至12任一项所述的装置,其特征在于,所述装置还包括:
    采样模块,用于根据预设的采样率,对所述待输出的数据帧进行降采样处理,并获取所述重复数据的长度。
  14. 根据权利要求8至13任一所述的装置,其特征在于,所述装置还包括:
    时长拉伸处理模块,用于若判断获知需要对所述数据帧进行时长拉伸处理,对于包括的重复数据的周期个数小于阈值的所述待输出的数据帧,则 采用零值填充或噪声填充的方法进行所述数据帧的时长拉伸处理。
PCT/CN2015/071635 2014-06-30 2015-01-27 数据帧的处理方法和装置 WO2016000448A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410309383.0 2014-06-30
CN201410309383.0A CN105207955B (zh) 2014-06-30 2014-06-30 数据帧的处理方法和装置

Publications (1)

Publication Number Publication Date
WO2016000448A1 true WO2016000448A1 (zh) 2016-01-07

Family

ID=54955396

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071635 WO2016000448A1 (zh) 2014-06-30 2015-01-27 数据帧的处理方法和装置

Country Status (2)

Country Link
CN (1) CN105207955B (zh)
WO (1) WO2016000448A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107666375A (zh) * 2016-07-28 2018-02-06 北京数码视讯科技股份有限公司 一种数据传输方法及装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104775A (zh) * 2009-12-18 2011-06-22 华为技术有限公司 一种帧率调整方法和装置
CN103167320A (zh) * 2011-12-15 2013-06-19 中国电信股份有限公司 音视频同步方法、系统及手机直播客户端

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE602005024825D1 (de) * 2004-08-30 2010-12-30 Qualcomm Inc Verfahren und vorrichtung für einen adaptiven de-jitter-puffer
TWI305101B (en) * 2006-03-10 2009-01-01 Ind Tech Res Inst Method and apparatus for dynamically adjusting playout delay
CN101335796B (zh) * 2008-07-25 2011-01-19 华为技术有限公司 解码调度方法和装置
EP2748814A1 (en) * 2011-08-24 2014-07-02 Huawei Technologies Co., Ltd Audio or voice signal processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104775A (zh) * 2009-12-18 2011-06-22 华为技术有限公司 一种帧率调整方法和装置
CN103167320A (zh) * 2011-12-15 2013-06-19 中国电信股份有限公司 音视频同步方法、系统及手机直播客户端

Also Published As

Publication number Publication date
CN105207955A (zh) 2015-12-30
CN105207955B (zh) 2019-02-05

Similar Documents

Publication Publication Date Title
US10158825B2 (en) Adapting a playback of a recording to optimize comprehension
EP1497937B1 (en) Apparatus and method for synchronization of audio and video streams
RU2507707C2 (ru) Способ и устройство управления воспроизведением видео- и аудиоданных
US11380338B2 (en) Signal processing methods and apparatuses for enhancing sound quality
US10123040B2 (en) Intra-coded video frame caching for video telephony sessions
US8831001B2 (en) Device, system, and method of voice-over-IP communication
JP5894286B2 (ja) ジッタバッファの管理方法及びこれを利用するジッタバッファ
US20100110892A1 (en) Network system, adjusting method of data transmission rate and computer program product thereof
CN109168083B (zh) 一种流媒体实时播放方法及装置
US9916837B2 (en) Methods and apparatuses for transmitting and receiving audio signals
US8194706B2 (en) Method of transmitting data in a communication system
CN107517400B (zh) 流媒体播放方法及流媒体播放器
US20180192090A1 (en) Method of implementing audio and video live broadcast and server
US20110137984A1 (en) Method and apparatus for supporting multimedia streaming service
KR20170082901A (ko) 재생 지연 조절 방법 및 이를 적용한 전자 장치
WO2013026203A1 (en) Audio or voice signal processor
US11050805B2 (en) Method of controlling stream buffer in media playback device and related buffering device
WO2016000448A1 (zh) 数据帧的处理方法和装置
KR101516113B1 (ko) 음성 복호 장치
US9313338B2 (en) System, device, and method of voice-over-IP communication
US7796626B2 (en) Supporting a decoding of frames
CN106331847B (zh) 音视频播放方法及设备
US20210075843A1 (en) Quality Metadata Signaling for Dynamic Adaptive Streaming of Video
US20230059063A1 (en) Method and device for adaptive playout of media content
KR102422794B1 (ko) 재생지연 조절 방법 및 장치와 시간축 변형방법 및 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15815563

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15815563

Country of ref document: EP

Kind code of ref document: A1