Dolby E: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
Line 23: Line 23:


=== CRC ===
=== CRC ===
Each audio channel, metadata section and the metering section is CRCed using the AV_CRC_16_ANSI in libavutil.
Each audio subsegment, metadata section and the metering section is CRCed using the AV_CRC_16_ANSI in libavutil.


=== Transforms ===
=== Transforms ===

Revision as of 04:02, 17 April 2010

Dolby E is a codec from Dolby Laboratories that is used to transport up to 8 channels of audio across AES-3 cabling (AES-3 is the professional version of SPDIF). It is carried in a SMPTE-337M data burst. Dolby E also carries metadata such as downmixing information which is intended to be passed through to the final distribution encoder.

Decoding

Frame Structure

Frame structure.png

Dolby E is designed to match up with video frames to allow for easy cutting. Guard Bands are also present at the beginning and the end of the frame to reduce the risk of bad splicing causing problems.

There are 3 input bit depths of Dolby E: 16-bit, 20-bit and 24-bit. It is unknown whether 24-bit exists in the wild. 16-bit mode has a maximum of 6 channels, 20-bit mode has a maximum of 8 channels and 24-bit has an unknown number of channels.

Startcodes

Dolby E uses the following startcodes:

16-bit: 0x78e 20-bit: 0x788e 24-bit: 0x7888e

The LSB of the startcode signals the presence of a Bitstream Key. The Bitstream Key is mandatory in 16-bit mode.

Bitstream Key

Certain parts of the bitstream seem to be XOR ciphered. The number of bytes in a XORed section is sometimes written in the bitstream. The key is always the first byte of the section that is XORed.

CRC

Each audio subsegment, metadata section and the metering section is CRCed using the AV_CRC_16_ANSI in libavutil.

Transforms

Dolby E uses a slightly edited MDCT:

Dolby E Mdct.png

Quantisation

Dolby E uses gain adaptive quantisation. (TODO: describe further)

Sample Rate Conversion

The internal sample rate of Dolby E varies depending on the associated video frame-rate. This internal sample rate varies between 42.965kHz and 53.760kHz. This is sample rate converted to 48kHz after decoding.

Decoder/Encoder

A free trial of a software Dolby E encoder and decoder that supports encoding of 16-bit and 20-bit modes and decoding of 16-bit, 20-bit and possibly 24-bit is available from http://www.neyrinck.com. However it requires Pace iLok to run, which features kernel level anti-debugging.

Dolby SIP API

The application library uses the Dolby SIP interface to decode. More information about the Dolby SIP interface can be found here.

Dolby Subroutines

Each function name is followed by a function ID number. These take the take the form: DD_XXXXD_YYYY for decoding and DD_XXXXE_YYYY for encoding

DD_SYS_INIT – 0x00
System Initialise

meter DD_CRCD_VER – 0x1E
Verify CRC of meter section.

Metadata %d DD_CRCD_VER: 0x1E
Verify CRC of metadata section.

Channel decode %d:%d DD_CRCD_VER – 0x1E
Verify CRC of channel.

DD_DDED_DEC – 0x20
Dolby E Decode Seemingly needs to be called 8 times (similar to ac-3’s 6 times per frame)

DD_METD_UNPACK – 0x22
Unpack Metadata

DD_METD_AC3INFO – 0x23
Return only the AC-3 compatible metadata?

DD_MTRD_UNPACK – 0x25
Unpack Metering data

meter DD_KEYD_EXTR – 0x28
Extract Bitstream Key

DD_SRCD_CONV – 0x2a
Sample rate convert