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 MP4 file.
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 MP4 sample.
- Search for the next frame with a
strmtyp
value of0
andsubstreamid
value of0
. This indicates the start of the next access unit. - Use the frame immediately preceding the frame that starts the next access unit to complete the MP4 sample.
- Use the frame that starts the next access unit as the first frame of the next MP4 sample.
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 MP4 sample.
- As frames are placed in the MP4 sample, 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 completes six blocks (or a multiple of six blocks), the current sample is completed. Otherwise, keep searching until six blocks have been accumulated.