OpusExtensions: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
(Derf's braindump from IRC)
(Add list of all invalid TOC sequences (both assigned and unassigned))
Line 3: Line 3:
Below is a list of such alternate sequences, to avoid duplication.
Below is a list of such alternate sequences, to avoid duplication.


== List of invalid Opus audio data sequences ==
== List of reserved invalid Opus TOC sequences ==


* `Op` is used as a prefix for metadata headers in .opus files. [https://tools.ietf.org/html/draft-ietf-codec-oggopus RFC 7845]
* `Op` is used as a prefix for metadata headers in .opus files. [https://tools.ietf.org/html/draft-ietf-codec-oggopus RFC 7845]
* '0x3FF' in the first 11 bits marks an `opus_access_unit` in mpeg-ts. [[OpusTS]]
* '0x3FF' in the first 11 bits marks an `opus_control_header` in MPEG-TS. [[OpusTS]]


== Constructing invalid sequences ==
== Constructing invalid TOC sequences ==


   The only restriction that doesn't depend on the number of bytes  
   The only restriction that doesn't depend on the number of bytes  
   in the packet is [R5], which is, "Code 3 packets contain at least  
   in the packet is [R5], which is, "Code 3 packets contain at least  
   one frame, but no more than 120 ms of audio total."
   one frame, but no more than 120 ms of audio total."
== Space of all invalid Opus TOC sequences ==
* 0x0300
* 0x030C...0x0340
* 0x034C...0x0380
* 0x038C...0x03C0
* 0x03CC...0x03FF
* 0x0700
* 0x070C...0x0740
* 0x074C...0x0780
* 0x078C...0x07C0
* 0x07CC...0x07FF
* 0x0B00
* 0x0B06...0x0B40
* 0x0B46...0x0B80
* 0x0B86...0x0BC0
* 0x0BC6...0x0BFF
* 0x0F00
* 0x0F06...0x0F40
* 0x0F46...0x0F80
* 0x0F86...0x0FC0
* 0x0FC6...0x0FFF
* 0x1300
* 0x1303...0x1340
* 0x1343...0x1380
* 0x1383...0x13C0
* 0x13C3...0x13FF
* 0x1700
* 0x1703...0x1740
* 0x1743...0x1780
* 0x1783...0x17C0
* 0x17C3...0x17FF
* 0x1B00
* 0x1B02...0x1B40
* 0x1B42...0x1B80
* 0x1B82...0x1BC0
* 0x1BC2...0x1BFF
* 0x1F00
* 0x1F02...0x1F40
* 0x1F42...0x1F80
* 0x1F82...0x1FC0
* 0x1FC2...0x1FFF
* 0x2300
* 0x230C...0x2340
* 0x234C...0x2380
* 0x238C...0x23C0
* 0x23CC...0x23FF
* 0x2700
* 0x270C...0x2740
* 0x274C...0x2780
* 0x278C...0x27C0
* 0x27CC...0x27FF
* 0x2B00
* 0x2B06...0x2B40
* 0x2B46...0x2B80
* 0x2B86...0x2BC0
* 0x2BC6...0x2BFF
* 0x2F00
* 0x2F06...0x2F40
* 0x2F46...0x2F80
* 0x2F86...0x2FC0
* 0x2FC6...0x2FFF
* 0x3300
* 0x3303...0x3340
* 0x3343...0x3380
* 0x3383...0x33C0
* 0x33C3...0x33FF
* 0x3700
* 0x3703...0x3740
* 0x3743...0x3780
* 0x3783...0x37C0
* 0x37C3...0x37FF
* 0x3B00
* 0x3B02...0x3B40
* 0x3B42...0x3B80
* 0x3B82...0x3BC0
* 0x3BC2...0x3BFF
* 0x3F00
* 0x3F02...0x3F40
* 0x3F42...0x3F80
* 0x3F82...0x3FC0
* 0x3FC2...0x3FFF
* 0x4300
* 0x430C...0x4340
* 0x434C...0x4380
* 0x438C...0x43C0
* 0x43CC...0x43FF
* 0x4700
* 0x470C...0x4740
* 0x474C...0x4780
* 0x478C...0x47C0
* 0x47CC...0x47FF
* 0x4B00
* 0x4B06...0x4B40
* 0x4B46...0x4B80
* 0x4B86...0x4BC0
* 0x4BC6...0x4BFF
* 0x4F00
* 0x4F06...0x4F40
* 0x4F46...0x4F6F
* 0x4F70 ("Op"): ID and Comment headers in .opus files [https://tools.ietf.org/html/draft-ietf-codec-oggopus RFC 7845]
* 0x4F71...0x4F80
* 0x4F86...0x4FC0
* 0x4FC6...0x4FFF
* 0x5300
* 0x5303...0x5340
* 0x5343...0x5380
* 0x5383...0x53C0
* 0x53C3...0x53FF
* 0x5700
* 0x5703...0x5740
* 0x5743...0x5780
* 0x5783...0x57C0
* 0x57C3...0x57FF
* 0x5B00
* 0x5B02...0x5B40
* 0x5B42...0x5B80
* 0x5B82...0x5BC0
* 0x5BC2...0x5BFF
* 0x5F00
* 0x5F02...0x5F40
* 0x5F42...0x5F80
* 0x5F82...0x5FC0
* 0x5FC2...0x5FFF
* 0x6300
* 0x630C...0x6340
* 0x634C...0x6380
* 0x638C...0x63C0
* 0x63CC...0x63FF
* 0x6700
* 0x670C...0x6740
* 0x674C...0x6780
* 0x678C...0x67C0
* 0x67CC...0x67FF
* 0x6B00
* 0x6B06...0x6B40
* 0x6B46...0x6B80
* 0x6B86...0x6BC0
* 0x6BC6...0x6BFF
* 0x6F00
* 0x6F06...0x6F40
* 0x6F46...0x6F80
* 0x6F86...0x6FC0
* 0x6FC6...0x6FFF
* 0x7300
* 0x730C...0x7340
* 0x734C...0x7380
* 0x738C...0x73C0
* 0x73CC...0x73FF
* 0x7700
* 0x770C...0x7740
* 0x774C...0x7780
* 0x778C...0x77C0
* 0x77CC...0x77FF
* 0x7B00
* 0x7B06...0x7B40
* 0x7B46...0x7B80
* 0x7B86...0x7BC0
* 0x7BC6...0x7BFF
* 0x7F00
* 0x7F06...0x7F40
* 0x7F46...0x7F80
* 0x7F86...0x7FC0
* 0x7FC6...0x7FDF
* 0x7FE0...0x7FFF: opus_control_header in MPEG-TS [[OpusTS]]
* 0x8300
* 0x8330...0x8340
* 0x8370...0x8380
* 0x83B0...0x83C0
* 0x83F0...0x83FF
* 0x8700
* 0x8730...0x8740
* 0x8770...0x8780
* 0x87B0...0x87C0
* 0x87F0...0x87FF
* 0x8B00
* 0x8B18...0x8B40
* 0x8B58...0x8B80
* 0x8B98...0x8BC0
* 0x8BD8...0x8BFF
* 0x8F00
* 0x8F18...0x8F40
* 0x8F58...0x8F80
* 0x8F98...0x8FC0
* 0x8FD8...0x8FFF
* 0x9300
* 0x930C...0x9340
* 0x934C...0x9380
* 0x938C...0x93C0
* 0x93CC...0x93FF
* 0x9700
* 0x970C...0x9740
* 0x974C...0x9780
* 0x978C...0x97C0
* 0x97CC...0x97FF
* 0x9B00
* 0x9B06...0x9B40
* 0x9B46...0x9B80
* 0x9B86...0x9BC0
* 0x9BC6...0x9BFF
* 0x9F00
* 0x9F06...0x9F40
* 0x9F46...0x9F80
* 0x9F86...0x9FC0
* 0x9FC6...0x9FFF
* 0xA300
* 0xA330...0xA340
* 0xA370...0xA380
* 0xA3B0...0xA3C0
* 0xA3F0...0xA3FF
* 0xA700
* 0xA730...0xA740
* 0xA770...0xA780
* 0xA7B0...0xA7C0
* 0xA7F0...0xA7FF
* 0xAB00
* 0xAB18...0xAB40
* 0xAB58...0xAB80
* 0xAB98...0xABC0
* 0xABD8...0xABFF
* 0xAF00
* 0xAF18...0xAF40
* 0xAF58...0xAF80
* 0xAF98...0xAFC0
* 0xAFD8...0xAFFF
* 0xB300
* 0xB30C...0xB340
* 0xB34C...0xB380
* 0xB38C...0xB3C0
* 0xB3CC...0xB3FF
* 0xB700
* 0xB70C...0xB740
* 0xB74C...0xB780
* 0xB78C...0xB7C0
* 0xB7CC...0xB7FF
* 0xBB00
* 0xBB06...0xBB40
* 0xBB46...0xBB80
* 0xBB86...0xBBC0
* 0xBBC6...0xBBFF
* 0xBF00
* 0xBF06...0xBF40
* 0xBF46...0xBF80
* 0xBF86...0xBFC0
* 0xBFC6...0xBFFF
* 0xC300
* 0xC330...0xC340
* 0xC370...0xC380
* 0xC3B0...0xC3C0
* 0xC3F0...0xC3FF
* 0xC700
* 0xC730...0xC740
* 0xC770...0xC780
* 0xC7B0...0xC7C0
* 0xC7F0...0xC7FF
* 0xCB00
* 0xCB18...0xCB40
* 0xCB58...0xCB80
* 0xCB98...0xCBC0
* 0xCBD8...0xCBFF
* 0xCF00
* 0xCF18...0xCF40
* 0xCF58...0xCF80
* 0xCF98...0xCFC0
* 0xCFD8...0xCFFF
* 0xD300
* 0xD30C...0xD340
* 0xD34C...0xD380
* 0xD38C...0xD3C0
* 0xD3CC...0xD3FF
* 0xD700
* 0xD70C...0xD740
* 0xD74C...0xD780
* 0xD78C...0xD7C0
* 0xD7CC...0xD7FF
* 0xDB00
* 0xDB06...0xDB40
* 0xDB46...0xDB80
* 0xDB86...0xDBC0
* 0xDBC6...0xDBFF
* 0xDF00
* 0xDF06...0xDF40
* 0xDF46...0xDF80
* 0xDF86...0xDFC0
* 0xDFC6...0xDFFF
* 0xE300
* 0xE330...0xE340
* 0xE370...0xE380
* 0xE3B0...0xE3C0
* 0xE3F0...0xE3FF
* 0xE700
* 0xE730...0xE740
* 0xE770...0xE780
* 0xE7B0...0xE7C0
* 0xE7F0...0xE7FF
* 0xEB00
* 0xEB18...0xEB40
* 0xEB58...0xEB80
* 0xEB98...0xEBC0
* 0xEBD8...0xEBFF
* 0xEF00
* 0xEF18...0xEF40
* 0xEF58...0xEF80
* 0xEF98...0xEFC0
* 0xEFD8...0xEFFF
* 0xF300
* 0xF30C...0xF340
* 0xF34C...0xF380
* 0xF38C...0xF3C0
* 0xF3CC...0xF3FF
* 0xF700
* 0xF70C...0xF740
* 0xF74C...0xF780
* 0xF78C...0xF7C0
* 0xF7CC...0xF7FF
* 0xFB00
* 0xFB06...0xFB40
* 0xFB46...0xFB80
* 0xFB86...0xFBC0
* 0xFBC6...0xFBFF
* 0xFF00
* 0xFF06...0xFF40
* 0xFF46...0xFF80
* 0xFF86...0xFFC0
* 0xFFC6...0xFFFF

Revision as of 13:06, 19 April 2016

Opus audio data packets begin with a "table of contents" (TOC) sequence which defines the frame duration, audio bandwidth and coding mode of the packet, as well as describing how individual frames are packed into the data packet. [RFC 6716 Section 3.1]. Other types of data packets are used with Opus in various containers are designed to start with a sequence which is not a valid TOC. This simplifies sorting such data for muxing implementations and ensures they will be rejected by the decoder if they are accidentally passed as Opus audio data.

Below is a list of such alternate sequences, to avoid duplication.

List of reserved invalid Opus TOC sequences

  • `Op` is used as a prefix for metadata headers in .opus files. RFC 7845
  • '0x3FF' in the first 11 bits marks an `opus_control_header` in MPEG-TS. OpusTS

Constructing invalid TOC sequences

 The only restriction that doesn't depend on the number of bytes 
 in the packet is [R5], which is, "Code 3 packets contain at least 
 one frame, but no more than 120 ms of audio total."

Space of all invalid Opus TOC sequences

  • 0x0300
  • 0x030C...0x0340
  • 0x034C...0x0380
  • 0x038C...0x03C0
  • 0x03CC...0x03FF
  • 0x0700
  • 0x070C...0x0740
  • 0x074C...0x0780
  • 0x078C...0x07C0
  • 0x07CC...0x07FF
  • 0x0B00
  • 0x0B06...0x0B40
  • 0x0B46...0x0B80
  • 0x0B86...0x0BC0
  • 0x0BC6...0x0BFF
  • 0x0F00
  • 0x0F06...0x0F40
  • 0x0F46...0x0F80
  • 0x0F86...0x0FC0
  • 0x0FC6...0x0FFF
  • 0x1300
  • 0x1303...0x1340
  • 0x1343...0x1380
  • 0x1383...0x13C0
  • 0x13C3...0x13FF
  • 0x1700
  • 0x1703...0x1740
  • 0x1743...0x1780
  • 0x1783...0x17C0
  • 0x17C3...0x17FF
  • 0x1B00
  • 0x1B02...0x1B40
  • 0x1B42...0x1B80
  • 0x1B82...0x1BC0
  • 0x1BC2...0x1BFF
  • 0x1F00
  • 0x1F02...0x1F40
  • 0x1F42...0x1F80
  • 0x1F82...0x1FC0
  • 0x1FC2...0x1FFF
  • 0x2300
  • 0x230C...0x2340
  • 0x234C...0x2380
  • 0x238C...0x23C0
  • 0x23CC...0x23FF
  • 0x2700
  • 0x270C...0x2740
  • 0x274C...0x2780
  • 0x278C...0x27C0
  • 0x27CC...0x27FF
  • 0x2B00
  • 0x2B06...0x2B40
  • 0x2B46...0x2B80
  • 0x2B86...0x2BC0
  • 0x2BC6...0x2BFF
  • 0x2F00
  • 0x2F06...0x2F40
  • 0x2F46...0x2F80
  • 0x2F86...0x2FC0
  • 0x2FC6...0x2FFF
  • 0x3300
  • 0x3303...0x3340
  • 0x3343...0x3380
  • 0x3383...0x33C0
  • 0x33C3...0x33FF
  • 0x3700
  • 0x3703...0x3740
  • 0x3743...0x3780
  • 0x3783...0x37C0
  • 0x37C3...0x37FF
  • 0x3B00
  • 0x3B02...0x3B40
  • 0x3B42...0x3B80
  • 0x3B82...0x3BC0
  • 0x3BC2...0x3BFF
  • 0x3F00
  • 0x3F02...0x3F40
  • 0x3F42...0x3F80
  • 0x3F82...0x3FC0
  • 0x3FC2...0x3FFF
  • 0x4300
  • 0x430C...0x4340
  • 0x434C...0x4380
  • 0x438C...0x43C0
  • 0x43CC...0x43FF
  • 0x4700
  • 0x470C...0x4740
  • 0x474C...0x4780
  • 0x478C...0x47C0
  • 0x47CC...0x47FF
  • 0x4B00
  • 0x4B06...0x4B40
  • 0x4B46...0x4B80
  • 0x4B86...0x4BC0
  • 0x4BC6...0x4BFF
  • 0x4F00
  • 0x4F06...0x4F40
  • 0x4F46...0x4F6F
  • 0x4F70 ("Op"): ID and Comment headers in .opus files RFC 7845
  • 0x4F71...0x4F80
  • 0x4F86...0x4FC0
  • 0x4FC6...0x4FFF
  • 0x5300
  • 0x5303...0x5340
  • 0x5343...0x5380
  • 0x5383...0x53C0
  • 0x53C3...0x53FF
  • 0x5700
  • 0x5703...0x5740
  • 0x5743...0x5780
  • 0x5783...0x57C0
  • 0x57C3...0x57FF
  • 0x5B00
  • 0x5B02...0x5B40
  • 0x5B42...0x5B80
  • 0x5B82...0x5BC0
  • 0x5BC2...0x5BFF
  • 0x5F00
  • 0x5F02...0x5F40
  • 0x5F42...0x5F80
  • 0x5F82...0x5FC0
  • 0x5FC2...0x5FFF
  • 0x6300
  • 0x630C...0x6340
  • 0x634C...0x6380
  • 0x638C...0x63C0
  • 0x63CC...0x63FF
  • 0x6700
  • 0x670C...0x6740
  • 0x674C...0x6780
  • 0x678C...0x67C0
  • 0x67CC...0x67FF
  • 0x6B00
  • 0x6B06...0x6B40
  • 0x6B46...0x6B80
  • 0x6B86...0x6BC0
  • 0x6BC6...0x6BFF
  • 0x6F00
  • 0x6F06...0x6F40
  • 0x6F46...0x6F80
  • 0x6F86...0x6FC0
  • 0x6FC6...0x6FFF
  • 0x7300
  • 0x730C...0x7340
  • 0x734C...0x7380
  • 0x738C...0x73C0
  • 0x73CC...0x73FF
  • 0x7700
  • 0x770C...0x7740
  • 0x774C...0x7780
  • 0x778C...0x77C0
  • 0x77CC...0x77FF
  • 0x7B00
  • 0x7B06...0x7B40
  • 0x7B46...0x7B80
  • 0x7B86...0x7BC0
  • 0x7BC6...0x7BFF
  • 0x7F00
  • 0x7F06...0x7F40
  • 0x7F46...0x7F80
  • 0x7F86...0x7FC0
  • 0x7FC6...0x7FDF
  • 0x7FE0...0x7FFF: opus_control_header in MPEG-TS OpusTS
  • 0x8300
  • 0x8330...0x8340
  • 0x8370...0x8380
  • 0x83B0...0x83C0
  • 0x83F0...0x83FF
  • 0x8700
  • 0x8730...0x8740
  • 0x8770...0x8780
  • 0x87B0...0x87C0
  • 0x87F0...0x87FF
  • 0x8B00
  • 0x8B18...0x8B40
  • 0x8B58...0x8B80
  • 0x8B98...0x8BC0
  • 0x8BD8...0x8BFF
  • 0x8F00
  • 0x8F18...0x8F40
  • 0x8F58...0x8F80
  • 0x8F98...0x8FC0
  • 0x8FD8...0x8FFF
  • 0x9300
  • 0x930C...0x9340
  • 0x934C...0x9380
  • 0x938C...0x93C0
  • 0x93CC...0x93FF
  • 0x9700
  • 0x970C...0x9740
  • 0x974C...0x9780
  • 0x978C...0x97C0
  • 0x97CC...0x97FF
  • 0x9B00
  • 0x9B06...0x9B40
  • 0x9B46...0x9B80
  • 0x9B86...0x9BC0
  • 0x9BC6...0x9BFF
  • 0x9F00
  • 0x9F06...0x9F40
  • 0x9F46...0x9F80
  • 0x9F86...0x9FC0
  • 0x9FC6...0x9FFF
  • 0xA300
  • 0xA330...0xA340
  • 0xA370...0xA380
  • 0xA3B0...0xA3C0
  • 0xA3F0...0xA3FF
  • 0xA700
  • 0xA730...0xA740
  • 0xA770...0xA780
  • 0xA7B0...0xA7C0
  • 0xA7F0...0xA7FF
  • 0xAB00
  • 0xAB18...0xAB40
  • 0xAB58...0xAB80
  • 0xAB98...0xABC0
  • 0xABD8...0xABFF
  • 0xAF00
  • 0xAF18...0xAF40
  • 0xAF58...0xAF80
  • 0xAF98...0xAFC0
  • 0xAFD8...0xAFFF
  • 0xB300
  • 0xB30C...0xB340
  • 0xB34C...0xB380
  • 0xB38C...0xB3C0
  • 0xB3CC...0xB3FF
  • 0xB700
  • 0xB70C...0xB740
  • 0xB74C...0xB780
  • 0xB78C...0xB7C0
  • 0xB7CC...0xB7FF
  • 0xBB00
  • 0xBB06...0xBB40
  • 0xBB46...0xBB80
  • 0xBB86...0xBBC0
  • 0xBBC6...0xBBFF
  • 0xBF00
  • 0xBF06...0xBF40
  • 0xBF46...0xBF80
  • 0xBF86...0xBFC0
  • 0xBFC6...0xBFFF
  • 0xC300
  • 0xC330...0xC340
  • 0xC370...0xC380
  • 0xC3B0...0xC3C0
  • 0xC3F0...0xC3FF
  • 0xC700
  • 0xC730...0xC740
  • 0xC770...0xC780
  • 0xC7B0...0xC7C0
  • 0xC7F0...0xC7FF
  • 0xCB00
  • 0xCB18...0xCB40
  • 0xCB58...0xCB80
  • 0xCB98...0xCBC0
  • 0xCBD8...0xCBFF
  • 0xCF00
  • 0xCF18...0xCF40
  • 0xCF58...0xCF80
  • 0xCF98...0xCFC0
  • 0xCFD8...0xCFFF
  • 0xD300
  • 0xD30C...0xD340
  • 0xD34C...0xD380
  • 0xD38C...0xD3C0
  • 0xD3CC...0xD3FF
  • 0xD700
  • 0xD70C...0xD740
  • 0xD74C...0xD780
  • 0xD78C...0xD7C0
  • 0xD7CC...0xD7FF
  • 0xDB00
  • 0xDB06...0xDB40
  • 0xDB46...0xDB80
  • 0xDB86...0xDBC0
  • 0xDBC6...0xDBFF
  • 0xDF00
  • 0xDF06...0xDF40
  • 0xDF46...0xDF80
  • 0xDF86...0xDFC0
  • 0xDFC6...0xDFFF
  • 0xE300
  • 0xE330...0xE340
  • 0xE370...0xE380
  • 0xE3B0...0xE3C0
  • 0xE3F0...0xE3FF
  • 0xE700
  • 0xE730...0xE740
  • 0xE770...0xE780
  • 0xE7B0...0xE7C0
  • 0xE7F0...0xE7FF
  • 0xEB00
  • 0xEB18...0xEB40
  • 0xEB58...0xEB80
  • 0xEB98...0xEBC0
  • 0xEBD8...0xEBFF
  • 0xEF00
  • 0xEF18...0xEF40
  • 0xEF58...0xEF80
  • 0xEF98...0xEFC0
  • 0xEFD8...0xEFFF
  • 0xF300
  • 0xF30C...0xF340
  • 0xF34C...0xF380
  • 0xF38C...0xF3C0
  • 0xF3CC...0xF3FF
  • 0xF700
  • 0xF70C...0xF740
  • 0xF74C...0xF780
  • 0xF78C...0xF7C0
  • 0xF7CC...0xF7FF
  • 0xFB00
  • 0xFB06...0xFB40
  • 0xFB46...0xFB80
  • 0xFB86...0xFBC0
  • 0xFBC6...0xFBFF
  • 0xFF00
  • 0xFF06...0xFF40
  • 0xFF46...0xFF80
  • 0xFF86...0xFFC0
  • 0xFFC6...0xFFFF