opus.git
8 years agoSTATIC_MODES no longer used
Jean-Marc Valin [Fri, 4 Feb 2011 05:09:05 +0000 (00:09 -0500)]
STATIC_MODES no longer used

8 years agoConfigure option for custom modes
Jean-Marc Valin [Fri, 4 Feb 2011 05:04:26 +0000 (00:04 -0500)]
Configure option for custom modes

8 years ago1275 byte packets is the absolute maximum packet size we're going to support. This...
Gregory Maxwell [Fri, 4 Feb 2011 04:26:38 +0000 (23:26 -0500)]
1275 byte packets is the absolute maximum packet size we're going to support. This makes the encoder and decoder refuse to operate outside of these boundaries.

8 years agoSkipping most of the PLC code for DTX
Jean-Marc Valin [Fri, 4 Feb 2011 04:54:37 +0000 (23:54 -0500)]
Skipping most of the PLC code for DTX

Also cap the encoder bit-rate to 260 kb/s per channel.

8 years agoVersion number bump
Jean-Marc Valin [Fri, 4 Feb 2011 04:27:09 +0000 (23:27 -0500)]
Version number bump

8 years agoThis removes some pointless/dead code.
Gregory Maxwell [Fri, 4 Feb 2011 03:56:01 +0000 (22:56 -0500)]
This removes some pointless/dead code.

8 years agoFixes an int overflow in the VBR code
Jean-Marc Valin [Fri, 4 Feb 2011 04:21:00 +0000 (23:21 -0500)]
Fixes an int overflow in the VBR code

Also properly applies the MDCT filtering for resampling

8 years agoCheck for mode creation failure before we try to use it.
Timothy B. Terriberry [Thu, 3 Feb 2011 23:32:06 +0000 (15:32 -0800)]
Check for mode creation failure before we try to use it.

Not after.

8 years agoThis fixes the frame_size check on the encoder and decoder and removes some unused...
Gregory Maxwell [Fri, 4 Feb 2011 02:06:43 +0000 (21:06 -0500)]
This fixes the frame_size check on the encoder and decoder and removes some unused variable warnings when compiling without custom modes.

8 years agoOops, fixed the CELT version
Jean-Marc Valin [Fri, 4 Feb 2011 03:35:52 +0000 (22:35 -0500)]
Oops, fixed the CELT version

8 years agoUpdate Opus range coder due to CELT refactoring.
Timothy B. Terriberry [Thu, 3 Feb 2011 22:52:50 +0000 (14:52 -0800)]
Update Opus range coder due to CELT refactoring.

The byte buffer is now part of the range coder struct itself, and
 rangeenc.c and rangedec.c have gone away.

8 years agoRefactor the entropy coder.
Timothy B. Terriberry [Thu, 3 Feb 2011 22:22:15 +0000 (14:22 -0800)]
Refactor the entropy coder.

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.

8 years agoUpdate SILK range coder due to CELT refactoring.
Timothy B. Terriberry [Thu, 3 Feb 2011 22:51:37 +0000 (14:51 -0800)]
Update SILK range coder due to CELT refactoring.

The byte buffer is now part of the range coder struct itself, and
 ec_{enc|dec}_tell have been replaced by a unified ec_tell() with
 no precision parameter.

8 years agoCELT update, version numbers
Jean-Marc Valin [Thu, 3 Feb 2011 20:59:20 +0000 (15:59 -0500)]
CELT update, version numbers

8 years agoIncreasing the pitch gain resolution
Jean-Marc Valin [Thu, 3 Feb 2011 20:47:10 +0000 (15:47 -0500)]
Increasing the pitch gain resolution

8 years agoAlign the sample buffer for short
Ron [Thu, 3 Feb 2011 19:14:15 +0000 (05:44 +1030)]
Align the sample buffer for short

8 years agoMakefile deps fix
Jean-Marc Valin [Thu, 3 Feb 2011 19:03:10 +0000 (14:03 -0500)]
Makefile deps fix

8 years agoUpdate draft instructions for source extraction
Jean-Marc Valin [Thu, 3 Feb 2011 18:59:57 +0000 (13:59 -0500)]
Update draft instructions for source extraction

8 years agoFixes "make clean"
Jean-Marc Valin [Thu, 3 Feb 2011 18:46:32 +0000 (13:46 -0500)]
Fixes "make clean"

8 years agoBuild fixes
Jean-Marc Valin [Thu, 3 Feb 2011 18:40:30 +0000 (13:40 -0500)]
Build fixes

8 years agoBuild fixes
Jean-Marc Valin [Thu, 3 Feb 2011 18:39:38 +0000 (13:39 -0500)]
Build fixes

8 years agoDisabling the postfilter when complexity<5 or when CELT_SET_PREDICTION<=1
Jean-Marc Valin [Thu, 3 Feb 2011 18:36:03 +0000 (13:36 -0500)]
Disabling the postfilter when complexity<5 or when CELT_SET_PREDICTION<=1

8 years agoSetting CELT complexity
Jean-Marc Valin [Thu, 3 Feb 2011 18:20:10 +0000 (13:20 -0500)]
Setting CELT complexity

8 years agofile list update
Jean-Marc Valin [Thu, 3 Feb 2011 17:34:02 +0000 (12:34 -0500)]
file list update

8 years agoHeader list
Jean-Marc Valin [Thu, 3 Feb 2011 17:31:20 +0000 (12:31 -0500)]
Header list

8 years agoAutomated draft compilation
Jean-Marc Valin [Thu, 3 Feb 2011 17:30:32 +0000 (12:30 -0500)]
Automated draft compilation

8 years agomake clean
Jean-Marc Valin [Thu, 3 Feb 2011 17:14:14 +0000 (12:14 -0500)]
make clean

8 years agoOops, had inverted some tuning lines
Jean-Marc Valin [Thu, 3 Feb 2011 17:08:38 +0000 (12:08 -0500)]
Oops, had inverted some tuning lines

8 years agoHybrid tuning
Jean-Marc Valin [Thu, 3 Feb 2011 16:47:10 +0000 (11:47 -0500)]
Hybrid tuning

8 years agoSome more hybrid tuning (mostly for CBR)
Jean-Marc Valin [Thu, 3 Feb 2011 16:34:43 +0000 (11:34 -0500)]
Some more hybrid tuning (mostly for CBR)

8 years agoA simpler build system for the draft
Jean-Marc Valin [Thu, 3 Feb 2011 16:34:11 +0000 (11:34 -0500)]
A simpler build system for the draft

8 years agoReplaces previous commit with something safer
Jean-Marc Valin [Thu, 3 Feb 2011 15:34:30 +0000 (10:34 -0500)]
Replaces previous commit with something safer

8 years agoHybrid mode tuning
Karsten Vandborg Sorensen [Thu, 3 Feb 2011 14:36:59 +0000 (09:36 -0500)]
Hybrid mode tuning

8 years agoTesting the range coder final state
Koen Vos [Thu, 3 Feb 2011 14:31:12 +0000 (09:31 -0500)]
Testing the range coder final state

8 years agoPatch from Tim: Prevents bits2 from going negative
Jean-Marc Valin [Thu, 3 Feb 2011 14:16:13 +0000 (09:16 -0500)]
Patch from Tim: Prevents bits2 from going negative

8 years agoMinor bugfix
Koen Vos [Thu, 3 Feb 2011 14:08:25 +0000 (09:08 -0500)]
Minor bugfix

8 years agoSILK update
Koen Vos [Thu, 3 Feb 2011 14:07:32 +0000 (09:07 -0500)]
SILK update

8 years agoCELT update
Jean-Marc Valin [Thu, 3 Feb 2011 12:07:32 +0000 (07:07 -0500)]
CELT update

8 years agoRevert -export-symbols-regex 'celt_'. That probably wasn't a good idea
Jean-Marc Valin [Thu, 3 Feb 2011 12:05:30 +0000 (07:05 -0500)]
Revert -export-symbols-regex 'celt_'. That probably wasn't a good idea

And it somehow prevents Opus from building shared libraries

8 years agoRenormalize in anti-collapse only when needed
Jean-Marc Valin [Thu, 3 Feb 2011 11:42:54 +0000 (06:42 -0500)]
Renormalize in anti-collapse only when needed

8 years agoFix collapse mask tracking for recombine steps.
Timothy B. Terriberry [Thu, 3 Feb 2011 09:57:57 +0000 (01:57 -0800)]
Fix collapse mask tracking for recombine steps.

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.

8 years agoFix short length detection.
Timothy B. Terriberry [Wed, 2 Feb 2011 19:42:33 +0000 (11:42 -0800)]
Fix short length detection.

aa6fec66 added a check to reject modes with shorts longer than
 3.33 ms (less than 300 per second).
However, it only rejected modes which could not be split at all.
This expands the check to also reject modes which, even after
 splitting the maximum amount, still do not have shorts less than
 3.33 ms.

8 years agoSome work on the build
Jean-Marc Valin [Thu, 3 Feb 2011 05:44:15 +0000 (00:44 -0500)]
Some work on the build

8 years agoMore Opus build work
Jean-Marc Valin [Thu, 3 Feb 2011 05:43:37 +0000 (00:43 -0500)]
More Opus build work

8 years agoEnabling the CELT post-filter in Opus
Jean-Marc Valin [Thu, 3 Feb 2011 04:47:52 +0000 (23:47 -0500)]
Enabling the CELT post-filter in Opus

8 years agoEnabling the post-filter and exporting the ec functions for Opus
Jean-Marc Valin [Thu, 3 Feb 2011 04:02:25 +0000 (23:02 -0500)]
Enabling the post-filter and exporting the ec functions for Opus

8 years agoAlso fixing the DoFs for intensity stereo
Jean-Marc Valin [Thu, 3 Feb 2011 02:23:21 +0000 (21:23 -0500)]
Also fixing the DoFs for intensity stereo

8 years agoGetting the right DoFs for dual stereo
Jean-Marc Valin [Thu, 3 Feb 2011 02:03:31 +0000 (21:03 -0500)]
Getting the right DoFs for dual stereo

8 years agoSILK update
Jean-Marc Valin [Thu, 3 Feb 2011 00:25:19 +0000 (19:25 -0500)]
SILK update

8 years agoDebug fixes
Jean-Marc Valin [Thu, 3 Feb 2011 00:24:23 +0000 (19:24 -0500)]
Debug fixes

8 years agoAUTHORS
Jean-Marc Valin [Thu, 3 Feb 2011 00:15:03 +0000 (19:15 -0500)]
AUTHORS

8 years agoSILK update
Jean-Marc Valin [Thu, 3 Feb 2011 00:13:04 +0000 (19:13 -0500)]
SILK update

8 years agoFixing some more valgrind issues
Jean-Marc Valin [Wed, 2 Feb 2011 23:41:23 +0000 (18:41 -0500)]
Fixing some more valgrind issues

8 years agoSILK update (fixing segfault) and MSVS fix
Jean-Marc Valin [Wed, 2 Feb 2011 23:17:34 +0000 (18:17 -0500)]
SILK update (fixing segfault) and MSVS fix

8 years agoFixes uninitialised memory issues
Jean-Marc Valin [Wed, 2 Feb 2011 23:16:06 +0000 (18:16 -0500)]
Fixes uninitialised memory issues

8 years agoMerges the decoder part of the SILK draft
Jean-Marc Valin [Wed, 2 Feb 2011 21:52:03 +0000 (16:52 -0500)]
Merges the decoder part of the SILK draft

8 years agoMerges the encoder part of the SILK draft.
Jean-Marc Valin [Wed, 2 Feb 2011 21:47:34 +0000 (16:47 -0500)]
Merges the encoder part of the SILK draft.

8 years agoBetter handling of test_opus bandwidth options
Jean-Marc Valin [Wed, 2 Feb 2011 21:23:43 +0000 (16:23 -0500)]
Better handling of test_opus bandwidth options

8 years agoCELT update
Jean-Marc Valin [Wed, 2 Feb 2011 15:05:06 +0000 (10:05 -0500)]
CELT update

8 years agoSILK update
Jean-Marc Valin [Wed, 2 Feb 2011 15:04:05 +0000 (10:04 -0500)]
SILK update

8 years agoSILK update
Koen Vos [Wed, 2 Feb 2011 15:01:59 +0000 (10:01 -0500)]
SILK update

8 years agoPLC fix
Jean-Marc Valin [Wed, 2 Feb 2011 14:39:30 +0000 (09:39 -0500)]
PLC fix

8 years agoRemoving ancient allocation matrix
Jean-Marc Valin [Wed, 2 Feb 2011 03:03:26 +0000 (22:03 -0500)]
Removing ancient allocation matrix

8 years agoIncrease caps/allocation accuracy.
Timothy B. Terriberry [Wed, 2 Feb 2011 01:41:12 +0000 (17:41 -0800)]
Increase caps/allocation accuracy.

This stores the caps array in 32nd bits/sample instead of 1/2 bits
 scaled by LM and the channel count, which is slightly less
 less accurate for the last two bands, and much more accurate for
 all the other bands.
A constant offset is subtracted to allow it to represent values
 larger than 255 in 8 bits (the range of unoffset values is
 77...304).
In addition, this replaces the last modeline in the allocation table
 with the caps array, allowing the initial interpolation to
 allocate 8 bits/sample or more, which was otherwise impossible.

8 years agoOnly checking for a mismatch when RESYNTH is defined
Jean-Marc Valin [Wed, 2 Feb 2011 01:33:17 +0000 (20:33 -0500)]
Only checking for a mismatch when RESYNTH is defined

8 years agoLimit mode creation to supported modes.
Timothy B. Terriberry [Tue, 1 Feb 2011 23:36:59 +0000 (15:36 -0800)]
Limit mode creation to supported modes.

We did no real error checking to see if a mode is supported when it
 is created.
This patch implements checks for Jean-Marc's rules:
1) A mode must have frames at least 1ms in length (no more than
    1000 per second).
2) A mode must have shorts of at most 3.33 ms (at least 300 per
    second).
It also adds error checking to dump_modes so we report the error
 instead of crashing when we fail to create a mode.

8 years agoEnabling real CELT VBR
Jean-Marc Valin [Tue, 1 Feb 2011 23:08:41 +0000 (18:08 -0500)]
Enabling real CELT VBR

8 years agoFixing the global stack -- and an overflow in collapse_mask
Jean-Marc Valin [Tue, 1 Feb 2011 23:00:29 +0000 (18:00 -0500)]
Fixing the global stack -- and an overflow in collapse_mask

8 years agoAdd assertions for band size restrictions.
Timothy B. Terriberry [Tue, 1 Feb 2011 20:53:05 +0000 (12:53 -0800)]
Add assertions for band size restrictions.

The way folding is implemented requires two restrictions:
1. The last band must be the largest (so we can use its size to
 allocate a temporary buffer to handle interleaving/TF changes).
2. No band can be larger than twice the size of the previous band
 (so that once we have enough data to start folding, we will always
 have enough data to fold).

Mode creation makes a heuristic attempt to satisfy these
 conditions, but nothing actually guarantees it.
This adds some asserts to check them during mode creation.
They current pass for all supported custom modes.

8 years agoDon't allow empty eBands.
Timothy B. Terriberry [Tue, 1 Feb 2011 20:32:34 +0000 (12:32 -0800)]
Don't allow empty eBands.

Currently compute_ebands()'s attempts to round bands to even sizes
 and enforce size constraints on consecutive bands can leave some
 bands entirely empty (e.g., Fs=8000, frame_size=64, i=11).
This adds a simple post-processing loop to remove such bands.

8 years agoAdds a generic CELT_SET_BITRATE() ctl() API for CBR and VBR
Jean-Marc Valin [Tue, 1 Feb 2011 22:04:27 +0000 (17:04 -0500)]
Adds a generic CELT_SET_BITRATE() ctl() API for CBR and VBR

8 years agoCELT update
Jean-Marc Valin [Tue, 1 Feb 2011 19:01:51 +0000 (14:01 -0500)]
CELT update

8 years agoTuning the split threshold
Jean-Marc Valin [Tue, 1 Feb 2011 16:20:09 +0000 (11:20 -0500)]
Tuning the split threshold

8 years agoBetter options for test_opus
Koen Vos [Tue, 1 Feb 2011 15:44:48 +0000 (10:44 -0500)]
Better options for test_opus

8 years agoMerged Koen's encoder changes
Jean-Marc Valin [Tue, 1 Feb 2011 15:35:23 +0000 (10:35 -0500)]
Merged Koen's encoder changes

8 years agoAdd a seprate qtheta offset for two-phase stereo.
Timothy B. Terriberry [Tue, 1 Feb 2011 09:55:01 +0000 (01:55 -0800)]
Add a seprate qtheta offset for two-phase stereo.

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.

8 years agoAdjust the splitting threshold.
Timothy B. Terriberry [Mon, 31 Jan 2011 18:44:03 +0000 (10:44 -0800)]
Adjust the splitting threshold.

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.

8 years agoKoen's decoder updates
Jean-Marc Valin [Mon, 31 Jan 2011 23:25:47 +0000 (18:25 -0500)]
Koen's decoder updates

8 years agoCELT update
Jean-Marc Valin [Mon, 31 Jan 2011 22:35:41 +0000 (17:35 -0500)]
CELT update

8 years agoIncluding static_mode* files in the distribution
Jean-Marc Valin [Mon, 31 Jan 2011 22:34:46 +0000 (17:34 -0500)]
Including static_mode* files in the distribution

8 years agoStop collapsing the background noise channels when switching to mono
Jean-Marc Valin [Mon, 31 Jan 2011 22:30:15 +0000 (17:30 -0500)]
Stop collapsing the background noise channels when switching to mono

8 years agoDon't destroy stereo history when switching to mono.
Timothy B. Terriberry [Mon, 31 Jan 2011 21:34:54 +0000 (13:34 -0800)]
Don't destroy stereo history when switching to mono.

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).

8 years agoDisabling debug
Jean-Marc Valin [Mon, 31 Jan 2011 22:17:14 +0000 (17:17 -0500)]
Disabling debug

8 years agoDisabling debug
Jean-Marc Valin [Mon, 31 Jan 2011 22:17:03 +0000 (17:17 -0500)]
Disabling debug

8 years agoBig SILK update
Koen Vos [Mon, 31 Jan 2011 21:38:33 +0000 (16:38 -0500)]
Big SILK update

8 years agoHandling auto-detecting of frame size in decoder
Jean-Marc Valin [Mon, 31 Jan 2011 20:56:38 +0000 (15:56 -0500)]
Handling auto-detecting of frame size in decoder

8 years agoPropagate balance from compute_allocation() to quant_all_bands().
Timothy B. Terriberry [Mon, 31 Jan 2011 20:28:12 +0000 (12:28 -0800)]
Propagate balance from compute_allocation() to quant_all_bands().

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.

8 years agoInitial support for opus_enc/opus_dec
Jean-Marc Valin [Mon, 31 Jan 2011 20:24:42 +0000 (15:24 -0500)]
Initial support for opus_enc/opus_dec

8 years agoFixes resampling in CELT-only mode
Jean-Marc Valin [Mon, 31 Jan 2011 18:42:57 +0000 (13:42 -0500)]
Fixes resampling in CELT-only mode

8 years agoFix sample type conversion when resampling
Jean-Marc Valin [Mon, 31 Jan 2011 18:41:01 +0000 (13:41 -0500)]
Fix sample type conversion when resampling

8 years agoNo longer extracting the frame size from the mode to build the header
Jean-Marc Valin [Mon, 31 Jan 2011 18:27:21 +0000 (13:27 -0500)]
No longer extracting the frame size from the mode to build the header

8 years agoMakes delay_buffer[] large enough for stereo.
Jean-Marc Valin [Mon, 31 Jan 2011 17:56:22 +0000 (12:56 -0500)]
Makes delay_buffer[] large enough for stereo.

8 years agoGot stereo support to work in CELT-only mode
Jean-Marc Valin [Mon, 31 Jan 2011 17:41:49 +0000 (12:41 -0500)]
Got stereo support to work in CELT-only mode

8 years agoMore stereo work
Jean-Marc Valin [Mon, 31 Jan 2011 16:53:28 +0000 (11:53 -0500)]
More stereo work

8 years agoSome initial work on stereo support (not complete)
Jean-Marc Valin [Mon, 31 Jan 2011 16:34:57 +0000 (11:34 -0500)]
Some initial work on stereo support (not complete)

8 years agoMerge stereo switching CELT API
Jean-Marc Valin [Mon, 31 Jan 2011 16:27:10 +0000 (11:27 -0500)]
Merge stereo switching CELT API

8 years agoMaking the stereo encoder capable of encoding in mono
Jean-Marc Valin [Mon, 31 Jan 2011 16:19:03 +0000 (11:19 -0500)]
Making the stereo encoder capable of encoding in mono

8 years agoMaking it possible for the stereo decoder to decode a mono stream
Jean-Marc Valin [Mon, 31 Jan 2011 15:51:30 +0000 (10:51 -0500)]
Making it possible for the stereo decoder to decode a mono stream

8 years agoApply band caps to the band allocation table.
Timothy B. Terriberry [Mon, 31 Jan 2011 06:27:13 +0000 (22:27 -0800)]
Apply band caps to the band allocation table.

The average caps over all values of LM and C are well below the
 target allocations of the last two modelines.
Lower them to the caps, to prevent hitting them quite so early.
This helps quality at medium-high rates, in the 180-192 kbps range.

8 years agoMore band caps updates.
Timothy B. Terriberry [Mon, 31 Jan 2011 06:18:12 +0000 (22:18 -0800)]
More band caps updates.

Use measured cross-entropy to estimate the real cost of coding
 qtheta given the allocated qb parameter, instead of the entropy of
 the PDF.
This is generally much lower, and reduces waste at high rates.
This patch also removes some intermediate rounding from this
 computation.