Skip to content
Snippets Groups Projects

Support Ambisonics

Open Timothy B. Terriberry requested to merge tterribe/opusfile:ambisonics6 into master
  1. Feb 28, 2022
    • Timothy B. Terriberry's avatar
      Fix an unchecked allocation. · 0b5ef56d
      Timothy B. Terriberry authored
      Also mark other allocation failures with our unlikely macro.
      0b5ef56d
    • Timothy B. Terriberry's avatar
      Improve handling of large channel counts. · b617799a
      Timothy B. Terriberry authored
      Previously, the surround mappings only supported up to 8 channels.
      With ambisonics, this has been increased to 227.
      This has made a number of arrays that were sized based on the
       maximum channel count less reasonably sized.
      In particular, the (static) stereo downmixing table grew from 512
       bytes to over 400kB (of almost entirely zeros), and the
       (laziy-allocated) decoder scratch buffer grew from 45kB to almost
       1.25MB.
      
      Introduce a new OP_NSURROUND_CHANNELS_MAX constant with the old
       value (8), and use it in the places that deal only with surround
       channel mapping families (this restores the stereo downmixing
       tables to their previous size).
      For the decoder scratch buffer, grow it dynamically instead of
       reserving the maximum size in advance, since the 1.25MB number is
       theoretically achievable.
      
      The impact on, e.g., the fixed-point conversion dither and clipping
       state and the current link's channel mapping was less dramatic, so
       these are left as-is.
      b617799a
    • Andrew Allen's avatar
      Support Ambisonics. · 2a24e431
      Andrew Allen authored
      Additional review comments addressed and stereo downmixing support
       by Timothy B. Terriberry.
      Minor revisions by Felicia Lim:
      - Bump OP_NCHANNELS_MAX to 227.
      - Fail if trying to decode mapping family 3 but providing
        a null pointer for storing the demixing matrix and/or length.
      2a24e431
  2. Feb 05, 2022
Loading