The invention relates to a method of managing the storing of data packets into storage space of a buffer.
Full-motion digital television requires a large amount of storage and data transfer bandwidth. Thus, digital television systems use video compression algorithms to reduce the amount of necessary storage and data transfer bandwidth. Current digital television systems use MPEG or MPEG-2 encoding to reduce the required data transfer bandwidth. MPEG-2 is defined in ITU-T H.222.0 (ISO/IEC 13818-1) “Generic Coding of Moving Pictures And Associated Audio Information”. Thus, audiovisual sequences, such as movies or other content, are stored on the media server in an MPEG-2 compressed format, and the audiovisual sequence is decoded and typically converted to analog format for display and/or delivering to a user.
It has been well-known that a transport stream (TS) according to MPEG2, is a stream comprising compressed digital video, compressed digital audio, and the like. The TS is used in digital broadcasting, and contains multi-plexed plural programs.
There are two types of MPEG-2 receivers used. First, in set-top boxes, the incoming MPEG-2 TS packets are processed by a dedicated hardware function, i.e., MPEG-2 TS demultiplexers which are able to handle the incoming bit-stream. In this case, there is no data overflow. Moreover, if an exception were to occur such as temporary loss of signal, the MPEG-2 TS reader would easily be able to resynchronize by use of dedicated hardware functions.
The second type of MPEG-2 receiver is the use of a PC using PCI or USB interfaces. Typically, PCI MPEG2-TS receivers are PCI masters, and no FIFO overflow occurs because MPEG2-TS packets are written into the PC system memory by a dedicated hardware. Moreover, USB MPEG2-TS receivers generally use isochronous USB endpoints to transfer the MPEG2-TS packets, which guarantee a data read bit rate with the main drawback in this type of transfer being that it reserves the USB bandwidth whatever the actual bit rate.
Therefore, all these MPEG-2 receivers do not experience overflow, at the cost of high complexity.
On the other hand, there are more simple USB MPEG-2 TS receivers that do not use USB isochronous endpoints.
However, problems of data overflow and overflow management can occur in these receivers, whatever the transmission mode, satellite, cable or terrestrial. Conventionally, overflow management is unable to guarantee a data read bit rate greater than the received data bit rate (e.g., a PC which can temporarily be overloaded) and cannot maintain the synchronization required for the MPEG-2 TS packets. Specifically, it is critical to guarantee that the MPEG-2 TS reader can receive full MPEG-2 TS packets and stays synchronized if its data read bit rate is temporally lower than the received bit rate.
Therefore, there is a need for an improved method and system for storing data packets and managing overflow situation in a simple and thus economical way.
Accordingly, the invention provides an improved method of storing data packets according to claim 1. Other features of the method are recited in the dependant claims 2-5.
The invention further provides a system for storing data packets according to claim 6 or 7.
The invention further provides a MPEG-2 TS receiver according to claim 8, and a computer program product according to claim 9.
The buffer 12 comprises eight data cells, dc1 to dc8, intended to store data. Each is associated with a unique address. The buffer 12 may be implemented in a Random Access Memory (RAM) of a computer.
In this description, data cells and data blocks have the same size, for instance one byte. Of course, they can also have different sizes.
The managing means 14 comprise a read pointer management unit 16 and a write pointer management unit 18.
The read pointer management unit manages a read pointer R indicating the location in the buffer storage space 12 of a data cell whose data are to be read. In
The write pointer management unit 18 manages a write pointer W indicating the location in the buffer storage space 12 of a data cell where data are to be written. In
Both pointers R and W proceed over the buffer storage space along a same proceeding loop path that goes from data cell dc1 to data cell dc8, then goes back to data cell dc1.
The managing means 14 are further able to store the address of a data cell where the first data block of a data packet is written. This will be explained below.
Preferably, the read/write pointers are stored in a pointer register (not shown).
In the overflow situation of
In the example depicted, the first three data blocks db1, db2, and db3 have been received and their corresponding data A, B and C have been written. However, it is not possible to write data D of the received data block db4.
The managing of storing data packets comprises a data packet reading method, shown in
Referring to
The method continues with a step 32 of testing if readable data are written in the next data cell. If this is not the case, i.e. if the write pointer indicates this next data cell, then writing of new data is waited, which is represented by arrow 34 leading back to testing step 32.
If there is readable data, i.e. if the write pointer does not indicate the next data cell, then the method continues with a step 36 of incrementing the read pointer R so that it indicates the next data cell, and goes back to the reading step 30.
Now, referring to
The method then comprises a step 42 of testing if there is enough free storage space for writing a new subsequently received data block. This is achieved by determining the storage space over the proceeding loop path from the write pointer to the read pointer.
If there is enough free storage space, i.e. if the write pointer W is not equal to the read pointer R, then the method continues with a step 44 of writing the received data block in the data cell indicated by the write pointer W, and incrementing the write pointer W so that it indicates the next data cell of the proceeding loop path.
If the written data block is the first block of a data packet, for instance the data block db1 of the data packet DP of
If there is not enough free storage space, i.e. if the write pointer W is equal to the read pointer R, then the method goes on with a step 48 of ceasing to write received data blocks of the current data packet, and shifting the write pointer W to the location address of the first written data block of the data packet that is currently being received, which location address was saved at step 46.
Then, in a waiting step 50, new received data blocks of the current data packet are discarded, i.e. not written into the buffer 12. Upon reception of a first block of a new data packet, the method goes back to receiving step 40.
Because of the shifting of the write pointer W, received data blocks of the next data packet can advantageously be written over the already written data blocks of the previous data packet.
Actually, in many applications such as MPEG-2 data reception, an incomplete data packet cannot be used and is then discarded by the application using the buffer 12.
Overwriting this data packet provides more free storage space for the subsequent data packet, thus reducing the chance that overflow occurs again.
Number | Date | Country | Kind |
---|---|---|---|
05292080.8 | Oct 2005 | EP | regional |