Demultiplexing device5835591Abstract The object of the invention is a demultiplexing device. This device is characterized in that it comprises means for storing data of a multiplexed data stream (4), programmable means for storing data filters (8), comparison means (19) between the data of the multiplexed data stream and the data filters, and means (12) for transferring data of the multiplexed data stream to storage means (5) in relation to the comparisons made. The invention has a particular application in the field of digital television reception. Claims We claim: Description FIELD OF THE INVENTION
______________________________________
synchronisation byte
PID H data stream #0
›PID H data stream #1!
›PID H data stream #2!
. . .
›PID H data stream #n!
PID L data stream #0
. . .
›PID L data stream #n!
ECC data stream #0
. . .
›ECC data stream #n!
______________________________________
According to the present exemplary embodiment, n is always less than 9. Concerning the part of the destination memory reserved for the section processor SEC, the number of reserved addresses is also a function of the number of PIDs. The memory contains as many "section/stream" fields as there are distinct data streams. Each field has its own start address (section.sub.-- TR.sub.-- start.sub.-- address). The first byte of each field is zero: it provides verification that the start of section pointer ("pointer.sub.-- field") is zero. The following bytes correspond to the table identifiers ("table.sub.-- id"). A certain number of tables can be defined by the user; the number of identifiers is variable and is equal to filter.sub.-- nb for each field. Then comes a zero semi-byte which will be compared to the high semi-byte of the section length, in order to verify if the section overflows the transport packet. The last part of each field contains a certain number (filter.sub.-- nb) of groups of bytes of a length filter.sub.-- length, which are to be compared to the same number of packet bytes. The number of comparisons to be made for each packet byte will be filter.sub.-- nb.
______________________________________
start of section pointer
table.sub.-- id #0
›table.sub.-- id #1!
. . .
›table.sub.-- id #(n-1)!
high semi-byte of section length
address #0,0
›address #0,1!
. . .
›address #0, (n-1)!
. . .
›address #1,0!
›address #1,1!
. . .
›address #(filter.sub.-- length -1), (filter.sub.-- nb-1)!
The total number of bytes in each field is:
filter.sub.-- nb .multidot. (filter.sub.-- length + 1) + 2
______________________________________
Table 1 shows an example of the destination memory configuration for nine PIDs and an example of section filtering for two different table.sub.-- ids and two groups of 16-bit bytes (that is to say filter.sub.-- nb=2 and filter.sub.-- length=2).
______________________________________
Memory Memory Used by
address
Mask data processor
Remarks
______________________________________
0 0 BF PES Private stream 2
1 0 47 TP Synchronisation byte
2 3 5 MSB of TP
PID0
3 3 5 MSB of TP
PID1
. . . . . .
A 3 5 MSB of TP
PID8
B 0 8 LSB of TP
PID0
C 0 8 LSB of TP
PID1
. . . . . .
13 0 8 LSB of TP
PID8
14 F TP ECC of data stream 0,
complete masking, updated
by TP
. . . . . .
1C F TP ECC of data stream 8,
complete masking, updated
by TP
1D 0 00 SEC Start of section pointer for
the first section/stream
1E du Defined SEC First value sought for
by the table.sub.-- id (table.sub.-- id #0)
user (du)
1F du SEC Second value sought for
table.sub.-- id (table.sub.-- id #1)
20 4 0 SEC Semi-byte of section length
21 du SEC First byte of first group
22 du SEC First byte of second group
23 du SEC Second byte of first group
24 du SEC Second byte of second group
25 0 00 SEC Start of section pointer for
the second section/stream
26 du SEC First value sought for
table.sub.-- id (table.sub.-- id
______________________________________
#0)
The data are usually written into the destination memory 8 by the microcontroller 13. A special case in this context is notably the continuity counter, which is written by the processor TP (9). In order to write to the destination memory, the microcontroller uses a pointer known as trp. The processors can access data of interest to them by programming the pointer trp. The value awaited from the continuity counter ECC, corresponding to the last transport packet extracted from the multiplexed data stream for a given elementary data stream, is stored in the destination memory at the appropriate address. This value corresponds to the continuity counter value extracted from the last filtered transport packet, incremented by one unit. ECC is used during the comparison with the continuity counter of the next transport packet having the same PID. Given that the first value of ECC is not defined, it is initially completely masked by selecting the appropriate bit masking configuration during the initial writing to the destination memory by the microcontroller. When the first valid value of ECC is written, the masking bits are also re-written. The controller 14 of the destination memory carries out the multiplexing between the requests for access to this memory. These requests can come from the microcontroller and the processors. The following part of the description concerns the transport layer processor. The processor TP is the first processor that is active for all the transport packets. According to the present exemplary embodiment, the bytes read and processed by this processor are as follows:
______________________________________
(a) sync.sub.-- byte 8 bits
(b) transport.sub.-- error.sub.-- indicator
1 bit
payload.sub.-- unit.sub.-- start.sub.-- indicator
1 bit
transport.sub.-- priority
1 bit
PID.sub.-- H 5 bits
(c) PID.sub.-- L 8 bits
(d) transport.sub.-- scrambling.sub.-- control
2 bits
adaptation.sub.-- field.sub.-- control
2 bits
continuity.sub.-- counter
4 bits
______________________________________
All these designations correspond to the MPEG2 terminology. The data are read byte by byte. Certain variables such as transport.sub.-- priority are not taken into account, but are read as if belonging to a byte containing variables which should be processed. According to the present exemplary embodiment, up to nine data streams can be extracted. For example, these data streams are: programme association table stream (packets with PID #1) conditional access table stream (packets with PID #2) programme allocation section stream video stream audio stream Teletext stream rights of access management messages stream (EMM) rights of access check messages stream (ECM) programme guide stream The nine PID values are not specifically allocated by the demultiplexer. The microcontroller selects the data streams by loading the PIDs into the destination memory. Only the transport packets identified by one of these nine PIDs are processed. The microcontroller assigns to each stream a type of stream (stream.sub.-- type) which can take one of the following values: audio, video, section, other. FIG. 2 is a state diagram of the state machine of the processor TP. The state indicated in bold (w.sub.-- first.sub.-- TP) is considered as the initial state of the state machine for the rest of the description. When a new packet is expected, the processor TP waits for a signal from the data capture memory, indicating that the latter is ready to be read (w.sub.-- TP, state, ar.sub.-- rdyl signal). Now follow three wait states concerned with the physical execution and with the ratios of the data capture memory write and read timers. If the synchronisation byte sync.sub.-- byte is incorrect (i.e. different from 0.times.47), the packet is rejected (sync.sub.-- m state), and there is a return to the initial state. If the transport.sub.-- error.sub.-- indicator flag is "1", indicating that the transport packet data contain at least one irrevocable error, then the processor TP likewise rejects the packet (likewise sync.sub.-- m state, TP.sub.-- error condition). The processor TP compares the high (.sub.-- H) and low (.sub.-- L) bits of the nine PIDs with the nine destination PIDs stored in the destination memory 8. The comparison is first made with the nine high bytes, then with the nine low bytes. A nine-bit register DSid.sub.-- reg of the processor TP is loaded with the result, termed the data-.sub.-- stream.sub.-- id. A "1" bit signifies that there is coincidence between the PID of the processed packet and one of the destination PIDs. The position of the bit indicates the particular PID involved. If no bit of the register is "1", then the transport packet is rejected. This test is carried out in the cc.sub.-- trp state, which is the calculation state of the pointer of the destination memory indicating the address of the expected continuity counter ECC for the filtered PID. If this address is invalid, the error is recognized (no.sub.-- ds). The processor TP verifies that for a packet corresponding to a given PID, the continuity counter continuity.sub.-- counter is indeed equal to the expected value ECC. For this it waits for the result of the comparison made by the comparator 7 (wait.sub.-- cc.sub.-- match state). It then writes the new, expected ECC value. Next is a verification stage check.sub.-- 1. A number of cases are envisaged: (a) If there is a payload in the packet (a payload corresponding to a PES or a section) and the continuity counter has the correct value, the processor PES or the processor SEC is activated (call.sub.-- next.sub.-- fsm state). It is the payload.sub.-- unit.sub.-- start.sub.-- indicator flag which indicates the presence of the start of a PES or of a section in the payload of the transport packet. This flag is stored in a register start.sub.-- indic.sub.-- reg. (b) If the packet contains an elementary stream of the video type, but there is an error in the continuity of the packets (continuity counter differs from the expected value), then a certain number of error bytes is inserted into the payload and transferred to the switching part (error.sub.-- state, e.sub.-- x and call.sub.-- xfer states). The switching part stores these bytes in the appropriate buffer area of the static RAM. The video decoder for which the payload is intended recognises this byte configuration and processes the data as a result. (c) If the adaptation.sub.-- field.sub.-- control pair indicates the presence of an adaptation field within the transport packet, the processor TP activates the processor XFER to transfer bytes from this field to the switching part. (d) If the continuity counter does not have a correct value, and the stream is of the section type, then the packet is rejected. During the active phase of the processor XFER, the processor TP is in a sleep state, waiting to be reactivated by the processor XFER. If the transport packet also contains a payload in addition to the adaptation field, and the continuity counter has a correct value, the processor TP activates one of the processors SEC or PES (check.sub.-- 2, then call.sub.-- next.sub.-- fsm state). In the opposite case, the processor TP is only activated for the following transport packet (check.sub.-- 2 state). When one of the processors SEC or PES has been activated, the processor TP enters the sleep state and waits to be reactivated by these processors. The transport.sub.-- scrambling.sub.-- control pair indicates if and in what way the payload of the transport packet is scrambled. These bits are used by the processor TP to configure the descrambler 6 and to control the multiplexer 19. To reject a transport packet, the processor TP de-activates itself simply by waiting for a re-initialisation signal which coincides with the arrival of a new packet. The processor TP has three registers. The first register (DS.sub.-- count.sub.-- reg) contains the maximum number of different packets to be extracted and is controlled by the microcontroller; the second one (TP.sub.-- count.sub.-- reg) is used by the processor TP as a loop index (number of comparisons to be made per byte read into the data capture memory). The third register has already been mentioned. The following part of the description concerns the elementary stream packet processor PES. According to the present exemplary embodiment, this processor contains a state machine (illustrated in FIG. 3), as well as nine registers of two bits each. It is activated by one of the two processors TP or XFER. The following bytes are read by the processor PES. Only the data shown with an asterisk are actually tested by the processor. The other data are masked during the comparisons, which, moreover, is the case with the other processors. However, the entire header of the PES is stored so as to be transferred to the switching part.
______________________________________
(a, b, c) packet.sub.-- start.sub.-- code.sub.-- prefix
24 bits
(d) stream.sub.-- id*. 8 bits
(e) PES.sub.-- packet.sub.-- length.sub.-- high
8 bits
(f) PES.sub.-- packet.sub.-- length.sub.-- low
8 bits
(g) "10" 2 bits
PES.sub.-- scrambling.sub.-- control
2 bits
PES.sub.-- priority 1 bit
data.sub.-- alignment.sub.-- indicator
1 bit
copyright 1 bit
original.sub.-- or.sub.-- copy
1 bit
(h) PTS.sub.-- DTS.sub.-- flags
2 bits
ESCR.sub.-- flag 1 bit
ES.sub.-- rate.sub.-- flag
1 bit
DSM.sub.-- trick.sub.-- mode.sub.-- flag
1 bit
additional.sub.-- copy.sub.-- info.sub.-- flag
1 bit
PES.sub.-- CRC.sub.-- flag
1 bit
PES.sub.-- extension flag
1 bit
______________________________________
At first, the processor PES is in a sleep state. It is activated by an awake.sub.-- bus (PES) signal coming from one of the processors TP or XFER. The processor then waits for the data capture memory to be ready for the reading of the next byte of the current transport packet (W.sub.-- PES state and ar.sub.-- rdy signal). As for the processor TP, a certain number of wait states are necessary to synchronise the data capture memory and the processor PES. The latter reads the three bytes a, b and c corresponding to packet.sub.-- start.sub.-- code.sub.-- prefix (scx.sub.-- m states), then the stream identification byte stream .sub.-- id (sid.sub.-- m1 state). If the stream is a private stream (see table 2-10 of the MPEG2 systems document), then the processor XFER is activated (call.sub.-- xfer state) in order to transfer the payload of the PES packet to the switching part. In the present exemplary embodiment it is assumed that the private streams are completely taken care of by the corresponding applications, and that they do not require descrambling by the descrambler 6. In the opposite case, the bytes e and f are read, then byte g (scram state), from which the PES.sub.-- scrambling.sub.-- control pair are derived, which indicate scrambling of the payload of the PES packet. As before, these bits are used to control the descrambler 6 and the multiplexer 19. Given that the scrambled payload of a PES packet can be distributed among several transport packets, but that only the first transport packet contains the PES.sub.-- scrambling.sub.-- control pair, these bits are stored in a two-bit register. The processor PES contains one register per stream, that is to say nine in this exemplary embodiment. The registers are updated by the headers of the following PES packets. After reading and processing of the g byte, the processor reads the h byte. This one contains a certain number of flags. Depending on the capabilities of the decoder incorporating the demultiplexer, these flags can be set at this time to values that are compatible with these means. The purpose of the two following states is to transfer the header of the PES packet to the switching part. During this time, the processor PES is set to the sleep state. When the transfer is complete, the processor PES is re-activated by the processor XFER. The processor PES then initiates the transfer of the payload of the PES packet (call.sub.-- xfer state), as before. Once this transfer is initiated, the processor PES goes into the sleep mode. The following part of the description concerns the section processor SEC. The processor SEC, designed to process the data of the section layer, contains a state machine (illustrated in FIG. 4) and four registers. It is activated by one of the processors TP or XFER. The bytes read by the processor are as follows:
______________________________________
(a) table.sub.-- id 8 b
(b) section.sub.-- syntax.sub.-- indicator
1 b
private.sub.-- indicator
1 b
reserved 2 b
section.sub.-- length (high semi-byte)
4 b
(c) section.sub.-- length (low byte)
8 b
(d) First byte to be compared to the
8 b
predefined groups
(e) Second byte to be compared to
8 b
the predefined groups
. . .
( . . . ) Last byte to be compared to the
8 b
predefined groups
( . . . ) Payload N .times. 8 b
______________________________________
The starting state is the sleep state. Two cases can arise when the processor SEC is activated: the payload of the current transport packet contains the start of a section at its beginning, the payload of the transport packet contains bytes of a section whose start has been transmitted in a preceding transport packet. In the first case, the state changes to the wait state w.sub.-- sec, which is maintained as long as a signal ar.sub.-- rdy, indicating that the data capture memory is ready and contains at least 6 bytes, has not reached the processor SEC. In the first case, the processor SEC points towards a section/stream field of the destination memory. This pointer is determined by the microcontroller for each authorised PID and is stored in registers read by the processor. Each section/stream field having several groups of predefined bytes for the comparison with the bytes of the section of the transport packet, filtering of several parameters (EMM: ECM, allocation of programmes, etc. . . .) can be implemented for each stream. The first byte to be read from the data capture memory at the start of the section is the table identification byte table.sub.-- id. It is compared to the filter.sub.-- nb bytes corresponding to the destination memory. This is represented by the loop around the F1.sub.-- loop state. The second and third bytes to be read are the section length bytes. In the present exemplary embodiment, the only comparison made is with the high semi-byte of the low byte of the section length, in order to check if the section extends beyond the current transport packet. The section bytes are then compared to the predefined bytes stored in the destination memory (F2.sub.-- loop and corresponding loop state). During the comparison with the bytes of one of the groups, one bit of a register (filter.sub.-- reg) is set to 1 by the processor for each positive comparison. This information is retained from transport packet to transport packet if the section occupies more than one packet, in order to transfer the whole section to the switching part. When one of the groups of predefined bytes is detected in a section, the section is transferred to the switching part (call.sub.-- next.sub.-- fsm state), once filtering is ended. If the end of one section has been transferred, an interrupt signal is then generated to indicate to the microcontroller that the entire section has been stored in the SRAM and that it is available there. If no comparison with a group of bytes provides a positive result, then the section is rejected, and the control is returned to the processor TP. In the second case, the processor SEC is activated when a section has already been started. The processor then analyses the register suspend.sub.-- reg to determine if the end of the section present at the start of the payload of the transport packet corresponds to a section for which the comparison has been positive. In this case, the transfer processor is called (call.sub.-- next.sub.-- fsm state). In the opposite case, the processor SEC calculates the pointer (w.sub.-- ptr) corresponding to the start of the following section in the same transport packet. The system then returns to filtering/comparison cycles (w.sub.-- SEC state). The processor SEC has four registers.. A first register (SECcount.sub.-- reg) is used as the index in the two loops described in relation to the state machine. A second register (filter.sub.-- reg) is used to store the results of comparison. This register contains filter.sub.-- nb bits, each bit indicating the result of comparison for one of the groups of predefined bytes. A third register (suspend.sub.-- reg) stores the results of filtering for each stream, for which the contents of one section occupying several packets can be transferred to the switching part. The end of section interrupts are also generated from this register. A last register (SEC.sub.-- length.sub.-- reg) is used to compute the length of the section. In the present exemplary embodiment, all the bytes of the same section to be compared are assumed to be transmitted in the same transport packet. The other bytes of a section can be distributed among other transport packets. The following part of the description particularly concerns the transfer processor XFER. The processor XFER is activated by every other processor having data to be transferred to the switching part. It contains a state machine (FIG. 5), a register (packet.sub.-- length.sub.-- reg) and two counters: xfer.sub.-- count.sub.-- reg and ar.sub.-- count. The processor XFER does not have access to the destination memory. The register packet.sub.-- length.sub.-- reg contains the length of the packet, that is to say 188 bytes in the case of MPEG2 transport packets. An internal counter (packet.sub.-- count.sub.-- reg) is loaded with this start of transport packet value by the microcomputer and is decremented each time that a byte is read into the data capture memory. The xfer.sub.-- count counter is used by the processor XFER to store the number of bytes to be transferred. The counter ar.sub.-- count is used to generate type ar.sub.-- rdy type signals (data capture memory ready). It synchronises the data coming from the demodulator/error corrector and compares the read and write pointers of the data capture memory. The start state is again the sleep state. If a signal till.sub.-- TP.sub.-- end has been activated by the calling processor, then the processor XFER transfers all the remaining bytes of the transport packet to the switching part. In the opposite case the processor reads the first byte in the data capture memory and considers it to be the number of bytes to be transferred. If the signal drop.sub.-- length.sub.-- bus is validated, then this first byte is not transmitted to the switching part. This function also depends on the processor having activated the processor XFER and on the number of bytes present in the data capture memory. For each transfer session, the processor XFER expects 6 bytes to be available in the data capture memory or in the descrambler. It then opens a transfer session by sending a signal DPP.sub.-- req (w.sub.-- ard state) to the switching part and awaits the return of this part (w.sub.-- sram state). When the DSP is ready to receive data, it responds with a signal DSP.sub.-- ack. The processor XFER then reads the bytes in the data capture memory (rd.sub.-- byte state) and transfers them to the switching part. After a byte is transferred, the processor loops back to transfer the next byte until an end of transfer condition.: end of packet, end of section or end of transfer (w.sub.-- 0, w.sub.-- 1 and w.sub.-- 2 states). If no end condition is fulfilled, then the processor waits (W.sub.-- ar3 state) for another six bytes to be available in the data capture memory (ar.sub.-- rdy=1) in order to formulate a new transfer session request. In the case of the end condition, the processor XFER reactivates the processor which has activated it and goes into the sleep mode (call.sub.-- next.sub.-- fsm and sleep states).
|
Same subclass Same class |
||||||||||
