IMPROVEMENTS IN OR RELATING TO SWITCHING BETWEEN COMPRESSED BITSTREAMS

Abstract: According to one aspect of the present invention, there is provided a method of switching from a first bitstream to a second bitstream, in a system having a decoder with a buffer through which the bitstream is transmitted, the method comprising: stopping the decoder from carrying out the decoding process in a predetermined manner at a predetermined point on the first bitstream, such that the buffer is substantially emptied; and restarting the decoder in a controlled manner at a predetermined position on the second bitstream, thereby switching from the first bitstream to the second bitstream. This invention allows insertion of additional programs, advertisements and the like into a standard MPEG stream without any of the disadvantages experienced using the hooks provided for in MPEG-2. One advantage of the proposed method is its simplicity. In terms of the MPEG-2 standard it requires intervention essentially only at the transport layer. The transport packet headers in MPEG-2 indicate the start of packets of elementary streams (PES packets). This flag is used for the control of all events in the switching process. The invention also allows for simple insertion of additional information in other types of bitstream.

Description: Improvements in or relating to Switching between compressed bitstreams This invention relates to improvements relating to switching between compressed bitstreams. Particularly but not exclusively to insertion of regional programs or advertisements to the compressed bitstream. In the field of digital transmission of information, including broadcasting, data for transmission may undergo compression to reduce the amount of bandwidth required to transmit the information. The method by which the information is compressed is standardised. This means that information can be compressed and decompressed by all users in a known manner. The description below is based on the requirements for switching a video bitstream which has been compressed according to the ISO/IEC international standard 13818, also known as "MPEG-2". Although the same principle can be used for audio signals and indeed for any bitstream with timing information. An MPEG transmission system allows several video, audio and associated services to be multiplexed and sent over a single digital transmission channel. The information to be transmitted is compressed into a single continuous transport stream, with the different programs, data, advertisements etc. at different points along the stream. Compression of video signals makes use of the spatial and temporal redundancy, i.e. predictability of the source signal to reduce the data rate of the compressed signal. This means that the decoded signal is, to a large extent, dependent on the coding history of the signal. A switch from one compressed signal to another at an arbitrary point will, therefore, generally result in a total break-up of the displayed picture, recovering only after synchronisation is regained in the decoding algorithm. Furthermore, even if the switch between the compressed bitstreams is carefully timed to coincide with the start of a new sequence, the occupancy of the decoding buffer after the switch is generally not defined resulting in possible buffer overflow or underflow some time after the switch. This scenario is further complicated when the bitstreams are encrypted as would be common for a Pay-TV channel. Accordingly, one object of the present invention is to provide a method and apparatus which will allow seamless or near seamless insertion of additional information in a bitstream, for example, a transport stream. According to one aspect of the present invention, there is provided a method of switching from a first bitstream to a second bitstream, in a system having a decoder with a buffer through which the bitstream is transmitted, the method comprising: stopping the decoder from carrying out the decoding process in a predetermined manner at a predetermined point on the first bitstream, such that the buffer is substantially emptied; and restarting the decoder in a controlled manner at a predetermined position on the second bitstream, thereby switching from the first bitstream to the second bitstream. This invention allows insertion of additional programs, advertisements and the like into a standard MPEG stream without any of the disadvantages experienced using the hooks provided for in MPEG-2. One advantage of the proposed method is its simplicity. In terms of the MPEG-2 standard it requires intervention essentially only at the transport layer. The transport packet headers in MPEG-2 indicate the start of packets of elementary streams (PES packets). This flag is used for the control of all events in the switching process. The invention also allows for simple insertion of additional information in other types of bitstream. According to a second aspect of the present invention there is provided apparatus for switching from a first bitstream to a second bitstream, in a system having a decoder with a buffer through which the bitstream is transmitted, comprising: means for causing the decoder to stop the decoding process in a predetermined manner at a predetermined point on the first bitstream, such that the buffer is substantially emptied; and means for causing the decoder to restart in a controlled manner at a predetermined position on the second bitstream, thereby switching from the first bitstream to the second bitstream. Reference will now be made, by way of example, to the accompanying drawings, in which: Figure 1 is a timing diagram of the switching process according to one aspect of the present invention; and Figure 2 is a block diagram of the proposed switching circuit for accomplishing the invention. A method is described below which avoids the problems of the prior art by going through a sequence of events such that the decoder will re-gain synchronisation with the new bitstream in a defined and consistent way, and with only a freeze-frame effect on the displayed picture or a short mute in audio. Optional insertion of a marker signal indicating that a switch is imminent can make the decoding more robust and help to achieve a faster switch. Although video switching is discussed below, the same principle can be used for audio signals and indeed for any bitstream with timing information. The principle behind the proposed system is the emulation of a receiver or decoder channel change in the switching circuit, i.e. the bitstream being fed to the decoders in the receiver is essentially the same as if the user had locally changed to a different channel. When the user changes channel the decoder buffers are flushed and decoding re-starts on the new channel. To achieve the same effect in a switch upstream of the decoder the bitstream is interrupted for a short period of time. The duration of the interruption is just long enough to make sure that the decoding buffer in the receiver is completely emptied. This forces the decoder to re-start the decoding process as soon as the signal transmission is resumed. Insertion of an end-of- sequence marker just prior to the interruption makes sure that the bitstream remains compliant to the standard throughout the switching process and helps the decoder to re-gain synchronisation more quickly by giving advanced warning of the signal interruption. This ensures that a clean transition from the first bitstream to the second bitstream occurs, such that the transition appears to be seamless to the viewer. Figure 1 shows a timing diagram of the switching process. Initially, input bitstream 1 is selected. The switching process is initiated by an external request. PES packet 1a remains switched to the output until the start of the next PES packet 1 b. At this point the switching sequence starts by inserting an optional end-of-sequence header into the bitstream and starting the guard interval. The guard interval is calculated as the time it takes to empty the receiver buffer, i.e. t guard = buffer size / bitrate After the guard interval the bitstream remains switched off until the arrival of the next PES packet of the new bitstream. At that stage input bitstream 2 is switched to the output and the switching process is complete. Figure 2 shows a block diagram of an example implementation of the proposed system. Part of a decoder or receiver 20 is shown, in which a decoder buffer 22 is represented. It is assumed that switching should occur between two independent transport streams 24, 26. The transport packets of the two streams are aligned using a FIFO 28 in one of the two input paths 30, 32. The transport headers of both streams are decoded at filters 34, 36 and the information, i.e. transport-packet-identification (PID), payload-unit-start- indicator, etc. is passed on to the control circuit 38. The transport packet headers are unencrypted, even if the payload is encrypted, so this information is always available. The control circuit also receives the switching request, for example, from an external control computer. After a switching request is received the control circuit goes through the sequence of events as shown in Figure 1 by selecting one of the four signal sources. The transport packet identification (PID) in the transport packet headers of the video PES packets in input transport stream 2 and the sequence-end-code inserter are adjusted such that they match those in the transport packet headers of the video PES packets in input transport stream 1. The Program Specific Information (PSI) carried in the transport stream to enable a decoder to locate the various components (e.g. video, audio) of a program in the transport stream is not changed during the switching process. If the PSI is changed the decoder will detect this change at some indeterminate time, and commence to reconfigure itself, flush its buffers and attempt to resynchronise with the incoming bitstream. By changing the transport-packet-identification (PID) fields in the headers of the transport packets to those used by the original program, changing the PSI is not required, and this ensures that the decoder is in a known state throughout the switching process. If transport stream 26 is encrypted, it is necessary to deliver the Entitlement Control Messages (ECMs) associated with that stream to the decoder ahead of the packets containing the program components, in order that they can be decrypted by the decoder to obtain the key used to encrypt the program. These messages replace those from input transport stream 24 immediately the request to switch is received, and the PID field in the header is adjusted to match that of the equivalent messages in transport stream 24. The switch to PES packets from transport stream 26 should be delayed for long enough to ensure that the encryption key carried in the ECMs is available at the receiver before the PES packets from transport stream 26 are received. Irrespective of the state of the transport-scrambling-control field in the packet headers of transport streams 24 and 26, the packets from the sequence-end-code inserter are unencrypted, and the transport-scrambling- control field should indicate such. As this data contains nothing of any value there is no need for it to be encrypted. In MPEG bitstreams, audio frames may not be aligned with transport stream packets. If such non-aligned bitstreams are spliced at the transport stream layer, e.g. at PES packet boundaries as is the case in video, there is a danger that fragments of audio frames are presented to the decoder at the splice points. This can lead to severe audio distortion and noise levels. This problem can be overcome by processing the bitstreams at the PES layer. At the splice-out position, after the last complete audio frame, the audio bitstream is replaced by a series of zeros to the end of the current PES packet. Similarly, the new PES packet at the splice-in position is replaced with zeros until the first full valid audio frame is found in the target bitstream. Since audio frame headers, in particular, are removed from the bitstream during the splice period, the decoder is forced to stop the decoding process and mute its output until audio frame headers are once again found. Alternatively, MPEG-2 adaptation fields may be used. In this case the audio bitstream is interrupted exactly at the end of an audio frame. The rest of the corresponding transport stream packet is replaced with an empty adaptation field. Similarly, the new bitstream is started up exactly with an audio frame header with the first part of the corresponding transport stream packet replaced by an adaptation field. This invention is of use where additional information is to be included into a transport stream. For example, the insertion of advertisements, regional programs, announcements and the like into a broadcast transport stream. As the present invention takes place at the transport packet level, the insertion of information can occur at regional broadcast stations and main head end broadcast stations. In addition it would be possible to apply the invention not only to the broadcasting of television, but also the broadcast of any other type of signals. The invention provides a clean manner by which information or material can be inserted into a digital transport media.

Claims: CLAIMS 1. A method of switching from a first bitstream to a second bitstream, in a system having a decoder with a buffer through which the bitstream is transmitted, the method comprising: stopping the decoder from carrying out the decoding process in a predetermined manner at a predetermined point on the first bitstream, such that the buffer is substantially emptied; restarting the decoder in a controlled manner at a predetermined position on the second bitstream, thereby switching from the first bitstream to the second bitstream. 2. The method of claim 1 , further comprising providing the first and second bitstreams with timing information. 3. The method of claim 1 or claim 2, further comprising providing the first and second bitstream as first and second transport streams each having one or more packets of information. 4. The method of claim 3, further comprising stopping the decoder at the end of a packet of information in the first bitstream. 5. The method of claim 3 or claim 4, further comprising restarting the decoder at the start of a packet of information of the second bitstream. 6. The method of any preceding claim, further comprising emptying the buffer by allowing the information therein to pass out of the buffer over a time period. 7. The method of claim 6, further comprising calculating the time period as a function of the size of the buffer and the bitrate of the first bitstream. 8. The method of any of claims 1 to 5, further comprising emptying the buffer by flushing the buffer. 9. The method of any preceding claim, further comprising stopping the decoder in response to a user input. 10. The method of any of claims 1 to 8, further comprising stopping the decoder in response to a signal embedded in the first bitstream. 11. The method of any preceding claim, further comprising providing the or each bitstream with encryption information. 12. The method of claim 11 , further comprising providing the encryption information at a known location in the second bitstream. 13. The method of any preceding claim, further comprising adjusting any control information relating to the second bitstream to be equivalent to that of the first bitstream. 14. Apparatus for switching from a first bitstream to a second bitstream, in a system having a decoder with a buffer through which the bitstream is transmitted, comprising: means for causing the decoder to stop the decoding process in a predetermined manner at a predetermined point on the first bitstream, such that the buffer is substantially emptied; and means for causing the decoder to restart in a controlled manner at a predetermined position on the second bitstream, thereby switching from the first bitstream to the second bitstream. 15. The apparatus of claim 14, wherein the first and second bitstreams are provided with timing information. 16. The apparatus of claim 14 or claim 15, wherein the first and second bitstream comprise first and second transport streams each having one or more packets of information. 17. The apparatus of claim 16, wherein the decoder is stopped at the end of a packet of information in the first bitstream. 18. The apparatus of claim 16 or claim 17, wherein the decoder is restarted at the start of a packet of information of the second bitstream. 19. The apparatus of any preceding claim, wherein the buffer is emptied by allowing the information therein to pass out of the buffer over a time period. 20. The apparatus of claim 19, wherein the time period is calculated as a function of the size of the buffer and the bitrate of the first bitstream. 21. The apparatus of any of claims 14 to 18, wherein the buffer is flushed. 22. The apparatus of any preceding claim, wherein the decoder is stopped in response to a user input. 23. The apparatus of any of claims 14 to 21 , wherein the decoder is stopped in response to a signal embedded in the first bitstream. 24. The apparatus of any preceding claim, wherein the or each bitstream includes encryption information. 25. The apparatus of claim 24, wherein the encryption information is at a known location in the second bitstream. 26. The apparatus of any of claims 14 to 25, wherein any control information relating to the second bitstream is adjusted to be equivalent to that of the first bitstream. 27. The apparatus of any of claims 14 to 26, wherein the buffer is completely emptied.

Inventors: BOCK ALOIS MARTIN, DALLARD NIGEL STEPHEN, BOCK, ALOIS, MARTIN, DALLARD, NIGEL, STEPHEN
Applicants: BOCK ALOIS MARTIN, DALLARD NIGEL STEPHEN, NDS LTD, BOCK, ALOIS, MARTIN, DALLARD, NIGEL, STEPHEN, NDS LIMITED
Application year: 1997
Main classification: H04N7
IPC codes: H04N7