1. 25 Feb, 2022 3 commits
    • Timothy B. Terriberry's avatar
      Fix an unchecked allocation. · 78d232c1
      Timothy B. Terriberry authored
      Also mark other allocation failures with our unlikely macro.
      78d232c1
    • Timothy B. Terriberry's avatar
      Improve handling of large channel counts. · 680139b2
      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.
      680139b2
    • Andrew Allen's avatar
      Support Ambisonics. · 7c388d11
      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.
      7c388d11
  2. 05 Feb, 2022 1 commit
  3. 15 Jan, 2022 26 commits
  4. 23 Oct, 2021 3 commits
  5. 29 Jul, 2021 1 commit
  6. 31 May, 2021 2 commits
    • Ralph Giles's avatar
      Add release checksums for opusfile 0.1 and 0.2. · 56728646
      Ralph Giles authored
      Add checksums for the first two source releases for completeness.
      These are copied from and verified against downloads.xiph.org.
      56728646
    • Ralph Giles's avatar
      Add release checksums for opusfile 0.12. · c656ae14
      Ralph Giles authored
      We keep checksums of the release packages in the repo as a
      redundant and trustworthy reference. I found these in an
      old working repo; it looks like they weren't committed
      after the 0.12 release last year.
      
      Checked against the files on downloads.xiph.org.
      c656ae14
  7. 26 May, 2021 1 commit
  8. 16 Dec, 2020 2 commits
    • Timothy B. Terriberry's avatar
      Fix an incorrect assertion in op_pcm_seek_page(). · 729c88e7
      Timothy B. Terriberry authored
      When we were checking the current file offset to see if we should
       use it as the starting bisection point, we assumed that offset was
       larger than the start of the data range for that link (and
       consequently, inside the bisection range).
      If there is a random page earlier in the file that happens to use
       the same serial number as a link we identified later in the file
       at file open time, and we had stopped reading there before the
       seek, then this assumption might not be true.
      
      Ironically, it was not the case that contained the assertion that
       had trouble with such an offset.
      It would fail the check that we were cutting off more than half the
       range, since we were actually cutting off a negative amount, and
       fall back to the midpoint of the link as the first bisection
       point.
      However, the case below that (where the target comes after the
       current timestamp), we might have erroneously cut off the entire
       range (setting end to offset, which was less than begi...
      729c88e7
    • Timothy B. Terriberry's avatar
      Fix intermediate overflow in op_pcm_total(). · 82adfb61
      Timothy B. Terriberry authored
      Although link enumeration ensures the return value is in range, the
       order of operations allows the intermediate value pcm_total+diff
       to overflow the range of a 64-bit int.
      Add parentheses to ensure this does not happen.
      Thanks to Felcia Lim for the report.
      
      Fixes #2330
      82adfb61
  9. 13 Oct, 2020 1 commit
    • Timothy B. Terriberry's avatar
      Fix short-circuit test when seeking in short files · 4174c26e
      Timothy B. Terriberry authored
      When a file is very, very short (i.e., only one packet) and uses
       end-trimming, the apparent granule position preceding the first
       sample in the first packet can underflow.
      We were computing this value by subtracting the packet duration
       from the computed per-packet granule position and expecting this
       computation to always succeed.
      Because it could fail in the presence of end-trimming on the first
       packet (ironically, exactly the situation where the short-circuit
       is helpful), it would leave the value uninitialized, and then use
       it in a comparison, which is undefined behavior.
      The correct solution is to check for failure and force the previous
       page's granule position to 0 in this case.
      4174c26e