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

Encaps methode : some examples



Hi all,

About en enc-method, and some previous questions about
   - AF pointer
   - 4-bytes alignment stuff

I made the following assumptions :
   - 4-bytes alignement is to be enforced for SNDU start
   - AF pointer value 1 means that the next SNDU starts immedialtly
     after AF (same calcul as in the ule-method for payload pointer)

So I draw some example that I hope will help clarify, and should cover
all possible nasty cases.
Could you please check them and tell me if anything is wrong ?
Those examples could then (if correct !) be incorporated in the
draft, in some annexe.

Regards.
Alain.




In the following HDR means MPEG header, and is followed
by the PUSI, AFC values.

1st case, simple  just to show AF/PUSI usage and values
========================================================

   SNDU A is 200 bytes long
   SNDU B is 200 bytes long

  +-----+------+------+-   -+------+
  | HDR | A000 | A001 | ... | A183 |
  +-----+------+------+-   -+------+
   PUSI =  1
   AFC  = 01

         <== Adapt Field ==>
  +-----+----+----+----+----+------+-   -+------+------+-   -+------+
  | HDR |0x03|0x02|0x01|0x11| A184 | ... | A199 | B000 | ... | B163 |
  +-----+----+----+----+---*+------+-   -+------+*-----+-   -+------+
   PUSI =  1               *                     *
   AFC  = 11               ***********************
   AF.ptr = 17

                                                 <---  144  --->
         <== Adapt Field ==>                     stuffing  bytes
  +-----+----+----+----+----+------+-   -+------+----+-   -+----+
  | HDR |0x03|0x02|0x01|0x00| B164 | ... | B199 |0xff| ... |0xff|
  +-----+----+----+----+---*+------+-   -+------+----+-   -+----+
   PUSI =  0               *
   AFC  = 11               ***//
   AF.ptr = 0 (no next SNDU)

2nd case, AF size pb
=====================

   SNDU A is 200 bytes long
   SNDU B is 346 bytes long

  +-----+------+------+-   -+------+
  | HDR | A000 | A001 | ... | A183 |
  +-----+------+------+-   -+------+
   PUSI =  1
   AFC  = 01

         <== Adapt Field ==>
  +-----+----+----+----+----+------+-   -+------+------+-   -+------+
  | HDR |0x03|0x02|0x01|0x11| A184 | ... | A199 | B000 | ... | B163 |
  +-----+----+----+----+---*+------+-   -+------+*-----+-   -+------+
   PUSI =  1               *                     *
   AFC  = 11               ***********************
   AF.ptr = 17

                             <-- 2 -->
                           stuffing  bytes
  +-----+------+-   -+------+----+----+
  | HDR | B164 | ... | B345 |0xff|0xff|
  +-----+------+-   -+------+----+----+
   PUSI =  0
   AFC  = 01  : no AF, because not enough room letf for it.

3rd case : alignement stuff
============================

   SNDU A is 199 bytes long
   SNDU B is 200 bytes long

  +-----+------+------+-   -+------+
  | HDR | A000 | A001 | ... | A183 |
  +-----+------+------+-   -+------+
   PUSI =  1
   AFC  = 01
                                             padding byte
                                            to keep 4-bytes
                                              alignement
        <== Adapt Field ==>                       |
+-----+----+----+----+----+------+-   -+------+--v-+------+-   -+------+
| HDR |0x03|0x02|0x01|0x11| A184 | ... | A198 |0xff| B000 | ... | B163 |
+-----+----+----+----+---*+------+-   -+------+----+*-----+-   -+------+
   PUSI =  1              *                          *
   AFC  = 11              ****************************
   AF.ptr = 17 : points to the next "aligned" SNDU


                                                 <---  144  --->
         <== Adapt Field ==>                     stuffing  bytes
  +-----+----+----+----+----+------+-   -+------+----+-   -+----+
  | HDR |0x03|0x02|0x01|0x00| B164 | ... | B199 |0xff| ... |0xff|
  +-----+----+----+----+---*+------+-   -+------+----+-   -+----+
   PUSI =  0               *
   AFC  = 11               ***//
   AF.ptr = 0 (no next SNDU)


4th case : small packets
==========================

   SNDU A is 200 bytes long
   SNDU B is 100 bytes long
   SNDU C is 60  bytes long

  +-----+------+------+-   -+------+
  | HDR | A000 | A001 | ... | A183 |
  +-----+------+------+-   -+------+
   PUSI =  1
   AFC  = 01

        <== Adapt Field ==>
+-----+----+----+----+----+------+-   -+------+------+-
| HDR |0x03|0x02|0x01|0x11| A184 | ... | A199 | B000 | ...
+-----+----+----+----+---*+------+-   -+------+*-----+-
   PUSI =  1              *                     *
   AFC  = 11              ***********************
   AF.ptr = 17
                                                  <---  4  --->
                                                 stuffing  bytes
                    -+------+------+-   -+------+----+-   -+----+
                 ... | B099 | C000 | ... | C059 |0xff| ... |0xff|
                    -+------+------+-   -+------+----+-   -+----+


5th case : small packets, alignement stuff
============================================

   SNDU A is 200 bytes long
   SNDU B is  97 bytes long
   SNDU C is  60  bytes long

  +-----+------+------+-   -+------+
  | HDR | A000 | A001 | ... | A183 |
  +-----+------+------+-   -+------+
   PUSI =  1
   AFC  = 01

        <== Adapt Field ==>
+-----+----+----+----+----+------+-   -+------+------+-
| HDR |0x03|0x02|0x01|0x11| A184 | ... | A199 | B000 | ...
+-----+----+----+----+---*+------+-   -+------+*-----+-
   PUSI =  1              *                     *
   AFC  = 11              ***********************
   AF.ptr = 17
                        padding bytes
                       to keep 4-bytes
                        alignement
                      /           \                    <---  4  --->
                     /             \                    stuffing  bytes
            -+------+----+----+----+------+-   -+------+----+-   -+----+
         ... | B096 |0xff|0xff|0xff| C000 | ... | C059 |0xff| ... |0xff|
            -+------+----+----+----+------+-   -+------+----+-   -+----+


--
Alain RITOUX
Tel +33-1-39-30-92-32
Fax +33-1-39-30-92-11
visit our web http://www.6wind.com