More than seven years ago we had a discussion about DTS AUE encryption and those distances between the serial number blocks in the timecode.
While working on DTS preservation, I spent quite some time looking through a disassembly of the original DTS XD10 software and eventually came across the code that handles the AUE key embedded in the timecode.
Since we already had a thread about this several years ago but never really figured out how it works, I thought I'd share what I've found:
I'm using zero-based counting everywhere below: first bit = 0, first item = 0, etc.
As an example for calculations I use Serial 9754, Reel 1.
1. What is actually printed on the film?
DTS optical timecode has 30 BLOCKs per second. This is independent of the 24 film frames per second - a DTS BLOCK is not a film frame.
Each physical BLOCK consists of 48 optical bits, read along the direction of film travel:
The 40 optical data bits represent 20 decoded data bits, because every two optical bits encode one data bit. In film travel direction the two decoded fields are bit-reversed:
The reel number decides what kind of BLOCK it is:
2. Why are there extra SERIAL BLOCKs?
A regular SERIAL BLOCK appears once every 16 BLOCKs. On AUE-protected prints there are additional SERIAL BLOCKs between the regular ones.
These extra SERIAL BLOCKs carry the AUE security information. More exactly, their positions represent binary bits. A SERIAL BLOCK at a certain position means 1, and no SERIAL BLOCK at that position means 0.
The regular 16-BLOCK SERIAL pattern and the additional security SERIAL BLOCKs are processed differently. That explains why some SN-Blocks are just part of the regular serial transmission, while others affect the calculated AUE key.
3. Some names to make the explanation easier
Instead of trying to explain the internal XD10 lookup table, I think it is easier to describe the actual structure with a few simple definitions. These are not official DTS names, just some names I came up with to make the following explanation easier to understand:
All three SafetyGroups together form one INDEXGROUP.
So in total:
4. One INDEXGROUP = 256 BLOCKs
The INDEXGROUP structure and its SKIP positions repeat every 256 BLOCKs. Each cycle contains 64 BLOCKGROUPs of four BLOCKs, divided into three SafetyGroups. The actual pattern of additional SERIAL BLOCKs can change from one INDEXGROUP to the next, because the CRC16 also depends on the BlockID.
For a given BlockID, the INDEX of its BLOCKGROUP is:
INDEX = ((BlockID - 64) AND 255) / 4
INDEX calculation (SecureIrqProcess):
This is integer division. AND 255 keeps the lower eight bits, so the INDEX repeats from 0 to 63 every 256 BLOCKs.
Timecode generally starts at BlockID 59, so the first cycle, starting at BlockID 64, looks like this:
The three SafetyGroups within an IndexGroup cover these BLOCK ranges in the first cycle:
For another 256-BLOCK cycle just add 256 * n to the BLOCK numbers (n = 0, 1, 2, ...).
The starting BLOCKs of the SafetyGroups are therefore:
SafetyGroup0 = 64 + 256*n
SafetyGroup1 = 152 + 256*n
SafetyGroup2 = 236 + 256*n
5. SKIP BLOCKGROUPs
Here is the important rule:
Every fourth BLOCKGROUP is SKIP, starting at INDEX 0.
SKIP = (INDEX MOD 4 = 0)
So the SKIP INDEX values are:
0, 4, 8, 12, 16, 20, 24, 28, ... 60
For the first INDEXGROUP, the SKIP BLOCKGROUPs start at these BlockIDs:
64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304
And that automatically explains why the three SafetyGroups have different numbers of BLOCKGROUPs:
Note that this list only shows the first BLOCK (GROUPITEM 0) of each BLOCKGROUP.
6. How one BLOCKGROUP gives a security bit
Each BLOCKGROUP consists of four BLOCKs. As mentioned, I call their positions GROUPITEM 0, 1, 2 and 3.
For a non-SKIP BLOCKGROUP, only GROUPITEM 0 and GROUPITEM 1 are checked to get the next security bit:
IsSN = (GROUPITEM 0 is SERIAL) OR (GROUPITEM 1 is SERIAL)
If either is a SERIAL BLOCK, IsSN is 1. If both are COUNTING BLOCKs, IsSN is 0.
That one bit is added to the SecuritySequence for the current SafetyGroup. After 16 non-SKIP BLOCKGROUPs, the sequence is complete.
SERIAL detection and security bit insertion (SecureIrqProcess):
(Selected instructions, not one continuous block of code.)
The first received bit is bit 0 (the rightmost bit of the finished 16-bit number). The final received bit is bit 15 (the leftmost bit).
GROUPITEM 2 and GROUPITEM 3 don't add security bits. They are also used by the decoder to keep the latest reel number for the CRC calculation (more on that later), and to reset IsSN for the next BLOCKGROUP.
Let's take BLOCKs 68-71 as an example:
The next useful BLOCKGROUP is 72-75, which produces the next bit. BLOCKGROUP 80-83 is SKIP and contributes nothing to the SecuritySequence.
In the real sample I captured, all the SN-Blocks are on GROUPITEM 0. So there are always at least three COUNTING BLOCKs between two SN-Blocks. The processor still accepts SN-Blocks on GROUPITEM 1 too - more on that below.
Continued in the next post due to the 10,000-character limit...
While working on DTS preservation, I spent quite some time looking through a disassembly of the original DTS XD10 software and eventually came across the code that handles the AUE key embedded in the timecode.
Since we already had a thread about this several years ago but never really figured out how it works, I thought I'd share what I've found:
I'm using zero-based counting everywhere below: first bit = 0, first item = 0, etc.
As an example for calculations I use Serial 9754, Reel 1.
1. What is actually printed on the film?
DTS optical timecode has 30 BLOCKs per second. This is independent of the 24 film frames per second - a DTS BLOCK is not a film frame.
Each physical BLOCK consists of 48 optical bits, read along the direction of film travel:
| Start bits | Optical data bits | Stop bits |
| 4 bits | 40 bits | 4 bits |
The 40 optical data bits represent 20 decoded data bits, because every two optical bits encode one data bit. In film travel direction the two decoded fields are bit-reversed:
| Decoded data field | Bit positions | Width |
| Counting value OR film serial number | 0-15 | 16 bits |
| Reel number | 16-19 | 4 bits |
The reel number decides what kind of BLOCK it is:
- Reel = 0 -> SERIAL BLOCK (SN-Block). The 16-bit field contains the film serial number.
- Reel = 1-15 -> COUNTING BLOCK (TC-Block). The 16-bit field contains the timecode count.
2. Why are there extra SERIAL BLOCKs?
A regular SERIAL BLOCK appears once every 16 BLOCKs. On AUE-protected prints there are additional SERIAL BLOCKs between the regular ones.
These extra SERIAL BLOCKs carry the AUE security information. More exactly, their positions represent binary bits. A SERIAL BLOCK at a certain position means 1, and no SERIAL BLOCK at that position means 0.
The regular 16-BLOCK SERIAL pattern and the additional security SERIAL BLOCKs are processed differently. That explains why some SN-Blocks are just part of the regular serial transmission, while others affect the calculated AUE key.
3. Some names to make the explanation easier
Instead of trying to explain the internal XD10 lookup table, I think it is easier to describe the actual structure with a few simple definitions. These are not official DTS names, just some names I came up with to make the following explanation easier to understand:
| Name | Meaning |
| BLOCK | One physical 48-optical-bit unit on the film |
| BlockID | The counting/timecode BLOCK number used for the security calculation |
| BLOCKGROUP | Four consecutive BLOCKs |
| GROUPITEM | Position 0, 1, 2 or 3 inside a BLOCKGROUP |
| INDEX | Number 0-63 assigned to a BLOCKGROUP |
| INDEXGROUP | One complete cycle of 64 BLOCKGROUPs = 256 BLOCKs |
| SafetyGroup | One part of an INDEXGROUP producing a 16-bit SecuritySequence |
| IsSN | 1 if a SERIAL BLOCK occurs in GROUPITEM 0 or 1; otherwise 0 |
| SKIP | A BLOCKGROUP which does not contribute a security bit |
| SecuritySequence | The 16 bits recovered from one SafetyGroup |
| TimecodeCRC | CRC16 calculated from the BLOCK number, reel number and serial number |
| AueKey_Item | One AUE key result calculated from one SecuritySequence |
All three SafetyGroups together form one INDEXGROUP.
So in total:
- 256 BLOCKS = 64 BLOCKGROUPS = 3 SAFETYGROUPS = 1 INDEXGROUP
- 1 BLOCKGROUP consists of 4 BLOCKS numbered GROUPITEM 0 to 3
4. One INDEXGROUP = 256 BLOCKs
The INDEXGROUP structure and its SKIP positions repeat every 256 BLOCKs. Each cycle contains 64 BLOCKGROUPs of four BLOCKs, divided into three SafetyGroups. The actual pattern of additional SERIAL BLOCKs can change from one INDEXGROUP to the next, because the CRC16 also depends on the BlockID.
For a given BlockID, the INDEX of its BLOCKGROUP is:
INDEX = ((BlockID - 64) AND 255) / 4
INDEX calculation (SecureIrqProcess):
| 0804D410 LEA EAX,[EBX-0x40] ; BlockID - 64 0804D413 AND EAX,0xFF ; keep 8 bits 0804D41D SHR EAX,0x2 ; divide by 4 |
This is integer division. AND 255 keeps the lower eight bits, so the INDEX repeats from 0 to 63 every 256 BLOCKs.
Timecode generally starts at BlockID 59, so the first cycle, starting at BlockID 64, looks like this:
| SafetyGroup | INDEX values | BLOCKGROUPs | BLOCKs | SKIP | Security bits |
| SafetyGroup0 | 0-21 | 22 | 88 | 6 | 16 |
| SafetyGroup1 | 22-42 | 21 | 84 | 5 | 16 |
| SafetyGroup2 | 43-63 | 21 | 84 | 5 | 16 |
| TOTAL | 0-63 | 64 | 256 | 16 | 48 |
The three SafetyGroups within an IndexGroup cover these BLOCK ranges in the first cycle:
- SafetyGroup0: BLOCKs 64-151
- SafetyGroup1: BLOCKs 152-235
- SafetyGroup2: BLOCKs 236-319
For another 256-BLOCK cycle just add 256 * n to the BLOCK numbers (n = 0, 1, 2, ...).
The starting BLOCKs of the SafetyGroups are therefore:
SafetyGroup0 = 64 + 256*n
SafetyGroup1 = 152 + 256*n
SafetyGroup2 = 236 + 256*n
5. SKIP BLOCKGROUPs
Here is the important rule:
Every fourth BLOCKGROUP is SKIP, starting at INDEX 0.
SKIP = (INDEX MOD 4 = 0)
So the SKIP INDEX values are:
0, 4, 8, 12, 16, 20, 24, 28, ... 60
For the first INDEXGROUP, the SKIP BLOCKGROUPs start at these BlockIDs:
64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304
And that automatically explains why the three SafetyGroups have different numbers of BLOCKGROUPs:
- SafetyGroup0 contains INDEX 0-21. Its SKIP indices are 0, 4, 8, 12, 16 and 20. Result: 22 - 6 = 16 security bits.
- SafetyGroup1 contains INDEX 22-42. Its first SKIP INDEX is 24, the third BLOCKGROUP inside SafetyGroup1. Result: 21 - 5 = 16 security bits.
- SafetyGroup2 contains INDEX 43-63. Its first SKIP INDEX is 44, the second BLOCKGROUP inside SafetyGroup2. Result: 21 - 5 = 16 security bits.
| BlockID | INDEX | SKIP? | Meaning for security |
| 64 | 0 | Yes | No security bit |
| 68 | 1 | No | Bit 0 of SecuritySequence0 |
| 72 | 2 | No | Bit 1 of SecuritySequence0 |
| 76 | 3 | No | Bit 2 of SecuritySequence0 |
| 80 | 4 | Yes | No security bit |
| 84 | 5 | No | Bit 3 of SecuritySequence0 |
| 96 | 8 | Yes | No security bit |
Note that this list only shows the first BLOCK (GROUPITEM 0) of each BLOCKGROUP.
6. How one BLOCKGROUP gives a security bit
Each BLOCKGROUP consists of four BLOCKs. As mentioned, I call their positions GROUPITEM 0, 1, 2 and 3.
For a non-SKIP BLOCKGROUP, only GROUPITEM 0 and GROUPITEM 1 are checked to get the next security bit:
IsSN = (GROUPITEM 0 is SERIAL) OR (GROUPITEM 1 is SERIAL)
If either is a SERIAL BLOCK, IsSN is 1. If both are COUNTING BLOCKs, IsSN is 0.
| GROUPITEM 0 | GROUPITEM 1 | IsSN |
| COUNTING | COUNTING | 0 |
| SERIAL | COUNTING | 1 |
| COUNTING | SERIAL | 1 |
| SERIAL | SERIAL | 1 |
That one bit is added to the SecuritySequence for the current SafetyGroup. After 16 non-SKIP BLOCKGROUPs, the sequence is complete.
SERIAL detection and security bit insertion (SecureIrqProcess):
| 0804D360 TEST ESI,ESI ; reel number = 0 ? 0804D362 JZ LAB_0804D431 ; SERIAL BLOCK 0804D433 MOV [...],0x1 ; IsSN = 1 0804D3AA SHR EAX,0x1 ; shift security register 0804D445 OR AH,0x80 ; set bit 15 |
The first received bit is bit 0 (the rightmost bit of the finished 16-bit number). The final received bit is bit 15 (the leftmost bit).
GROUPITEM 2 and GROUPITEM 3 don't add security bits. They are also used by the decoder to keep the latest reel number for the CRC calculation (more on that later), and to reset IsSN for the next BLOCKGROUP.
Let's take BLOCKs 68-71 as an example:
| BlockID | GROUPITEM | What happens |
| 68 | 0 | SERIAL found, so IsSN becomes 1 |
| 69 | 1 | COUNTING found; IsSN stays 1. Store security bit 1 |
| 70 | 2 | Keep reel information and reset IsSN |
| 71 | 3 | Update reel information and leave IsSN at 0 |
The next useful BLOCKGROUP is 72-75, which produces the next bit. BLOCKGROUP 80-83 is SKIP and contributes nothing to the SecuritySequence.
In the real sample I captured, all the SN-Blocks are on GROUPITEM 0. So there are always at least three COUNTING BLOCKs between two SN-Blocks. The processor still accepts SN-Blocks on GROUPITEM 1 too - more on that below.
Continued in the next post due to the 10,000-character limit...

Comment