Skip to content
Snippets Groups Projects
  1. Mar 01, 2019
  2. Oct 16, 2018
  3. Dec 31, 2015
  4. Oct 28, 2013
    • Gregory Maxwell's avatar
      Replace "inline" with OPUS_INLINE. · 7830cf1b
      Gregory Maxwell authored
      Newer versions of MSVC are unhappy with the strategy of the build
       environment redefining "inline" (even though they don't support the
       actual keyword). Instead we define OPUS_INLINE to the right thing
       in opus_defines.h.
      
      This is the same approach we use for restrict.
      7830cf1b
  5. Dec 21, 2012
  6. May 16, 2012
  7. Apr 24, 2012
  8. Apr 20, 2012
  9. Mar 08, 2012
  10. Dec 02, 2011
    • Ralph Giles's avatar
      Rename '_FOO' to avoid potentional collisions with reserved identifiers. · 120800f8
      Ralph Giles authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      C reserves identifiers of the from _[A-Z]+ and we have a number of
      those in the code. This patch renames the various function arguments,
      MACROS and preprocessor symbols to avoid the reserved form.
      
      It also removes the CHANNELS() macro altogether. This was a
      minor optimization for TI DSP to force a mono-only build,
      as were the associated local 'const' versions. Since stereo
      support is manditory, it wasn't worth keeping.
      
      Thanks to John Ridges for raising the issue, and Jean-Marc Valin
      and Greg Maxwell for reviewing the changes.
      120800f8
  11. Sep 14, 2011
  12. Sep 01, 2011
  13. Aug 02, 2011
  14. Jul 31, 2011
  15. Jul 29, 2011
  16. Feb 10, 2011
  17. Feb 06, 2011
    • Timothy B. Terriberry's avatar
      16-bit int fixes. · 285bc372
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      This fixes a number of issues for platforms with a 16-bit int, but
       by no means all of them.
      The type change for ec_window (for platforms where sizeof(size_t)==2)
       will break ABI (but not API) compatibility with libsilk and libopus,
       and reduce speed on x86-64, but allows the code to work in real-mode
       DOS without using the huge memory model, which is useful for testing
       16-bit int compliance.
      285bc372
  18. Feb 04, 2011
    • Timothy B. Terriberry's avatar
      Refactor the entropy coder. · a093f4df
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      This unifies the byte buffer, encoder, and decoder into a single
       struct.
      The common encoder and decoder functions (such as ec_tell()) can
       operate on either one, simplifying code which uses both.
      The precision argument to ec_tell() has been removed.
      It now comes in two precisions:
        ec_tell() gives 1 bit precision in two operations, and
        ec_tell_frac() gives 1/8th bit precision in... somewhat more.
      ec_{enc|dec}_bit_prob() were removed (they are no longer needed).
      Some of the byte buffer access functions were made static and
       removed from the cross-module API.
      All of the code in rangeenc.c and rangedec.c was merged into
       entenc.c and entdec.c, respectively, as we are no longer
       considering alternative backends.
      rangeenc.c and rangede.c have been removed entirely.
      
      This passes make check, after disabling the modes that we removed
       support for in cf5d3a8c.
      a093f4df
  19. Feb 01, 2011
    • Timothy B. Terriberry's avatar
      Add a seprate qtheta offset for two-phase stereo. · 411a84fa
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      9b34bd83 caused serious regressions for 240-sample frame stereo,
       because the previous qb limit was _always_ hit for two-phase
       stereo.
      Two-phase stereo really does operate with a different model (for
       example, the single bit allocated to the side should really
       probably be thought of as a sign bit for qtheta, but we don't
       count it as part of qtheta's allocation).
      The old code was equivalent to a separate two-phase offset of 12,
       however Greg Maxwell's testing demonstrates that 16 performs
       best.
      411a84fa
  20. Jan 31, 2011
  21. Jan 30, 2011
    • Timothy B. Terriberry's avatar
      Use a smarter per-band bitrate cap. · c5643074
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      The previous "dumb cap" of (64<<LM)*(C<<BITRES) was not actually
       achievable by many (most) bands, and did not take the cost of
       coding theta for splits into account, and so was too small for some
       bands.
      This patch adds code to compute a fairly accurate estimate of the
       real maximum per-band rate (an estimate only because of rounding
       effects and the fact that the bit usage for theta is variable),
       which is then truncated and stored in an 8-bit table in the mode.
      
      This gives improved quality at all rates over 160 kbps/channel,
       prevents bits from being wasted all the way up to 255 kbps/channel
       (the maximum rate allowed, and approximately the maximum number of
       bits that can usefully be used regardless of the allocation), and
       prevents dynalloc and trim from producing enormous waste
       (eliminating the need for encoder logic to prevent this).
      c5643074
  22. Jan 10, 2011
  23. Jan 09, 2011
    • Timothy B. Terriberry's avatar
      Prevent busts at low bitrates. · 76469c64
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      This patch makes all symbols conditional on whether or not there's
       enough space left in the buffer to code them, and eliminates much
       of the redundancy in the side information.
      
      A summary of the major changes:
      * The isTransient flag is moved up to before the the coarse energy.
        If there are not enough bits to code the coarse energy, the flag
         would get forced to 0, meaning what energy values were coded
         would get interpreted incorrectly.
        This might not be the end of the world, and I'd be willing to
         move it back given a compelling argument.
      * Coarse energy switches coding schemes when there are less than 15
         bits left in the packet:
        - With at least 2 bits remaining, the change in energy is forced
           to the range [-1...1] and coded with 1 bit (for 0) or 2 bits
           (for +/-1).
        - With only 1 bit remaining, the change in energy is forced to
           the range [-1...0] and coded with one bit.
        - If there is less than 1 bit remaining, the change in energy is
           forced to -1.
          This effectively low-passes bands whose energy is consistently
           starved; this might be undesirable, but letting the default be
           zero is unstable, which is worse.
      * The tf_select flag gets moved back after the per-band tf_res
         flags again, and is now skipped entirely when none of the
         tf_res flags are set, and the default value is the same for
         either alternative.
      * dynalloc boosting is now limited so that it stops once it's given
         a band all the remaining bits in the frame, or when it hits the
         "stupid cap" of (64<<LM)*(C<<BITRES) used during allocation.
      * If dynalloc boosing has allocated all the remaining bits in the
         frame, the alloc trim parameter does not get encoded (it would
         have no effect).
      * The intensity stereo offset is now limited to the range
         [start...codedBands], and thus doesn't get coded until after
         all of the skip decisions.
        Some space is reserved for it up front, and gradually given back
         as each band is skipped.
      * The dual stereo flag is coded only if intensity>start, since
         otherwise it has no effect.
        It is now coded after the intensity flag.
      * The space reserved for the final skip flag, the intensity stereo
         offset, and the dual stereo flag is now redistributed to all
         bands equally if it is unused.
        Before, the skip flag's bit was given to the band that stopped
         skipping without it (usually a dynalloc boosted band).
      
      In order to enable simple interaction between VBR and these
       packet-size enforced limits, many of which are encountered before
       VBR is run, the maximum packet size VBR will allow is computed at
       the beginning of the encoding function, and the buffer reduced to
       that size immediately.
      Later, when it is time to make the VBR decision, the minimum packet
       size is set high enough to ensure that no decision made thus far
       will have been affected by the packet size.
      As long as this is smaller than the up-front maximum, all of the
       encoder's decisions will remain in-sync with the decoder.
      If it is larger than the up-front maximum, the packet size is kept
       at that maximum, also ensuring sync.
      The minimum used now is slightly larger than it used to be, because
       it also includes the bits added for dynalloc boosting.
      Such boosting is shut off by the encoder at low rates, and so
       should not cause any serious issues at the rates where we would
       actually run out of room before compute_allocation().
      76469c64
  24. Jan 08, 2011
    • Timothy B. Terriberry's avatar
      Fix rounding in bits2pulses search. · 1cb32aa0
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      The mid = (lo+hi)>>1 line in the binary search would allow hi to drop
       down to the same value as lo, meaning the rounding after the search
       would be choosing between the same two values.
      This patch changes it to (lo+hi+1)>>1.
      This will allow lo to increase up to the value hi, but only in the
       case that we can't possibly allocate enough pulses to meet the
       target number of bits (in which case the rounding doesn't matter).
      To pay for the extra add, this moves the +1 in the comparison to bits
       to the other side, which can then be taken outside the loop.
      The compiler can't normally do this because it might cause overflow
       which would change the results.
      
      This rarely mattered, but gives a 0.01 PEAQ improvement on 12-byte
       120 sample frames.
      It also makes the search process describable with a simple
       algorithm, rather than relying on this particular optimized
       implementation.
      I.e., the binary search loop can now be replaced with
        for(lo=0;lo+1<cache[0]&&cache[lo+1]<bits;lo++);
        hi=lo+1;
       and it will give equivalent results.
      This was not true before.
      1cb32aa0
  25. Dec 16, 2010
  26. Dec 15, 2010
  27. Dec 10, 2010
  28. Oct 18, 2010
  29. Sep 30, 2010
  30. Sep 28, 2010
  31. Aug 31, 2010
  32. Aug 25, 2010
  33. Aug 06, 2010
  34. Aug 05, 2010
  35. Jul 29, 2010
Loading