Skip to content
Snippets Groups Projects
  1. Aug 11, 2011
  2. Aug 02, 2011
  3. Jul 31, 2011
  4. Jul 29, 2011
  5. 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
  6. Feb 14, 2011
  7. Feb 10, 2011
  8. Feb 04, 2011
    • Gregory Maxwell's avatar
      This removes some pointless/dead code. · b8a6b312
      Gregory Maxwell authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      b8a6b312
    • 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
  9. Feb 03, 2011
    • Jean-Marc Valin's avatar
      ea93c01a
    • Timothy B. Terriberry's avatar
      Fix collapse mask tracking for recombine steps. · 57854e81
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      The recombine loop for cm was correct if one started at 1 block,
       but was wrong otherwise (for a test case, convert 2 recombined
       blocks back to 4 with an initial cm of 0x3; the result should be
       0xF, but instead you get 0x7).
      The recombine loop for fill was always wrong (for a test case,
       combine 8 blocks down to 1 with an initial fill=0xFE; the low bit
       remains unset).
      This now properly interleaves and deinterleaves bits for these
       steps, which avoids declaring collapses (and skipping folding)
       where none, in fact, occurred.
      57854e81
  10. Feb 01, 2011
    • Jean-Marc Valin's avatar
      Tuning the split threshold · 263e2719
      Jean-Marc Valin authored
      263e2719
    • 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
    • Timothy B. Terriberry's avatar
      Adjust the splitting threshold. · 4499263b
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      Previously, we would only split a band if it was allocated more than
       32 bits.
      However, the N=4 codebook can only produce about 22.5 bits, and two
       N=2 bands combined can only produce 26 bits, including 8 bits for
       qtheta, so if we wait until we allocate 32, we're guaranteed to fall
       short.
      Several of the larger bands come pretty far from filling 32 bits as
       well, though their split versions will.
      
      Greg Maxwell also suggested adding an offset to the threshold to
       account for the inefficiency of using qtheta compared to another
       VQ dimension.
      This patch uses 1 bit as a placeholder, as it's a clear
       improvement, but we may adjust this later after collecting data on
       more possibilities over more files.
      4499263b
  11. 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
    • Jean-Marc Valin's avatar
  12. Jan 29, 2011
    • Timothy B. Terriberry's avatar
      Change qb cap to prevent side-fold collapses. · 9b34bd83
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      Previously, in a stereo split with itheta==16384, but without
       enough bits left over to actually code a pulse, the target band
       would completely collapse, because the mid gain would be zero and
       we don't fold the side.
      This changes the limit to ensure that we never set qn>1 unless we
       know we'll have enough bits for at least one pulse.
      This should eliminate the last possible whole-band collapse.
      9b34bd83
  13. Jan 28, 2011
  14. Jan 27, 2011
    • Jean-Marc Valin's avatar
      Making rebalance a celt_int32 · a9285720
      Jean-Marc Valin authored
      a9285720
    • Jean-Marc Valin's avatar
      Reducing waste at high bit-rate · 8ca16121
      Jean-Marc Valin authored
      We now encode the highest bitrate part of the split first and transfer
      any unused bits to the other part. We use a dead zone of three bits
      to prevent redistributing in cases of random fluctuation (or else
      we will statistically lower the allocation of higher frequencies at
      low-mid bitrates).
      8ca16121
    • Jean-Marc Valin's avatar
      Fixes fixed-point overflow on really low energy · 79afa9c6
      Jean-Marc Valin authored
      Makes celt_exp2() use Q10 input to avoid problems on very low energy.
      Also makes the pitch downsampling more conservative on gain to avoid
      problems later.
      79afa9c6
    • Jean-Marc Valin's avatar
      02ad779f
    • Timothy B. Terriberry's avatar
      Improve accuracy of update_lowband test. · 045e47ce
      Timothy B. Terriberry authored and Jean-Marc Valin's avatar Jean-Marc Valin committed
      045e47ce
    • 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
  15. Jan 26, 2011
    • Jean-Marc Valin's avatar
      anti-collapse tuning · 9ce95e0b
      Jean-Marc Valin authored
      Using the min energy of the two last non-transient frames rather
      than the min of just the two last frames. Also slightly increasing
      the "thresh" upper bound coefficient to 0.5.
      9ce95e0b
  16. Jan 25, 2011
  17. Jan 24, 2011
  18. Jan 23, 2011
  19. Jan 21, 2011
  20. Jan 20, 2011
Loading