Personal tools
Namespaces
Variants
Actions
Navigation
Projects
Toolbox

DTS

From AC3Filter
Revision as of 02:23, 11 July 2013 by Valex (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Frame structure

DTS Core XCH XXCH X96K EXSS
frame()
{
  core_frame();

  align32: 0-31;
  if (nextbits(32) == xch_sync)
    xch_ext();

  align32: 0-31;
  if (nextbits(32) == xxch_sync)
    xxch_ext();

  align32: 0-31;
  if (nextbits(32) == x96k_sync)
    x96k_ext();

  if (nextbits(32) == exss_sync)
    exss_frame();
}

DTS core

core_frame()
{
  core_frame_header();
  core_frame_data();
}

core_frame_header()
{
  sync  : 32; // Synchronization word

  ftype : 1;  // Frame type
  short : 5;  // Deficit sample count
  cpf   : 1;  // CRC present flag
  nblks : 7;  // Number of PCM sample blocks
  fsize : 14; // Primary frame size
  amode : 6;  // Audio channel arrangement
  sfreq : 4;  // Core audio sampling frequency
  rate  : 5;  // Transmission bit rate
  mix   : 1;  // Embedded downmix enabled
  dynf  : 1;  // Embedded dynamic range flag
  timef : 1;  // Embedded time stamp flag
  auxf  : 1;  // Auxiliary data flag
  hdcd  : 1;  // HDCD

  ext_audio_id: 3; // Extension audio descriptor flag
  ext_audio : 1;   // Extended coding flag
  aspf  : 1;  // Audio sync word insertion flag
  lff   : 2;  // Low frequency effects flag
  hflag : 1;  // Predictor history flag switch

  if (cpf == 1)
    hcrc  : 16; // Header CRC check

  filts : 1;  // Multirate interpolator switch
  vernum : 4; // Encoder software revision
  chist : 2;  // Copy history
  pcmr  : 3;  // Source PCM resolution
  sumf  : 1;  // Front sum/difference flag
  sums  : 1;  // Surrounds sum/difference flag
  dialnorm : 4; // Dialog normalisation parameter
}

Size of the core frame header is 104-120 bits = 13-15 bytes (depends on CPF).

xch extension

xch_ext()
{
  xch_ext_header();
  xch_ext_data();
}

xch_ext_header()
{
  sync : 32;  // Channel extension sync word = 0x5a5a5a5a
  fsize : 10; // Primary frame size
  amode : 4;  // Extension channel arrangement
}

Size of the header is 6 bytes.

x96k extension

x96k_ext()
{
  x96k_ext_header();
  x96k_ext_data();
}

x96k_ext_header()
{
  sync : 32;  // X96K extension sync word = 0x1D95F262
  fsize : 12; // Primary frame size
  revno : 4;  // Revision number
}

Size of the header is 6 bytes.

exss

exss_frame()
{
  exss_header();
  exss_data();
}

exss_header()
{
  sync     : 32; // EXSS sync word = 0x64582025
  unknown  : 8;
  ss_index : 2;  // Substream index
  blown_up : 1;
  if (blown_up)
  {
    header_size : 12;
    hd_size : 20;
  }
  else
  {
    header_size : 8;
    hd_size : 16;
  }

  static_fields : 1;
  if (static_fields)
  {
    ref_clock_code : 2;
    frame_duration_code : 3;

    timestamp_flag : 1;
    if (timestamp_flag)
      timestamp : 36;

    num_audiop : 3;
    num_assets : 3;

    for (audiop = 0; audiop < num_audiop + 1; audiop++)
      for (ss = 0; ss <= ss_index + 1; ss++)
        active_ss[audiop][ss] : 1;

    for (audiop = 0; audiop < num_audiop + 1; audiop++)
      for (ss = 0; ss <= ss_index + 1; ss++)
        if (active_ss[audiop][ss])
          unknown[audiop][ss] : 8;

    mix_metadata : 1;
    if (mix_metadata)
    {
      adjustment_level : 2;
      mix_out_mask_size : 2;
      num_mix_configs : 2;
      for (mix_config = 0; mix_config < num_mix_configs + 1; mix_config ++)
        mix_out_mask[mix_config] : (mix_out_mask_size + 1) * 4;
    }
  }

  for (asset = 0; asset < num_assets + 1; asset++)
    if (blown_up)
      asset_size[asset] : 20;
    else
      asset_size[asset] : 16;

  for (asset = 0; asset < num_assets + 1; asset++) {
    asset_header();
}

Examples

List of samples

Sample Frame size Core header x96k pos x96k header xch pos xch exss pos exss header
DTS 5.1 48kHz 0x7dd 7F FE 80 01 FC 3C 7D С2 77 00 0D 3A 00
DTS 2.1 88.2kHz 0xe00 7F FE 80 01 FC 7C DF F0 A2 C0 5D 3A 00 0xa80 1D 95 F2 62 37 F1
DTS 5.1 96kHz 0x7dd 7F FE 80 01 FC 3C 7D C2 77 00 5D 3A 00 0x624 1D 95 F2 62 1B 81
DTS ES 6.1 Matrix 48kHz 0x7dd 7F FE 80 01 FC 3C 7D C2 77 00 0D 3A 40
DTS ES 6.1 Discrete 48kHz 0x3ee 7F FE 80 01 FC 3C 3E D2 75 E0 1D 3A 40 0x35c 5A 5A 5A 5A 24 44
DTS HRA 6.1 Discrete 48kHz 0x1400 7F FE 80 01 FC 3C 7D B2 77 00 1D 3A 40 0x714 5A 5A 5A 5A 31 C4 0x7dc 64 58 20 25 00 03 61 84

DTS 5.1 48kHz

Core header: 7F FE 80 01 FC 3C 7D С2 77 00 0D 3A 00

Frame size: 0x7dd = 2013 bytes

Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 7dс Frame size
amode 6 9 L C R SL SR
sfreq 4 D 48 kHz
rate 5 18 1536 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 0 -
ext_audio 1 0 No extended coding
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 0 Source PCM is 16bit PCM (no ES)
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)

DTS 2.1 88.2kHz

Core header: 7F FE 80 01 FC 7C DF F0 A2 C0 5D 3A 00

x96k pos: 0xa80 = 2688 bytes

x96k header: 1D 95 F2 62 37 F1 EB F7 C1 01 B0 00 01 B6 FF FF F0

Frame size: 0xe00 = 3584 bytes

Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 7cd Frame size
amode 6 2 L R (Stereo)
sfreq 4 8 44100 Hz
rate 5 16 1411.2 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 2 x96k
ext_audio 1 1 Extended coding present
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 0 Source PCM is 16bit PCM (no ES)
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)
Field bits value (hex) Meaning
sync 32 1D 95 F2 62 x96k syncword
fsize 12 37F Frame size
revno 4 1 Revision number

DTS 5.1 96kHz

Core header: 7F FE 80 01 FC 3C 7D C2 77 00 5D 3A 00

x96k pos: 0x624

x96k header: 1D 95 F2 62 1B 81 6F FF DF FD F0 10 80 10 23 EF

Frame size: 0x7dd

Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 7dc Frame size
amode 6 9 L C R SL SR
sfreq 4 D 48 kHz
rate 5 18 1536 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 2 x96k
ext_audio 1 1 Extended coding presents
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 0 Source PCM is 16bit PCM (no ES)
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)
Field bits value (hex) Meaning
sync 32 1D 95 F2 62 x96k syncword
fsize 12 1B8 Frame size
revno 4 1 Revision number

DTS ES 6.1 Matrix 48kHz

Core header: 7F FE 80 01 FC 3C 7D C2 77 00 0D 3A 40

Frame size: 0x7dd

Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 7dс Frame size
amode 6 9 L C R SL SR
sfreq 4 D 48 kHz
rate 5 18 1536 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 0 -
ext_audio 1 0 No extended coding
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 1 Source PCM is 16bit PCM, ES format
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)

DTS ES 6.1 Discrete 48kHz

Core header: 7F FE 80 01 FC 3C 3E D2 75 E0 1D 3A 40

xch pos: 0x35c

xch header: 5A 5A 5A 5A 24 44 42 33 B7 FF FF FC 00 00 92 31 22 22 12 12

Frame size: 0x3ee

Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 3ed Frame size
amode 6 9 L C R SL SR
sfreq 4 D 48 kHz
rate 5 F 768 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 0 xch
ext_audio 1 0 Extended coding presents
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 1 Source PCM is 16bit PCM, ES format
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)
Field bits value (hex) Meaning
sync 32 5A 5A 5A 5A xch syncword
fsize 10 91 frame size
amode 4 1 single channel

DTS HRA 6.1 Discrete 48kHz

Core header: 7F FE 80 01 FC 3C 7D B2 77 00 1D 3A 40

xch pos: 0x714

xch header: 5A 5A 5A 5A 31 C4 7B 63 DB FF FF FC

exss pos: 0x7dc

exss header: 64 58 20 25 00 03 61 84 78 00 80 83 01 C1 20 3F 01 AD 1F 00 05 26 03 A0 00 00 C9 42 65 5E 31 5E 3D 01 5C 01

Frame size: 0x1400

Core header
Field bits value (hex) Meaning
sync 32 7F FE 80 01
ftype 1 1 Normal frame
short 5 1f Normal frame
CPF 1 0 No CRC
nblks 7 f 16 PCM sample blocks, 32 samples each = 512 samples/frame
fsize 14 7db Frame size
amode 6 9 L C R SL SR
sfreq 4 D 48 kHz
rate 5 18 1536 kbps
mix 1 0 No downmix
dynf 1 0 No dynamic range
timef 1 0 No timestamp
auxf 1 0 No aux data
hdcd 1 0 No HDCD
ext_audio_id 3 0 xch
ext_audio 1 1 Extended coding presents
aspf 1 1 DSYNC placed at end of esch subsubframe
lff 2 2 LFE present, interpolation factor 64.
hflag 1 1 Predictor history flag
filts 1 0 Non-perfect reconstruction
vernum 4 7 Encoder software revision
chist 2 1 Copy history
pcmr 3 1 Source PCM is 16bit PCM, ES format
sumf 1 0 Front is not sum/difference
sums 1 0 Surrounds are not sum/difference
dialnorm 4 0 No dialog normalization gain (0dB)
xch header
Field bits value (hex) Meaning
sync 32 5A 5A 5A 5A xch syncword
fsize 10 c7 frame size
amode 4 1 single channel
EXSS header
Field bits value (hex) Meaning
sync 32 64 58 20 25 exss syncword
unknown 8 00
ss_index 2 0
blown_up 1 0
header_size 8 1b HD header size
hd_size 16 c23 HD frame size
static_fields 1 1 Static fields present
ref_clock_code 2 2  ?
frame_duration_code 3 0  ?
timestamp_flag 1 0 No timestamp
num_audiop 3 0 Single audio program
num_assets 3 0 Single asset
active_ss[0][0] 1 1 Active substream 0 audio program 0
unknown[0][0] 8 1  ?
mix_metadata 1 0 No mix metadata
asset_size 16 c07 Asset size

Links