Skip to content
Snippets Groups Projects
  1. Aug 02, 2011
  2. Jul 31, 2011
  3. Jul 29, 2011
  4. Mar 03, 2011
    • Timothy B. Terriberry's avatar
      Eliminate the ec_int32 and ec_uint32 typedefs. · 9bac8c17
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      These were used because the entropy coder originally came from
       outside libcelt, and thus did not have a common type system.
      It's now undergone enough modification that it's not ever likely to
       be used as-is in another codec without some porting effort, so
       there's no real reason to maintain the typedefs separately.
      Hopefully we'll replace these all again somedate with a common set
       of Opus typedefs, but for now this will do.
      
      This fixes an issue caused by commit 6c8acbf1, which moved the
       ec_ilog() prototype from entcode.h to ecintrin.h, where the
       ec_uint32 typedef was not yet available.
      Thanks to John Ridges for the report.
      9bac8c17
  5. Feb 10, 2011
  6. 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
  7. Jan 31, 2011
    • Timothy B. Terriberry's avatar
      Don't destroy stereo history when switching to mono. · 682b6cf1
      Timothy B. Terriberry authored
      The first version of the mono decoder with stereo output collapsed
       the historic energy values stored for anti-collapse down to one
       channel (by taking the max).
      This means that a subsequent switch back would continue on using
       the the maximum of the two values instead of the original history,
       which would make anti-collapse produce louder noise (and
       potentially more pre-echo than otherwise).
      
      This patch moves the max into the anti_collapse function itself,
       and does not store the values back into the source array, so the
       full stereo history is maintained if subsequent frames switch
       back.
      It also fixes an encoder mismatch, which never took the max
       (assuming, apparently, that the output channel count would never
       change).
      682b6cf1
    • Timothy B. Terriberry's avatar
      Propagate balance from compute_allocation() to quant_all_bands(). · 948d27c9
      Timothy B. Terriberry authored
      Instead of just dumping excess bits into the first band after
       allocation, use them to initialize the rebalancing loop in
       quant_all_bands().
      This allows these bits to be redistributed over several bands, like
       normal.
      948d27c9
  8. Jan 27, 2011
    • Timothy B. Terriberry's avatar
      More anti-collapse fixes, as well as a fold fix. · a396e153
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      This changes folding so that the LCG is never used on transients
       (either short blocks or long blocks with increased time
       resolution), except in the case that there's not enough decoded
       spectrum to fold yet.
      
      It also now only subtracts the anti-collapse bit from the total
       allocation in quant_all_bands() when space has actually been
       reserved for it.
      
      Finally, it cleans up some of the fill and collapse_mask tracking
       (this tracking was originally made intentionally sloppy to save
       work, but then converted to replace the existing fill flag at the
       last minute, which can have a number of logical implications).
      The changes, in particular:
      1) Splits of less than a block now correctly mark the second half
          as filled only if the whole block was filled (previously it
          would also mark it filled if the next block was filled).
      2) Splits of less than a block now correctly mark a block as
          un-collapsed if either half was un-collapsed, instead of marking
          the next block as un-collapsed when the high half was.
      3) The N=2 stereo special case now keeps its fill mask even when
          itheta==16384; previously this would have gotten cleared,
          despite the fact that we fold into the side in this case.
      4) The test against fill for folding now only considers the bits
          corresponding to the current set of blocks.
         Previously it would still fold if any later block was filled.
      5) The collapse mask used for the LCG fold data is now correctly
          initialized when B=16 on platforms with a 16-bit int.
      6) The high bits on a collapse mask are now cleared after the TF
          resolution changes and interleaving at level 0, instead of
          waiting until the very end.
         This prevents extraneous high flags set on mid from being mixed
          into the side flags for mid-side stereo.
      a396e153
  9. Jan 23, 2011
  10. Jan 21, 2011
  11. Jan 20, 2011
    • Timothy B. Terriberry's avatar
      Make collapse-detection bitexact. · 21af73eb
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      Jean-Marc's original anti-collapse patch used a threshold on the
       content of a decoded band to determine whether or not it should
       be filled with random noise.
      Since this is highly sensitive to the accuracy of the
       implementation, it could lead to significant decoder output
       differences even if decoding error up to that point was relatively
       small.
      
      This patch detects collapsed bands from the output of the vector
       quantizer, using exact integer arithmetic.
      It makes two simplifying assumptions:
       a) If either input to haar1() is non-zero during TF resolution
           adjustments, then the output will be non-zero.
       b) If the content of a block is non-zero in any of the bands that
           are used for folding, then the folded output will be non-zero.
      b) in particular is likely to be false when SPREAD_NONE is used.
      It also ignores the case where mid and side are orthogonal in
       stereo_merge, but this is relatively unlikely.
      This misses just over 3% of the cases that Jean-Marc's anti-collapse
       detection strategy would catch, but does not mis-classify any (all
       detected collapses are true collapses).
      
      This patch overloads the "fill" parameter to mark which blocks have
       non-zero content for folding.
      As a consequence, if a set of blocks on one side of a split has
       collapsed, _no_ folding is done: the result would be zero anyway,
       except for short blocks with SPREAD_AGGRESSIVE that are split down
       to a single block, but a) that means a lot of bits were available
       so a collapse is unlikely and b) anti-collapse can fill the block
       anyway, if it's used.
      This also means that if itheta==0 or itheta==16384, we no longer
       fold at all on that side (even with long blocks), since we'd be
       multiplying the result by zero anyway.
      21af73eb
  12. Jan 18, 2011
    • Jean-Marc Valin's avatar
      Adds an anti-collapse mechanism for transients · 87efe1df
      Jean-Marc Valin authored
      This looks for bands in each short block that have no energy. For
      each of these "collapsed" bands, noise is injected to have an
      energy equal to the minimum of the two previous frames for that band.
      The mechanism can be used whenever there are 4 or more MDCTs (otherwise
      no complete collapse is possible) and is signalled with one bit just
      before the final fine energy bits.
      87efe1df
  13. Jan 17, 2011
  14. Dec 17, 2010
    • Timothy B. Terriberry's avatar
      Re-organize spreading/folding constants. · 320cf2e2
      Timothy B. Terriberry authored
      These were stored internally in one order and in the bitstream in a
       different order.
      Both used bare constants, making it unclear what either actually
       meant.
      This changes them to use the same order, gives them named constants,
       and renames all the "fold" decision stuff to "spread" instead,
       since that is what it is really controlling.
      320cf2e2
  15. Dec 02, 2010
  16. Nov 26, 2010
  17. Oct 18, 2010
  18. Oct 13, 2010
  19. Sep 28, 2010
  20. Aug 31, 2010
  21. Aug 05, 2010
  22. Jul 29, 2010
  23. Jul 16, 2010
  24. Jul 13, 2010
  25. Jun 27, 2010
  26. May 28, 2010
  27. May 15, 2010
  28. May 11, 2010
  29. May 08, 2010
  30. Apr 26, 2010
  31. Apr 19, 2010
  32. Feb 26, 2010
  33. Oct 18, 2009
  34. Oct 17, 2009
  35. Oct 15, 2009
  36. Oct 09, 2009
  37. Oct 01, 2009
Loading