transmux 0.15.2

MPEG-2 TS → CMAF/fMP4 remux: typed ISOBMFF boxes, a samples-in init/media segment builder, Annex B ↔ length-prefixed NAL, and HLS playlist generation (ISO/IEC 14496-12, RFC 8216).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# Annex E (normative): Enhanced AC-3

## E.0 Scope

This annex defines the audio coding algorithm denoted as Enhanced AC-3 ("E-AC-3") and the alterations to the AC-3 bit stream necessary to convey E-AC-3 data along with a reference decoding process. E-AC-3 bit streams are similar in nature to standard AC-3 bit streams but are not backwardly compatible (i.e., they are not decodable by standard AC-3 decoders). This annex specifies either directly or by reference the bit stream syntax of E-AC-3. When an AC-3 bit stream carries E-AC-3 bit stream syntax, it is referred herein to as an E-AC-3 bit stream.

## E.1 Bit stream syntax and semantics specification

### E.1.1 Indication of Enhanced AC-3 bit stream syntax

An AC-3 bit stream is indicated as using the Enhanced AC-3 bit stream syntax described in this annex when the bit stream identification (bsid) field is set to 16. To enable differentiation between an AC-3 bit stream and an E-AC-3 bit stream, the bsid field is placed the same number of bits from the beginning of the syncframe as defined in the syntax below.

### E.1.2 Syntax specification

### E.1.2.0 E-AC-3\_bit\_stream and syncframe

Unless otherwise specified, all bit stream elements shall have the same meaning and purpose as described in the body and Annex D of the present document. Single bit boolean values shall be treated as '1' equals TRUE. A continuous audio bit stream consists of a sequence of synchronization frames.

```
Syntax
E-AC-3_bit_stream() 
{ 
   while(true) 
   { 
 syncframe() ; 
   } 
} /* end of bit stream */
```

The syncframe consists of the syncinfo, bsi and audfrm fields, up to 6 coded audblk fields, the auxdata field, and the errorcheck field.

```
Syntax
syncframe() 
{ 
 syncinfo() ; 
 bsi() ; 
 audfrm() ; 
  for(blk = 0; blk < number_of_blocks_per_syncframe; blk++) 
  { 
 audblk() ; 
  } 
 auxdata() ; 
 errorcheck() ; 
} /* end of syncframe */
```

Each of the bit stream elements, and their length, are itemized in the following pseudo code. Note that all bit stream elements arrive most significant bit first, or left bit first, in time.

#### E.1.2.1 syncinfo - Synchronization information

```
Syntax
syncinfo()
{
syncword
} /* end of syncinfo */

Syntax
Word size
```

#### E.1.2.2 bsi - Bit stream information

```
Word size
Syntax
bsi()
         substreamid
        numblkscod ....................................
        if(compre) {compr} . . . . . . . . . . . . . . . . . . .
        if (acmod == 0x0) /* if 1+1 mode (dual mono, so some items need a second value) */
                 if(compr2e) {compr2} 8
         if(strmtyp == 0x1) /* if dependent stream */
                 chanmape ....................................
                 if(chanmape) {chanmap} . . . . . . . . . . . . . . . . . . .
         if(mixmdate) /* mixing metadata */
                 if(acmod > 0x2) /* if more than 2 channels */ {dmixmod} ....................................
                 if((acmod & 0x1) && (acmod > 0x2)) /* if three front channels exist */
                         lorocmixlev ....................................
                 if(acmod & 0x4) /* if a surround channel exists */
                         lorosurmixlev ....................................
                 if(lfeon) /* if the LFE channel exists */
                          if(lfemixlevcode) {lfemixlevcod} . . . . . . . . . . . . . . . . . . .
                 if (strmtyp == 0x0) /* if independent stream */
                          if(pgmscle) {pgmscl}....................................
                          if (acmod == 0x0) /* if 1+1 mode (dual mono, so some items need a second value) */
                                  pqmsc12e ....................................
                                  if(pqmsc12e) {pqmsc12} ....................................
                          extpqmscle ....................................
                          if(extpgmscle) {extpgmscl} ....................................
                          if (mixdef == 0x1) /* mixing option 2 */
                                  {\tt premixcmpsel} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.5cm} \underline{\phantom{a}} \hspace{1.
                                  dresre ..................................
                          else if(mixdef == 0x2) /* mixing option 3 */ {mixdata} ...................................
```

```
Word size
Syntax
     else if (mixdef == 0x3) /* mixing option 4 */
      mixdeflen ....................................
      mixdata2e ....................................
       if (mixdata2e)
        drcsrc ..................................
        premixcmpscl ....................................
        extpgmlscle ....................................
        if(extpgmlscle) {extpgmlscl} .....
        extpomcscle
        if(extpgmcscle) {extpgmcscl} . . . . . . . . . . . . . . . . . . .
        extpgmrscle .....
        if(extpgmrscle) {extpgmrscl} ....................................
        extpgmlsscle .....
        if(extpgmlsscle) {extpgmlsscl} .....
        extpgmrsscle ....................................
        if(extpgmrsscle) {extpgmrsscl} .....
        {\tt extpgmlfescle} \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots
        if(extpgmlfescle) {extpgmlfescl} ......4
        dmixscle ....................................
        if(dmixscle) {dmixscl} ....................................
        addche
        if (addche)
          extpgmaux1scle ....................................
          if(extpgmaux1scle) {extpgmaux1scl} ..... 4
          extpgmaux2scle ....................................
          if(extpomaux2scle) {extpomaux2scl} . . . . . . . . . . . . . . . . . . .
      mixdata3e ....................................
      if(mixdata3e)
        addspchdate ....................................
        if (addspchdate)
          spchdat1 ..... 5
          spchanlatt ...................................
          addspchdatle ....
          if (addspdat1e)
            spchdat2 ....................................
      mixdata ..... (8*(mixdeflen+2)) - no. mixdata bits
      mixdatafill ...................................
     if (acmod < 0x2) /* if mono or dual mono source */
      paninfoe ....................................
       if (paninfoe)
        paninfo ....................................
       if(acmod == 0x0) /* if 1+1 mode (dual mono - some items need a second value) */
        paninfo2e ....................................
        if (paninfo2e)
          panmean2 ..... 8
          paninfo2 ...... 6
       }
     frmmixcfginfoe ...
     if(frmmixcfginfoe) /* mixing configuration information */
       if(numblkscod == 0x0) {blkmixcfginfo[0]} ......
      else
        for(blk = 0; blk < number of blocks per sync frame; blk++)</pre>
```

```
Word size
Syntax
          blkmixcfginfoe ......
          if(blkmixcfginfoe){blkmixcfginfo[blk]} ....................................
       }
     }
 infomdate ......
                             . . . . . . . . . . . . . . . . . . . . 
 if(infomdate) /* informational metadata */
   copyrightb ....................................
   origbs ...... 1
   if (acmod == 0x2) /* if in 2/0 mode */
     dsurmod ....................................
     dheadphonmod ....................................
   if(acmod >= 0x6) /* if both surround channels exist */ {dsurexmod} ....................................
   audprodie 1
   if (audprodie)
     roomtyp . . . . . . . . . . . . . . . . . . .
     adconvtyp ....................................
   if(acmod == 0x0) /* if 1+1 mode (dual mono, so some items need a second value) */
     audprodi2e ....................................
     if(audprodi2e)
       roomtvp2 ..... 2
       adconvtyp2 ..... 1
   if(fscod < 0x3) /* if not half sample rate */ {sourcefscod}....................................
 if( (strmtyp == 0x0) && (numblkscod != 0x3) ) {convsync} ....................................
 if(strmtyp == 0x2) /* if bit stream converted from AC-3 */
   if(numblkscod == 0x3) /* 6 blocks per syncframe */ {blkid = 1}
   else {blkid} ....................................
   if(blkid) {frmsizecod} ......6
 addbsie ....................................
 if(addbsie)
   addbsil ..... 6
```

#### E.1.2.3 audfrm - Audio frame

```
Syntax
audfrm()
{
/* these fields for audio frame exist flags and strategy data */
    if (numblkscod == 0x3) /* six blocks per syncframe */
        expstre
```

```
Syntax Word size
 bamode ..................................................................................... 1 
 frmfgaincode ............................................................................... 1 
 dbaflde .................................................................................... 1 
 skipflde ................................................................................... 1 
  spxattene .................................................................................. 1 
/* these fields for coupling data */ 
  if(acmod > 0x1) 
  { 
 cplstre[0] = 1 
 cplinu[0] ............................................................................... 1 
 for(blk = 1; blk < number_of_blocks_per_sync_frame; blk++) 
 { 
 cplstre[blk] ......................................................................... 1 
 if(cplstre[blk] == 1) {cplinu[blk]} .................................................. 1 
 else {cplinu[blk] = cplinu[blk-1]} 
 } 
  } 
  else 
  { 
 for(blk = 0; blk < number_of_blocks_per_sync_frame; blk++) {cplinu[blk] = 0} 
  } 
/* these fields for exponent strategy data */ 
  if(expstre) 
  { 
 for(blk = 0; blk < number_of_blocks_per_sync_frame; blk++) 
 { 
 if(cplinu[blk] == 1) {cplexpstr[blk]} ................................................ 2 
 for(ch = 0; ch < nfchans; ch++) {chexpstr[blk][ch]} .................................. 2 
 } 
  } 
  else 
  { 
 ncplblks = 0 
 for(blk = 0; blk < number_of_blocks_per_sync_frame; blk++) {ncplblks += cplinu[blk]} 
 if( (acmod > 0x1) && (ncplblks > 0) ) {frmcplexpstr} .................................... 5 
 for(ch = 0; ch < nfchans; ch++) {frmchexpstr[ch]} ....................................... 5 
 /* cplexpstr[blk] and chexpstr[blk][ch] derived from table lookups - see Table E.1.8*/ 
  } 
  if(lfeon) 
  { 
 for(blk = 0; blk < number_of_blocks_per_sync_frame; blk++) {lfeexpstr[blk]} ............. 1 
  } 
/* These fields for converter exponent strategy data */ 
 if(strmtyp == 0x0) 
 { 
 if(numblkscod != 0x3) {convexpstre} ..................................................... 1 
 else {convexpstre = 1} 
 if(convexpstre == 1) 
 { 
 for(ch = 0; ch < nfchans; ch++) {convexpstr[ch]} ..................................... 5 
 } 
 } 
/* these fields for AHT data */ 
  if(ahte) 
  { 
  /* coupling can use AHT only when coupling in use for all blocks */ 
 /* ncplregs derived from cplstre and cplexpstr - see clause E.2.4.2 */ 
 if( (ncplblks == 6) && (ncplregs ==1) ) {cplahtinu} ..................................... 1 
 else {cplahtinu = 0} 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 /* nchregs derived from chexpstr - see clause E.2.4.2 */ 
 if(nchregs[ch] == 1) {chahtinu[ch]} .................................................. 1 
 else {chahtinu[ch] = 0} 
 } 
 if(lfeon) 
 { 
 /* nlferegs derived from lfeexpstr - see clause E.2.4.2 */ 
 if(nlferegs == 1) {lfeahtinu} ........................................................ 1 
 else {lfeahtinu = 0} 
 } 
  } 
/* these fields for audio frame SNR offset data */ 
  if(snroffststr == 0x0) 
  { 
 frmcsnroffst ............................................................................ 6 
 frmfsnroffst ............................................................................ 4
```

```
Syntax Word size
  } 
/* these fields for audio frame transient pre-noise processing data */ 
  if(transproce) 
  { 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 chintransproc[ch] .................................................................... 1 
 if(chintransproc[ch]) 
 { 
 transprocloc[ch] ................................................................. 10 
 transproclen[ch] .................................................................. 8 
 } 
 } 
  } 
/* These fields for spectral extension attenuation data */ 
 if(spxattene) 
 { 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 chinspxatten[ch] ..................................................................... 1 
 if(chinspxatten[ch]) 
 { 
 spxattencod[ch] ................................................................... 5 
 } 
 } 
 } 
/* these fields for block start information */ 
  if (numblkscod != 0x0) {blkstrtinfoe} ...................................................... 1 
  else {blkstrtinfoe = 0} 
  if(blkstrtinfoe) 
  { 
 /* nblkstrtbits determined from frmsiz (see clause E.1.3.2.27) */ 
 blkstrtinfo .................................................................. nblkstrtbits 
  } 
/* these fields for syntax state initialization */ 
  for(ch = 0; ch < nfchans; ch++) 
  { 
 firstspxcos[ch] = 1 
 firstcplcos[ch] = 1 
  } 
  firstcplleak = 1 
} /* end of audfrm */
```

#### E.1.2.4 audblk - Audio block

```
Syntax Word size
audblk() 
{ 
/* these fields for block switch and dither flags */ 
  if(blkswe) 
  { 
 for(ch = 0; ch < nfchans; ch++) {blksw[ch]} ............................................. 1 
  } 
  else 
  { 
 for(ch = 0; ch < nfchans; ch++) {blksw[ch] = 0} 
  } 
  if(dithflage) 
  { 
 for(ch = 0; ch < nfchans; ch++) {dithflag[ch]} .......................................... 1 
  } 
  else 
  { 
 for(ch = 0; ch < nfchans; ch++) {dithflag[ch] = 1} /* dither on */ 
  } 
/* these fields for dynamic range control */ 
 dynrnge 1 
  if(dynrnge) {dynrng} ....................................................................... 8 
  if(acmod == 0x0) /* if 1+1 mode */ 
  { 
 dynrng2e ................................................................................ 1 
 if(dynrng2e) {dynrng2} .................................................................. 8 
  } 
/* these fields for spectral extension strategy information */
```

```
Syntax Word size
  if(blk == 0) {spxstre = 1} 
  else {spxstre} ............................................................................. 1 
  if(spxstre) 
  { 
 spxinu .................................................................................. 1 
 if(spxinu) 
 { 
 if(acmod == 0x1) 
 { 
 chinspx[0] = 1 
 } 
 else 
 { 
 for(ch = 0; ch < nfchans; ch++) {chinspx[ch]} ..................................... 1 
 } 
 spxstrtf ............................................................................. 2 
 spxbegf .............................................................................. 3 
 spxendf .............................................................................. 3 
 if(spxbegf < 6) {spx_begin_subbnd = spxbegf + 2} 
 else {spx_begin_subbnd = spxbegf * 2 - 3} 
 if(spxendf < 3) {spx_end_subbnd = spxendf + 5} 
 else {spx_end_subbnd = spxendf * 2 + 3} 
 spxbndstrce .......................................................................... 1 
 if(spxbndstrce) 
 { 
 for(bnd = spx_begin_subbnd+1; bnd < spx_end_subbnd ; bnd++) {spxbndstrc[bnd]} ..... 1 
 } 
 } 
 else /* !spxinu */ 
 { 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 chinspx[ch] = 0 
 firstspxcos[ch] = 1 
 } 
 } 
  } 
/* these fields for spectral extension coordinates */ 
  if(spxinu) 
  { 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 if(chinspx[ch]) 
 { 
 if(firstspxcos[ch]) 
 { 
 spxcoe[ch] = 1 
 firstspxcos[ch] = 0 
 } 
 else /* !firstspxcos[ch] */ {spxcoe[ch]} .......................................... 1 
 if(spxcoe[ch]) 
 { 
 spxblnd[ch] .................................................................... 5 
 mstrspxco[ch] .................................................................. 2 
 /* nspxbnds determined from spx_begin_subbnd, spx_end_subbnd, and spxbndstrc[ ] */ 
 for(bnd = 0; bnd < nspxbnds; bnd++) 
 { 
 spxcoexp[ch][bnd] ........................................................... 4 
 spxcomant[ch][bnd] .......................................................... 2 
 } 
 } 
 } 
 else /* !chinspx[ch] */ 
 { 
 firstspxcos[ch] = 1 
 } 
 } 
  } 
/* These fields for coupling strategy and enhanced coupling strategy information */ 
 if(cplstre[blk]) 
 { 
 if (cplinu[blk]) 
 { 
 ecplinu .............................................................................. 1 
 if (acmod == 0x2) 
 {
```

```
Syntax Word size
 chincpl[0] = 1 
 chincpl[1] = 1 
 } 
 else 
 { 
 for(ch = 0; ch < nfchans; ch++) {chincpl[ch]} ..................................... 1 
 } 
 if (ecplinu == 0) /* standard coupling in use */ 
 { 
 if(acmod == 0x2) {phsflginu} /* if in 2/0 mode */ ................................. 1 
 cplbegf ........................................................................... 4
 if (spxinu == 0) /* if SPX not in use */ 
 { 
 cplendf ........................................................................ 4
 } 
 else /* SPX in use */ 
 { 
 if (spxbegf < 6) 
 { 
 /* note that in this case the value of cplendf may be negative */ 
 cplendf = spxbegf - 2 
 } 
 else 
 { 
 cplendf = (spxbegf * 2) - 7 
 } 
 } 
 /* ncplsubnd = 3 + cplendf - cplbegf */ 
 cplbndstrce ....................................................................... 1
 if(cplbndstrce) 
 { 
 for(bnd = 1; bnd < ncplsubnd; bnd++) {cplbndstrc[bnd]} ......................... 1 
 } 
 } 
 else /* enhanced coupling in use */ 
 { 
 ecplbegf .......................................................................... 4
 if(ecplbegf < 3) {ecpl_begin_subbnd = ecplbegf * 2} 
 else if(ecplbegf < 13) {ecpl_begin_subbnd = ecplbegf + 2} 
 else {ecpl_begin_subbnd = ecplbegf * 2 - 10} 
 if (spxinu == 0) /* if SPX not in use */ 
 { 
 ecplendf ....................................................................... 4
 ecpl_end_subbnd = ecplendf + 7 
 } 
 else /* SPX in use */ 
 { 
 if (spxbegf < 6) 
 { 
 ecpl_end_subbnd = spxbegf + 5 
 } 
 else 
 { 
 ecpl_end_subbnd = spxbegf * 2 
 } 
 } 
 ecplbndstrce ...................................................................... 1
 if (ecplbndstrce) 
 { 
 for(sbnd = max(9, ecpl_begin_subbnd+1); sbnd < ecpl_end_subbnd; sbnd++) 
 { 
 ecplbndstrc[sbnd] ........................................................... 1
 } 
 } 
 } /* ecplinu[blk] */ 
 } 
 else /* !cplinu[blk] */ 
 { 
 for(ch = 0; ch < nfchans; ch++) 
 { 
 chincpl[ch] = 0 
 firstcplcos[ch] = 1 
 } 
 firstcplleak = 1 
 phsflginu = 0 
 ecplinu = 0;
```
## Semantic clauses (verified against ETSI TS 102 366 V1.4.1, added for #556)

- **§E.1.3.1.3 frmsiz — Frame size — 11 bits:** "The frmsiz field indicates a
  value one less than the overall size of the coded syncframe in 16-bit words.
  That is, this field may assume a value ranging from 0 to 2 047, and these
  values correspond to syncframe sizes ranging from 1 to 2 048."
  (`words_per_syncframe = frmsiz + 1`, §E.1.3.2.28.)
- **§E.1.3.1.2 substreamid (context):** "Dependent substreams shall
  immediately follow the independent substream with which they are
  associated." Independent substreams 1..7 may exist (multi-program);
  dependent substreams are assigned IDs 0..7 sequentially.