Method and apparatus for buffer management
Field of invention
The invention relates to a method and a device for management of a buffer for buffering data portions of a media stream.
Description of prior art
Recently the transmission of media streams via packet-based networks has developed rapidly and is a major application for the packet based fixed and mobile networks. Examples for media streams are audio streams comprising audio data portions, video streams comprising video data portions and multimedia streams comprising audio and video data portions. For 3rd generation mobile networks media streaming has been standardized in the technical specification (TS) 26.233 and the TS 26.234 of the 3GPP (3rd Generation Partnership Project).
A packet-based network for providing media-streaming services comprises a streaming server for transmitting media streams towards a streaming client. Additionally a packet- based network could also comprise a streaming proxy in the transmission path for the media stream, said streaming proxy performing as a streaming client towards the streaming server and as a streaming server towards the streaming client.
h order to cope with variations of the data rate at which the media stream is played out and in order to cope with variations of the data rate at which the media stream is transmitted via the network, the streaming client comprises a buffer, e.g. a memory unit for temporarily storing data portions of the media stream. The buffer stores incoming data portions and transmits data portions to a data sink. The buffer has a certain capacity and a change of the fill level of the buffer can compensate for the variations of the data rate at which data portions are stored in the buffer or transmitted towards the data sink.
Similarly a streaming proxy may comprise a buffer to cope with a variation of the rate of the transmission from the streaming server or the transmission towards the streaming client.
Nariations of the data rate at which a media stream is transmitted are particularly relevant in case of a bursty transmission, such as a transmission via HSDPA (High Speed Data Packet Access).
In case of an overflow of a buffer for a media stream an incoming data portion for the buffer is dropped and is thus not available at the streaming client to be played out. This results in potentially severe degradation of the perceivable quality of the media stream.
Object of the invention
Therefore it is object of the invention to provide a method and a device for management of a buffer for a media stream that avoids a severe degrading of the perceivable quality of the media stream.
Summary of the invention
This object is achieved by the method of claim 1 and the control unit of claim 10. Advantageous embodiments are described in the depending claims.
According to the invention a method for management of a buffer for buffering data portions of a media stream is provided, the method comprising the steps of:
- determining for a data portion received for the buffer a relevance of the respective data portion for a presentation of the media stream,
- receiving a current data portion for the buffer,
- detecting that the buffer has reached a fill level, and
- selecting according to the determined relevance a data portion to be discarded.
Management of a buffer comprises a handling as well as an avoiding of an overflow at the buffer.
In an advantageous embodiment of the invented method the data portion to be discarded is selected within the data portions in the buffer and- the current data portion. According to a further embodiment of the invention the relevance of a respective data portion for the presentation of the media stream is assigned according to an expected quality of a decoded signal obtained using the data portion.
The expected quality of the signal may be an expected error ratio of signal decoded from the media stream, or a measure of the expected quality of the decoded signal, as it is perceivable by an end user.
By this the quality of the decoded signal may be optimized.
According to another embodiment of the invented method the relevance of the respective data portion for the presentation of the media strea is assigned according to its relevance for an expected quality of a signal decoded from a portion of the media stream.
By this the potential influence of a discarding of a selected data portion on the quality of a signal decoded using further data portions may be taken into account, when determining the relevance of a data portion.
According to yet another embodiment of the invented method the relevance of the respective data portion for the presentation of the media stream is assigned according to an expected quality of a signal decoded from the data portion.
By this data portions already discarded and by this influencing an obtainable quality of a decoded signal when using a particular data portion may be taken into account when selecting the particular data portion to be discarded.
In a further embodiment of the invented method the media stream comprises independent data portions being independent from other data portions and dependent data portions being dependent on at least one reference data portion, and wherein independent data portions are assigned a higher relevance for the presentation of the media stream then dependent data portions.
Generally an independent data portion is more important for the presentation of a media stream as the number of further data portions depending on its availability as a reference data portion is generally larger for independent data portions then for dependent data portions.
An example for a kind of independent data portions for a video stream according to the MPEG (motion pictures expert group) are so called I- (intra-) frames, being encoded as a stand-alone still image. Examples for dependent data portions are so called P- (predictive-) frames, being encoded using a temporally preceding frame and B- (bidirectional predictive) frames, being encoded using a temporally preceding and a temporally succeeding frame.
In an a another embodiment of the invented method a distance of an independent data portion to a dependent data portion is determined and wherein a less distant dependent data portion is assigned a higher relevance for the presentation of the media stream than a more distant dependent data portion.
This can be used as a simple measure for the number of further data portions depending on a respective data portion.
In yet another embodiment of the invented method, the media stream comprises video data portions and audio data portions and audio data portions are assigned a higher relevance for the presentation of the media stream than video data portions or vice versa.
By this the quality of the presentation of either the video or the audio part of the media stream can be optimized.
Advantageously the selected data portion is discarded.
The invention is further embodied in a control unit for management of a buffer for buffering data portions of a media stream, comprising: a determining unit for determining for a data portion received for the buffer a relevance of the respective data portion for a presentation of the media stream, an input unit for receiving a current data portion for the buffer,
a fill level detection unit for detecting that the buffer has reached a fill level, and a selection unit for selecting according to the determined relevance a data portion to be discarded.
In an advantageous embodiment of the control unit the selection unit is adapted to select the data portion to be discarded within the data portions in the buffer and the current data portion.
In a further embodiment of the control unit the determining unit is adapted to determine the relevance of the respective data portion for the presentation of trie media stream that is assigned according to an expected quality of a decoded signal obtained using the data portion.
The control unit may be implemented in a receiving device such as a streaming client or in a proxy server performing as a streaming client towards a streaming server and as a streaming server towards a streaming client.
Brief description of the drawings : .
Fig. 1 depicts a method for management of a buffer embodying the present invention.
Fig. 2 depicts a method for assigning a relevance to a data portion that may be used within invented method for buffer management.
Fig. 3 depicts a further method for assigning a relevance to a data portion that may be used within the invented method for buffer management.
Fig. 4 depicts a control unit embodying the invention.
Detailed description of embodiments
Fig. 1 depicts a flow chart describing potential steps of a method embodying the invention.
The depicted method may be performed in a control unit for management of a buffer for buffering a media stream. Both the control unit and the buffer may "be embodied in a
streaming client for receiving data portions or a proxy node being intermediate between a streaming server and a streaming client. The media stream may be a "video stream comprising video data, an audio stream comprising audio data or a multimedia stream comprising audio data and video data.
In a preliminary step SO a current data portion is received for the buffer. This may be physically realized in that the current data portion is received in a further buffer upstream to the main buffer. In practical embodiments the upstream buffer will be substantially smaller than the main buffer:
The current data portion may be a frame of a media stream, such as an audio frame or a video frame. Furthermore the current data portion may be a data packet e.g. an IP (internet protocol) packet transmitting media data.
After the current data portion is received for the buffer, the relevance of the current data portion for a presentation of the media stream may be determined in a determining step SI.
The relevance of the current data portion may be assigned during encoding of the data portion and encoded with the data portion. In this case the determining step SI comprises reading the encoded relevance from the current data portion. Alternatively the relevance may be determined during encoding of the data portion and signalled- to the control unit. According to a further alternative the current data portion may be processed to obtain a relevance of the data portion that is assigned to the data portion with the determining step SI. Further, infonnation stored in the current data portion, such as information about the kind of the data portion may be used to assign the relevance of the data portion for the presentation of the media stream.
To assign a relevance for a presentation of the media stream several methods can be used.
E.g. an expected quality of a decoded signal obtained using the data portion may be estimated and used to assign the relevance to the data portion. For that an expected error ratio of signal decoded from the media stream may be estimated and -used as a measure of the expected obtainable quality of the decoded signal, as it is perceivable by an end user.
The obtainable decoded signal may require further data portions to be correctly decoded and the potential influence of a discarding of a data portion on the quality of a signal decoded using further data portions may be taken into accoutxt, when determining the relevance of a data portion.
According to another method to assign a relevance to a data portion for the presentation of the media stream an obtainable quality of a signal decoded from the data portion may be taken into account.
For this data portions already discarded and by this influencing an obtainable quality of a decoded signal when using a particular data portion may be taken into account when assigning a relevance to the particular data portion.
The media stream may comprise independent data portions being independent from other data portions and dependent data portions being dependent on at least one reference data portion, and independent data portions may be assigned a higher relevance for the presentation of the media stream then dependent data portions.
Generally an independent data portion is more important for the presentation of a media stream than a dependent data portion as the number of further data portions depending on its availability as a reference data portion is generally larger for an independent data portion than for a dependent data portion.
Alternatively or additionally a distance of an independent data portion to a dependent data portion may be determined and a less distant dependent data portion may be assigned a higher relevance for the presentation of the media stream than a more distant dependent data portion.
For a media stream comprising video data portions and audio data portions audio data portions may be assigned a higher relevance for the presentation of the media stream than video data portions or vice versa.
For the current data portion a check is performed in a third step S3, whether the buffer has reached a certain fill level. The fill level may be a predetermined fill level,
advantageously taking into account a certain margin below a maximum possible fill level of the buffer. Alternatively a margin below the maximum possible fill level may be calculated according to the size of the current data portion, e.g. the performed check is a check whether the available storage capacity of the buffer exceeds the size of the current data portion.
If the buffer has not yet reached the above described fill level the current data portion is stored in the buffer in a second step S2, and the algorithm continues with a replica of the preliminary step SO performed on a next data portion received for the buffer.
If the buffer has reached the above described fill level, a fourth step S4 is performed and a data portion to be discarded is selected within the data portions in the buffer.
If not yet performed in the first step SI, a relevance for each of the data portions in the buffer maybe performed upon the. fourth step S4 of detecting reaching a fill level. To determine the relevance of a respective data portion any of the a"bove methods may be used. . .
Advantageously the data portion to be discarded is selected within data portions in the buffer and the current data portion. The data portion to be discarded is selected according to the determined relevance of a respective data portion for the presentation of the media stream. Advantageously a least relevant data portion, i.e. a data portion least relevant for the presentation of the media stream is selected to be discarded.
In an embodiment of the invention the selected data portion is discarded in a fifth step S5. If a packet within the buffer has been discarded the method continues with a replica of the third step S3, i.e. a check is performed on the current data portion, whether the available storage capacity of the buffer is sufficient for storing t ie current data portion and, if needed, the loop comprising the third to fifth step S3 - S5 is continued until the available storage capacity of the buffer exceeds the size of the current data portion. Then, the current data portion is stored in the buffer in a replica of the second step S2.
If the current data portion has been selected in the fourth step S4 and later on been discarded in the fifth step S5 the algorithm continues with a replica of the preliminary step SO performed on a next data portion received for the buffer.
In an embodiment of the invented method a least significant data portion is selected within the buffer in the fourth step S4 and the selected data portion is marked to be potentially discarded instead of being discarded immediately after being selected. The size of the data portion is determined, and the determined size is memorized. After that, as indicated by the dashed arrow, the algorithm continues with an adaptation of the third step S3, in that a check is performed whether the current fill level minus the size of the selected data portion would provide an available storage capacity that exceeds the size of the current data portion, i.e. a check whether the discarding of the selected data portion would free enough memory of the buffer to enable storing the current data portion in the buffer.
If this is the case the selected data portion within the buffer is discarded in a replica of the fifth step S5. If not, i.e. if discarding the selected data portion would not free enough of the buffer capacity to enable storing the current, data portion, the method continues with a replica of the fourth step S4, in that a least relevant data portion is selected within the buffer and the current data portion, but the marked data portion is not taken into account when determining the least relevant data portion. The replica of the third and the fourth step S3 and S4 are continued selecting and marking further data portions until discarding of the selected data portions would free enough memory of the buffer to enable storing the current data portion in the buffer or until the current data portion is selected as least relevant data portion.
If the selected data portions would free enough memory of the buffer to enable storing the current data portion, the selected and data portions are discarded and the current data portion is stored in the buffer. If the current data portion is selected as least relevant data portion, the current data portion is discarded and marking the previously selected data portions within the buffer is removed. With this an unnecessary deleting of data portions within the buffer can be avoided.
Fig. 2 illustrates operations of a method for assigning a relevance to a data portion of a media stream. The method of figure 2 may be performed in supporting the determining step SI of the method depicted in figure 1.
First, in an operation 302 it is determined whether a current data portion requires a further data portion to obtain a decoded signal using the current data portion, i.e. whether it requires a reference data portion. Depending on the used codec, there may be interdependencies between data portions, i.e., for the decoding process of one data portion another data portion may be required. For example, in a predictive coding scheme such data portion dependencies are present.
According to an example, in a video sequence of images, a data portion may contain image information, for example, of pixels making up one frame of the video sequence. Alternatively, in a sequence of images making up the video stream, a data portion may contain difference information between a previous frame and a current frame. The current frame can then be calculated by combining the difference information and the image information of the previous data portion. Accordingly, at the receiving device the previous data portion is required in order to appropriately obtain or decode the current data portion. Moreover, data portions are conceivable, which simply contain information indicating that there was no change between the previous data portion and the current data portion. Accordingly, dependencies may exist from a current data portion to a previous data portion or elements, the previous data portion(s) thus being required at the receiving device for decoding the current data portion.
According to the terminology of the MPEG (motion pictures expert group) independent data portions for a video stream are so called I- (intra-) frames, being encoded as a standalone still image. Dependent data portions being encoded usiag a temporally preceding frame are called P- (predictive-) frames, and frames being encoded using a temporally preceding and a temporally succeeding frame are termed B- (bi-directional predictive) frames.
In operation 302 the current data portion may be analysed to determine whether a dependency to a previous data portion exists. This information may be obtainable from
the data portion itself, or may be derivable from a data portion type. Further, in operation 302 the identity of the required reference data portion is determined.
In an operation 303 it is decided, whether a reference data portion is required. If in operation 303 the decision is "NO", indicating that no reference data portion is required, the relevance of the current data portion is determined independently from further data portions in an operation 308. If in operation 303 the decision is "YES", indicating that a reference data portion is required, in an operation 304 it is determined whether the reference data portion has been discarded. Determining whether the reference data portion has been discarded may be performed by a screening o eration on the buffer or by accessing a log file logging previously discarded data portions.
In operation 305 it is then decided whether the reference data portion is available; i.e. whether it has been received for the buffer and not been discarded. If in operation 305 the decision is "YES", the flow continues with operation 306, in which case the relevance of the current data portion is set based to the relevance of the reference data portion. This - reflects the fact, that a decoded signal may be obtained using the current data portion at best only to an extent that a previously decoded signal has been obtained using the reference data portion. I.e. if a previously decoded signal obtained using the reference data portion has been obtained only partly or only partly correct, this will also affect the decoded signal obtainable using the current data portion.
If an operation 305 the decision was "NO", indicating that the reference data portion has not been received or has been discarded, operation 306 is skipped and, advantageously the relevance of the current data portion is determined according to an expected quality of a decoded signal obtainable using the data portion if the reference data portion is not available (not shown). Alternatively the relevance of the current data portion may be set to a predefined minimum value, if the reference data portion is not available.
In an alternative, a current data portion may not only depend on one reference data portion, but may depend on a plurality of such reference data portions. In this case the relevance of the current data portion may be set based on an expected quality of a signal obtained when decoding the current data portion and the group of reference data portions.
Fig. 3 illustrates operations of a further method for assigning a relevance to a data portion of a media stream. The method of figure 3 may be performed in supporting the determining step SI of the method depicted in figure 1.
It was outlined before that a relevance of a current data portion for a presentation of a media stream can be determined on the basis of the an obtainable quality of a signal decoded from a portion of the media stream, said portion comprising the current data portion and also further data portions. The relevance assignment may further include information on the type or nature of the data portion, see the above embodiments. To further improve the assigning of a relevance to a data portion, the relevance of a data portion in the present embodiment is further determined on the basis of an overall improvement of a quality of a decoded signal achievable when using the data portion under consideration, or vice versa on the basis of an overall decrease of a quality of a decoded signal when discarding the data portion under consideration.
In a first operation 501 an overall quality of a signal obtainable when decoding a number of data portions is determined. To obtain a quality measure for a decoded signal several methods known in the art may be used comprising using an error ratio of the decoded signal.
The number of data portions may correspond to a predetermined amount of data, i.e., a predetermined number of data portions may be grouped. Preferably, the group of data portions is selected such that interrelations with other groups of data portions do not exist. Alternatively, however, it is also possible that a grouping of data portions according to playback times at the receiving device are used, or that the entire media stream is considered simultaneously.
Then, in an operation 502 it is assumed that a current data portion is discarded and the effect of the discarding of the current data portion on the quality of the signal decoded from the number of data portions is determined. Thus, in operation 502 a decrease of the signal quality when discarding the current data portion is determined.
For example, if in a sequence of data portions each individual data portion depends from the previous data portion in the sequence, i.e., if each data portion requires information from a preceding data portion for obtaining a decoded a signal at a receiving device, and only the first data portion of the sequence of data portions does not depend on another data portion, the relevance of each data portion except thte first one is zero, as long as the information of the first data portion is not available at the receiving device. Thus, a discarding of the first data portion will lead to a large decrease of the signal quality obtainable using all considered data portions, as only with the first data portion the subsequent data portions can be decoded at the receiving device. Any other data portion in the data portion sequence of this example will have a lesser effect, namely only onto its following data portions.
The above example illustrates that depending on the interrelation between the data portions of the media stream the transmission of a particular data portion may have a , larger or smaller effect on the overall quality of a signal decoded from the media stream.
The potential decrease of a quality of a signal obtainable when decoding the group of . data portions under consideration but excluding the current data portion then is used in an operation 503 for determining the relevance of the current data portion for the quality of the signal decoded from the number of data portions.
According to an alternative, the potential decrease in signal quality, i.e. the potential decrease of the signal quality when discarding the current data portion may be set into perspective to the size of the current data portion. Accordingly, the potential quality decrease determined in operation 502 when discarding trie current data portion may be divided by the size of the current data portion. Thus, the requirements on storage capacity for buffering the current data portion may also be entered into the process of determining a relevance of the data portion.
Figure 4 depicts a control unit CU for management of a "buffer BU for buffering data portions of a media stream. The control unit CU may perform any of the methods for buffer management described above. The control unit CT comprises an input unit IU, a
determining unit DU, a selection unit SU, and a fill level detection unit FD, all of them interconnected.
Both the control unit CU and the buffer BU may be embodied in a streaming client for receiving data portions or a proxy node being intermediate between a streaming server and a streaming client. The media stream may be a video stream comprising video data, an audio stream comprising audio data or a multimedia stream comprising audio data and video data.
The input unit IU is adapted to receive a current data portion of a media stream from a streaming source. To that end the input unit IU may comprise a memory for storing incoming data portions.
The current data portion may be a frame of a media stream, such as an audio frame or a video frame. Furthermore the current data portion may be a data packet e.g. an IP (internet protocol) packet transmitting media data.
The determining unit DU is adapted to determine a relevance of an incoming data portion for a presentation of the media stream.
The relevance of the current data portion may have been assigned during encoding of the data portion and encoded with the data portion. In this case the determining unit DU may comprise a read out unit for reading the encoded, relevance from the current data portion.
Alternatively the relevance may have determined during encoding of the data portion and signalled towards the control unit CU. Then the determining unit DU may comprise a reception unit for receiving a signalling message comprising a relevance of a data portion.
Alternatively the current data portion may be processed to obtain a relevance of the data.
To that end the determining unit DU may comprise a processing unit for processing data portions. Further, infonnation stored in the current data portion, such as information about the kind of the data portion may be used to assign the relevance of the data portion for the presentation of the media stream.
To determine the relevance of the current data portion the determining unit DU may be adapted to perform any of the above-described methods, e.g. the determining unit may determine the relevance of the respective data portion for the presentation of the media stream that is assigned according to an expected obtainable quality of a decoded signal obtained using the data portion.
The fill level detection unit FD is adapted to detennine whether the buffer has reached a fill level. To that end the fill level detection unit may have access to the fill level of the buffer as is depicted by the arrow from the fill level detection unit FD to the buffer BU. Alternatively the buffer BU may send information on the current fill level to the fill level detection unit FD either regularly or according to a current change of the fill level.
The fill level reached may be a predetermined fill level, advantageously taking into account a certain margin below the maximum possible fill level of the buffer BU. Alternatively a margin below the maximum possible fill level may be calculated according to the size of the current data portion, e.g. the performed check is a check whether the available storage capacity of the buffer BU exceeds the size of the current data portion.
The selection unit SU is adapted to select according to the determined relevance a data portion to be discarded. To that end the selection unit SU may be adapted to select the data portion to be discarded within the data portions in the buffer and the current data portion.