[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does MPE handle the last byte?



> What does the encapsulator do if this TS-Packet has no PUSI
> set, since setting the PUSI flag implies that encapsulator
> would also include a Payload start pointer in the first
> position after the TS-Packet header. This pointer consumes
> the last byte... leaving nothing for it to point at.

>From ISO/IEC 13818-1
--------------------
2.4.4.2 Semantics definition of fields in pointer syntax pointer_field
This is an 8-bit field whose value shall be the number of bytes,
immediately following the pointer_field until the first byte of the
first section that is present in the payload of the Transport Stream
packet (so a value of 0x00 in the pointer_field indicates that the
section starts immediately after the pointer_field). When at least one
section begins in a given Transport Stream packet, then the
payload_unit_start_indicator (refer to 2.4.3.2) shall be set to 1 and
the first byte of the payload of that Transport Stream packet shall
contain the pointer. When no section begins in a given Transport
Stream packet, then the payload_unit_start_indicator shall be set to 0
and no pointer shall be sent in the payload of that packet.

My understanding, and my implementation:

1)if we have only 1 byte left, and no PUSI bit already set, i do not
  think we can do anything with this byte.
  This even can't be ISO/IEC 13818-1 conformant, because we have to
  shift the current payload by one byte, set the PUSI bit to one and
  set the pointer_field to 183, which points outside of the transport
  packet paylaod ...

2)if we have only 2 bytes left, and no PUSI bit already set, we could
  use these 2 bytes.
  Shift the the current payload by one byte, set the PUSI bit to one and
  set the pointer_field to 182, and have the first byte of the new
  payload unit in the last byte of the transport packet.
  Then is is a matter of space vs cpu decision: move 182 bytes to save
  1 byte for the bandwidth's sake.
  This will depend on the cpu cycles available on the encapsulator.


  Anyway, the receiver/decoder must be able to deal with such
  situations.
  1) is an error: pointer outside of the transport packet
  2) is OK

Patrick.
-- 
UDcast: Full IP over Broadcast Media

Phone:  (+33) (0)4 93 00 16 99
Mobile: (+33) (0)6 14 21 55 98
Fax:    (+33) (0)4 93 00 16 61                 http://www.UDcast.com