Parsing a Dolby Digital Plus bitstream
A product must use several bitstream information fields in the Dolby Digital Plus bitstream to identify access units and to properly signal the Dolby Digital Plus bitstream information in the PES packet payload.
To locate the start of an access unit, the product checks the numblkscod
, strmtyp
, and substreamid
values. The
multiplexing processing logic depends on the number of blocks per frame (indicated by the
value) in the Dolby Digital
Plus bitstream.numblkscod
If the numblkscod
value is
3
:
- Find the first frame with a
strmtyp
value of0
and asubstreamid
value of0
. This indicates the start of an access unit. - Use the frame as the first frame of the program elementary stream packet payload.
- Search for the next frame with a
strmtyp
value of0
andsubstreamid
value of0
. This indicates the start of the next access unit. - If putting another access unit in the payload, continue placing frames in
the PES packet payload and go back to step 3.
Alternatively, use the frame immediately preceding the frame that starts the next access unit to complete the current PES packet payload.
- Use the frame that starts the next access unit as the first frame of the next PES packet payload.
If the numblkscod
value is
not 3
:
- Find the first frame with a
strmtyp
value of0
, asubstreamid
value of0
, and aconvsync
flag set to1
.This indicates the start of an access unit.
- Use the frame as the first frame of the PES packet payload.
- As frames are placed in the PES packet payload, keep track of the number of accumulated audio blocks.
- Find the next frame with a
strmtyp
value of0
, asubstreamid
value of0
, and aconvsync
flag set to1
:- If the frame immediately preceding the next frame does not complete six blocks (or a multiple of six blocks), keep searching until completing six blocks or multiple of them.
- If the frame immediately preceding the next frame completes six blocks (or a multiple of six blocks), the current access unit is completed.
- If putting another access unit in the payload, restart the count of
accumulated audio blocks, put the next frame in the PES packet payload, and continue with
step
4.
Alternatively, use the frame immediately preceding the frame that starts the next access unit to complete the current PES packet payload.
- Use the frame that starts the next access unit as the first frame of the next PES packet payload.