opus.git
6 years agoFixes stupid tf calibration bugs introduced/exposed in f77410d
Jean-Marc Valin [Thu, 13 Jun 2013 19:28:53 +0000 (15:28 -0400)]
Fixes stupid tf calibration bugs introduced/exposed in f77410d

6 years agoAdds a quick hack to replace the normal calls with the multistream version.
Jean-Marc Valin [Thu, 13 Jun 2013 19:06:42 +0000 (15:06 -0400)]
Adds a quick hack to replace the normal calls with the multistream version.

6 years agoMoves VBR calculations to a separate function.
Jean-Marc Valin [Mon, 10 Jun 2013 07:30:01 +0000 (03:30 -0400)]
Moves VBR calculations to a separate function.

Does not change the behaviour of the VBR code in most cases. The only
exception is that the VBR offset is now taken into accound in the base_rate,
which will have a (very minor) impact on CVBR at low rate.

6 years agoDrop the stdint size tests that we never use anywhere
Ron [Sat, 8 Jun 2013 15:27:02 +0000 (00:57 +0930)]
Drop the stdint size tests that we never use anywhere

These were probably cribbed from libogg, but we don't use them here,
opus_types.h instead has a list of hardcoded arch definitions.

6 years agoFixes fixed-point on x86 (no SSE).
Jean-Marc Valin [Fri, 7 Jun 2013 11:21:41 +0000 (07:21 -0400)]
Fixes fixed-point on x86 (no SSE).

6 years agoImproved SSE version of xcorr_kernel()
John Ridges [Fri, 7 Jun 2013 03:12:57 +0000 (23:12 -0400)]
Improved SSE version of xcorr_kernel()

The loop no longer reads past its buffer and is slightly faster.
Also fixes RESTORE_STACK in celt_iir().

6 years agoForgot to add assembly file
Jean-Marc Valin [Thu, 6 Jun 2013 16:45:17 +0000 (12:45 -0400)]
Forgot to add assembly file

6 years agoAdds SSE support (only xcorr_kernel() for now)
Jean-Marc Valin [Wed, 5 Jun 2013 22:53:48 +0000 (18:53 -0400)]
Adds SSE support (only xcorr_kernel() for now)

There's no CPU detection for it, it only gets enabled by __SSE__
which gcc (other compilers?) defines automatically when supported
by -march=, which means at least all x86-64. For ia32, the user needs to
enable it in the CFLAGS.

6 years agoAdd run-time CPU detection and support for ARM architecture
Aurélien Zanelli [Fri, 31 May 2013 13:07:00 +0000 (15:07 +0200)]
Add run-time CPU detection and support for ARM architecture

Run-time CPU detection (RTCD) is enabled by default if target platform support
it.
It can be disable at compile time with --disable-rtcd option.

Add RTCD support for ARM architecture.

Thanks to Timothy B. Terriberry for help and code review

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
6 years agoTest the compiler configuration, not the assembler
Ron [Tue, 4 Jun 2013 05:51:43 +0000 (15:21 +0930)]
Test the compiler configuration, not the assembler

With gcc-4.4 at least, the raw asm.s files will always successfully
compile even if the default -march for the compiler would not support
those instructions.  So switch to testing the inline asm versions,
where the compiler will barf if they aren't supported by the default
arch if no -march is explicitly given, or if they aren't supported by
the requested -march when it is.

6 years agoDisables all the surround mode forcing for mono/stereo
Jean-Marc Valin [Tue, 28 May 2013 00:47:47 +0000 (20:47 -0400)]
Disables all the surround mode forcing for mono/stereo

6 years agoCheck if opus_compare is executable in run_vectors.sh
Aurélien Zanelli [Mon, 27 May 2013 13:54:31 +0000 (15:54 +0200)]
Check if opus_compare is executable in run_vectors.sh

If opus_compare doesn't exist or isn't executable, tests failed normally
which could be misleading.
So test for existence and mode to avoid this ambiguity.

6 years agoC89 fix
Jean-Marc Valin [Mon, 27 May 2013 00:29:44 +0000 (20:29 -0400)]
C89 fix

6 years agoCreates xcorr_kernel() that gets used by pitch_xcorr, celt_fir and celt_iir.
Jean-Marc Valin [Mon, 27 May 2013 00:08:35 +0000 (20:08 -0400)]
Creates xcorr_kernel() that gets used by pitch_xcorr, celt_fir and celt_iir.

6 years agoSkip down-sampling in deemphasis() when not needed.
Jean-Marc Valin [Sun, 26 May 2013 22:50:13 +0000 (18:50 -0400)]
Skip down-sampling in deemphasis() when not needed.

6 years agoAdd an option to disable build of extra programs (demos and tests)
Aurélien Zanelli [Sun, 26 May 2013 20:08:02 +0000 (22:08 +0200)]
Add an option to disable build of extra programs (demos and tests)

6 years agooops (again)
Jean-Marc Valin [Sun, 26 May 2013 01:07:48 +0000 (21:07 -0400)]
oops (again)

6 years agooops
Jean-Marc Valin [Sun, 26 May 2013 00:32:45 +0000 (20:32 -0400)]
oops

6 years agoOptimizes remove_doubling() by avoiding redundant calculations of yy
Jean-Marc Valin [Sun, 26 May 2013 00:13:49 +0000 (20:13 -0400)]
Optimizes remove_doubling() by avoiding redundant calculations of yy

Using a sliding window to pre-compute all yy values.

6 years agoAdds missing RESTORE_STACK calls
Jean-Marc Valin [Sat, 25 May 2013 22:50:01 +0000 (18:50 -0400)]
Adds missing RESTORE_STACK calls

6 years agoSpeeds up celt_iir() by more than a factor of two.
Jean-Marc Valin [Sat, 25 May 2013 11:41:55 +0000 (07:41 -0400)]
Speeds up celt_iir() by more than a factor of two.

Again, this only impacts the PLC and we assume the order is a multiple of 4.

6 years agoSpeeds up celt_fir by more than a factor of two.
Jean-Marc Valin [Sat, 25 May 2013 08:25:54 +0000 (04:25 -0400)]
Speeds up celt_fir by more than a factor of two.

Only impacts the PLC. We now assume that the order is a multiple of 4.

6 years agoFixes two warnings in pitch_xcorr()
Jean-Marc Valin [Sat, 25 May 2013 06:51:56 +0000 (02:51 -0400)]
Fixes two warnings in pitch_xcorr()

Rename y0 and y1 because of the name clash with Bessel functions.
Initialize y_3 to zero because gcc is too dumb to realize it can't
be used uninitialized.

6 years agoOptimizes _celt_autocorr() by using pitch_xcorr()
Jean-Marc Valin [Sat, 25 May 2013 06:14:25 +0000 (02:14 -0400)]
Optimizes _celt_autocorr() by using pitch_xcorr()

Computes most of the auto-correlation by reusing pitch_xcorr(). We only
need lag*(lag-1)/2 MACs to complete the calculations.
To do this, pitch_xcorr() was modified so that it no longer truncates the
length to a multiple of 4. Also, the xcorr didn't need the floor at -1.
As a side benefit, this speeds up the PLC, which uses a higher order LPC
filter.

6 years agoMerges the 4th order FIR with the first order FIR in pitch_downsample()
Jean-Marc Valin [Fri, 24 May 2013 21:18:41 +0000 (17:18 -0400)]
Merges the 4th order FIR with the first order FIR in pitch_downsample()

Also creates a new hardcoded 5th order fir.

6 years agoTry to clarify that opus maps to flac/wav but wav doesn't map to opus.
Ralph Giles [Fri, 24 May 2013 17:43:06 +0000 (01:43 +0800)]
Try to clarify that opus maps to flac/wav but wav doesn't map to opus.

6 years agoReference before period.
Ralph Giles [Fri, 24 May 2013 17:37:46 +0000 (01:37 +0800)]
Reference before period.

6 years agoHack quoting of hanning article.
Ralph Giles [Fri, 24 May 2013 17:28:29 +0000 (01:28 +0800)]
Hack quoting of hanning article.

If there's no complete author tag, we need to add an opening
quote character manually. See the EBU entry.

6 years agoWrap lookahead code example in a figure.
Ralph Giles [Fri, 24 May 2013 17:23:41 +0000 (01:23 +0800)]
Wrap lookahead code example in a figure.

6 years agoAdd a wikipedia reference for the Hanning window.
Ralph Giles [Fri, 24 May 2013 17:20:00 +0000 (01:20 +0800)]
Add a wikipedia reference for the Hanning window.

6 years agoMove the vorbis channel mapping to informative references.
Ralph Giles [Fri, 24 May 2013 17:18:25 +0000 (01:18 +0800)]
Move the vorbis channel mapping to informative references.

The normative reference is now the channel configurations
give directly in the draft.

6 years agoFix Ogg draft formatting.
Ralph Giles [Fri, 24 May 2013 17:16:23 +0000 (01:16 +0800)]
Fix Ogg draft formatting.

Previous markup was invalid.

6 years agoRemove an unnecessary comma.
Ralph Giles [Fri, 24 May 2013 16:29:16 +0000 (00:29 +0800)]
Remove an unnecessary comma.

6 years agoMerge JM's encoder suggestions.
Ralph Giles [Fri, 24 May 2013 10:28:58 +0000 (18:28 +0800)]
Merge JM's encoder suggestions.

I've done some editing for clarity, but more needs to be done.
The language needs clean-up, we should forward-reference the LPC
Extrapolation section, and we need a reference for actually
computing linear prediction coefficients.

6 years agoBump Ogg draft version and date. draft-ietf-codec-oggopus-01
Ralph Giles [Fri, 24 May 2013 10:03:00 +0000 (18:03 +0800)]
Bump Ogg draft version and date.

6 years agoMove implementation status details to wiki.xiph.org.
Ralph Giles [Fri, 24 May 2013 09:44:43 +0000 (17:44 +0800)]
Move implementation status details to wiki.xiph.org.

More recent versions of draft-sheffer-running-code suggest referring
to a wiki. We'd like to try maintaining the implementation status
separately.

6 years agoMake pitch_xcorr() work when len and max_pitch aren't multiples of 4.
Jean-Marc Valin [Fri, 24 May 2013 07:41:04 +0000 (03:41 -0400)]
Make pitch_xcorr() work when len and max_pitch aren't multiples of 4.

6 years agooops, removed a minus sign that should never have appeared
Jean-Marc Valin [Fri, 24 May 2013 05:38:06 +0000 (01:38 -0400)]
oops, removed a minus sign that should never have appeared

6 years agoUnrolled version of the pitch correlation
Jean-Marc Valin [Fri, 24 May 2013 05:09:31 +0000 (01:09 -0400)]
Unrolled version of the pitch correlation

About 30% faster on x86.

6 years agoMove misplaced RESTORE_STACK.
Timothy B. Terriberry [Fri, 24 May 2013 02:33:34 +0000 (19:33 -0700)]
Move misplaced RESTORE_STACK.

Introduced in c152d602.

Thanks to Pedro Becerra for the report.

6 years agoMake dump_modes compile again.
Timothy B. Terriberry [Thu, 23 May 2013 22:55:43 +0000 (15:55 -0700)]
Make dump_modes compile again.

6 years agoMove misplaced RESTORE_STACK.
Timothy B. Terriberry [Thu, 23 May 2013 22:54:55 +0000 (15:54 -0700)]
Move misplaced RESTORE_STACK.

Introduced in c152d602.

Thanks to Pedro Becerra for the report.

6 years agoRemove an unused variable added in 85ede2c6.
Timothy B. Terriberry [Thu, 23 May 2013 20:00:28 +0000 (13:00 -0700)]
Remove an unused variable added in 85ede2c6.

Thanks to John Ridges for the report.

6 years agoMinor configure adjustment.
Timothy B. Terriberry [Wed, 22 May 2013 23:15:30 +0000 (16:15 -0700)]
Minor configure adjustment.

Define ARMv4_ASM to 1 like the other ARM defines.

6 years agoMinor FFT cleanups.
Timothy B. Terriberry [Wed, 22 May 2013 22:46:00 +0000 (15:46 -0700)]
Minor FFT cleanups.

Remove a redundant include and some dead stores.

Patch by Aurélien Zanelli <aurelien.zanelli@parrot.com>.

6 years agoPort 1ed17cc2 to C_MUL and C_MUL4.
Timothy B. Terriberry [Wed, 22 May 2013 22:11:59 +0000 (15:11 -0700)]
Port 1ed17cc2 to C_MUL and C_MUL4.

Measures a 0.1% speedup on 96 kbps stereo encode+decode on a
 Cortex A8.

6 years agoSlightly faster C_MULC for ARMv4.
Nils Wallménius [Wed, 22 May 2013 21:08:42 +0000 (23:08 +0200)]
Slightly faster C_MULC for ARMv4.

Reorder register usage to take advantage of early termination on
 multiplications and reorder a load instruction to hide its
 latency on ARM9.
Speeds up decoding of a 64 kbps test file by 0.1MHz on an ARM7TDMI
 and 0.2MHz on an ARM9TDMI.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
6 years agoFaster MULT32_32_Q31 for ARM.
Nils Wallménius [Wed, 22 May 2013 21:05:07 +0000 (23:05 +0200)]
Faster MULT32_32_Q31 for ARM.

Uses a C implementation with a 32*32 => 64 multiplication, which
 ARM has.
Speeds up decoding of a 64 kbps test file by 0.5MHz on an ARM7TDMI
 and 1.0MHz on an ARM9TDMI.
0.2% speedup on a 96 kbps enc+dec test on a Cortex A8.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
6 years agoUse more MAC16_16's and unroll a loop.
Timothy B. Terriberry [Wed, 22 May 2013 22:26:12 +0000 (15:26 -0700)]
Use more MAC16_16's and unroll a loop.

This splits out the non-arch-specific portions of a patch written
 by Aurélien Zanelli <aurelien.zanelli@parrot.com
 http://lists.xiph.org/pipermail/opus/2013-May/002088.html

I also added support for odd n, for custom modes.

0.25% speedup on 96 kbps stereo encode+decode on a Cortex A8.

6 years agoMinor ARMv5E cleanups.
Timothy B. Terriberry [Wed, 22 May 2013 15:52:00 +0000 (08:52 -0700)]
Minor ARMv5E cleanups.

Missed the armv5e extension on a couple of functions.

6 years agoUse a table for PVQ encoding/decoding.
Timothy B. Terriberry [Wed, 22 May 2013 01:16:13 +0000 (18:16 -0700)]
Use a table for PVQ encoding/decoding.

58.4% speedup (2.4x faster) on test_unit_cwrs32 (no custom modes).
Gives a 3.2% speedup on
 ./opus_demo restricted-lowdelay 48000 2 96000 comp48-stereo.sw /dev/null
 on a 600 MHz Cortex A8.

6 years agoAdd new ARM headers to top-level file lists.
Timothy B. Terriberry [Tue, 21 May 2013 20:42:14 +0000 (13:42 -0700)]
Add new ARM headers to top-level file lists.

Otherwise make dist does not include these files in the source
 tarball.

6 years agoMove ARM asm into its own directories.
Timothy B. Terriberry [Tue, 21 May 2013 19:53:33 +0000 (12:53 -0700)]
Move ARM asm into its own directories.

6 years agoClean up register constraints.
Timothy B. Terriberry [Mon, 20 May 2013 22:29:04 +0000 (15:29 -0700)]
Clean up register constraints.

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHBJEHG.html
 says that "Rd cannot be the same as Rm."
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHBJEHG.html
 says that "RdLo, RdHi, and Rm must all be different registers."
This means that some of the early clobbers I removed really should
 have been there (to prevent aliasing Rd, RdLo, or RdHi with Rm).
It also means that we should reverse some of the operands in the
 FFT's complex multiplies.
This should only affect the ARMv4 optimizations.

Thanks to Nils Wallménius for the report.

While we're here, audit the commutative pair flags again, since I
 screwed up at least one of them, and eliminate some dead code.

6 years agoFix bustage in a16cef62.
Timothy B. Terriberry [Mon, 20 May 2013 03:52:55 +0000 (20:52 -0700)]
Fix bustage in a16cef62.

6 years agoMake autogen.sh cut and paste proof
Ron [Mon, 20 May 2013 03:10:42 +0000 (12:40 +0930)]
Make autogen.sh cut and paste proof

6 years agoAdd support for autoconf macros in m4/
Ron [Mon, 20 May 2013 03:01:48 +0000 (12:31 +0930)]
Add support for autoconf macros in m4/

Needed by commit 972a34ec2c79d241318af24389b8ee042d10556a.

Use autoreconf in autogen.sh instead of the handwritten version,
it's simpler, and also updates things that we weren't handling.

Drop the hand-written INSTALL file.  Its information content was
~zero, and autotools wants to overwrite it with its own version,
so don't fight that, just .gitignore it.

6 years agoReplace silk_CLZ functions with EC_ILOG().
Timothy B. Terriberry [Mon, 20 May 2013 01:25:45 +0000 (18:25 -0700)]
Replace silk_CLZ functions with EC_ILOG().

In most cases these will use __builtin_clz().
In a follow-up, we should audit usage of silk_CLZ32() and convert
 the places where its argument must be non-zero to use EC_ILOG()
 directly to avoid the test for zero (which is necessary on x86).

6 years agoConvert quotes in license headers to ASCII.
Timothy B. Terriberry [Mon, 20 May 2013 01:00:39 +0000 (18:00 -0700)]
Convert quotes in license headers to ASCII.

Since the last patch originally had them mangled (presumably by
 mailer, http server, or something else), let's just get rid of
 them.

6 years agoAdd ARMv4/ARMv5E macros.
Timothy B. Terriberry [Mon, 20 May 2013 00:11:17 +0000 (17:11 -0700)]
Add ARMv4/ARMv5E macros.

Original patch by Aurélien Zanelli <aurelien.zanelli@parrot.com>:
 http://lists.xiph.org/pipermail/opus/2013-May/002078.html

Revised version:
- Add autconf detection (ported from libtheora).
- Rename ARM5E to ARMv5E (an ARM5 is not the same thing as ARMv5!).
- Use actual macros so they can still be selectively overridden.
- Split out ARMv4 parts and add a few more ARMv4 macros.
- Label blocks to make them easy to find in generated assembly.
- Fix MULT16_32_Q15() so we can pass make check.
  The MDCT test passes in values larger than 2**30 for b.
  The new version should be just as fast (or faster, since it's
   easier to merge the shift with following instructions), and
   there's no appreciable impact on accuracy (FFT/MDCT SNR actually
   goes up in most cases).
- Fix register constraints.
  We were using early-clobber flags in a bunch of places that
   didn't need them, and commutative-pair flags in a bunch of
   places that weren't actually commutative.
  This was Jean-Marc's fault (the original code came from Speex).
- Simplify silk_CLZ16().
- Port over iFFT C_MULC asm by Andree Buschmann
   <AndreeBuschmann@t-online.de> from Rockbox.
- Speed up the C_MULC asm by using LDRD, allowing more flexible
   addressing, re-ordering instructions to avoid some stalls,
   allowing more flexible register allocation, and getting things
   out of the inline asm block so the compiler can schedule them
   better.
- Add C_MUL and C_MUL4 asm for the FFT to the encoder based, on the
   new C_MULC.

In total, this patch gives a 22.3% speed-up on test_opus_encoder on
 a 600 MHz Cortex A8 using gcc 4.2.1,
When restricted to ARMv4 optimizations, it gives a 9.6% speed-up
 on the same processor/compiler.
On the conformance test vectors:
 Average mono quality is 97.0583 %
 Average stereo quality is 97.775 %

6 years agocelt_maxabs16() now returns an opus_val32 to avoid problems with -32768
Jean-Marc Valin [Sun, 19 May 2013 03:33:48 +0000 (23:33 -0400)]
celt_maxabs16() now returns an opus_val32 to avoid problems with -32768

6 years agoChange few remaining instances of short to opus_int16
Jean-Marc Valin [Sat, 18 May 2013 06:50:40 +0000 (02:50 -0400)]
Change few remaining instances of short to opus_int16

6 years agoUse m4_esyscmd instead of m4_esyscmd_s
Ron [Sat, 18 May 2013 06:41:18 +0000 (16:11 +0930)]
Use m4_esyscmd instead of m4_esyscmd_s

We shouldn't ever have any trailing newlines that need trimming here,
and the _s version wasn't added to m4sugar.m4 until autoconf 2.63b,
so this will let it work with 2.13 again.

6 years agoFixes fixed-point PLC issue reported in trac ticket #1954
Jean-Marc Valin [Sat, 18 May 2013 06:14:24 +0000 (02:14 -0400)]
Fixes fixed-point PLC issue reported in trac ticket #1954

A fixed shift factor was insufficient to properly estimate the decay
factor, resulting in extreme attenuation of the PLC excitation.

6 years agoMaking sure redundant frames never use outdated analysis info
Jean-Marc Valin [Sat, 18 May 2013 03:22:09 +0000 (23:22 -0400)]
Making sure redundant frames never use outdated analysis info

6 years agoMerge branch 'surround'
Jean-Marc Valin [Fri, 17 May 2013 18:31:36 +0000 (14:31 -0400)]
Merge branch 'surround'

6 years agoConservative use of bandwidth detection in CELT
Jean-Marc Valin [Fri, 17 May 2013 18:15:31 +0000 (14:15 -0400)]
Conservative use of bandwidth detection in CELT

Takes into account the bitrate.

6 years agoAutomatic bandwidth decisions get more conservative as rate increases.
Jean-Marc Valin [Fri, 17 May 2013 06:03:33 +0000 (02:03 -0400)]
bandwidth decisions get more conservative as rate increases.

This should prevent errors in the bandwidth detection from affecting quality
when we have enough bits to be close to transparent.

6 years agoSaturates the last RC to 0.99 when Schur blows up
Jean-Marc Valin [Fri, 17 May 2013 03:09:34 +0000 (23:09 -0400)]
Saturates the last RC to 0.99 when Schur blows up

This is a follow-up on ac76b15. When Schur blows up, we set the last RC to
+/- 0.99 instead of eliminating it.

6 years agoSlight simplification of the bandwidth detection code
Jean-Marc Valin [Tue, 14 May 2013 02:35:09 +0000 (22:35 -0400)]
Slight simplification of the bandwidth detection code

New code is especially easier to justify

6 years agoDon't repeatedly install the doc dir for every file
Ron [Sun, 12 May 2013 05:02:52 +0000 (14:32 +0930)]
Don't repeatedly install the doc dir for every file

6 years agoRemove opus_compare.o in Makefile.unix clean too
Ron [Sun, 12 May 2013 04:39:28 +0000 (14:09 +0930)]
Remove opus_compare.o in Makefile.unix clean too

It breaks the autoconf builds amusingly when that is left behind.

6 years agoMore gitignorance
Ron [Fri, 10 May 2013 23:35:50 +0000 (09:05 +0930)]
More gitignorance

6 years agoDon't fail hard if package_version does not exist
Ron [Fri, 10 May 2013 22:03:03 +0000 (07:33 +0930)]
Don't fail hard if package_version does not exist

There's currently at least one way that people can legitimately get a
tarball that doesn't include it, via the gitweb snapshots, so create
it rather than considering that an error to be manually fixed.

6 years agoChange Visual Studio files to use PACKAGE_VERSION.
Ralph Giles [Fri, 10 May 2013 17:55:52 +0000 (10:55 -0700)]
Change Visual Studio files to use PACKAGE_VERSION.

This replaces the OPUS_VERSION removed by ron's auto-updater.

6 years agoMore Makefile.unix tweaks
Ron [Fri, 10 May 2013 16:43:47 +0000 (02:13 +0930)]
More Makefile.unix tweaks

Drop some unneeded CINCLUDES.
Drop the VPATH stuff altogether.  It's entirely unused here, and some of
the paths in it don't even exist and apparently never have in this tree.
Drop the 'default' rule, without it there, 'all' already is the default.
Drop $(TARGET) from all, it already includes 'lib' which is $(TARGET).
Declare phony targets PHONY.

6 years agoFully automate version updating
Ron [Fri, 10 May 2013 16:35:24 +0000 (02:05 +0930)]
Fully automate version updating

This one meets or exceeds the following requirements:

 - Version is checked/updated for every build action when in the git repo.
   Does not require the user to re- ./configure to get the correct version.

 - Version is not updated automatically when using exported tarball source.
   Avoids accidentally getting a wrong version from some other git repo in
   a parent directory of the source, and allows setting the correct version
   for distro package exports.

 - Automatic updating can be manually suppressed.
   For developers doing lots of change/rebuild cycles they don't plan to
   release, when they don't want a full rebuild triggered for every commit,
   and again for every change made immediately after a commit.
   The version will still always be updated if they do a `make dist`.

 - Does not require any manual updating of versions in the mainline git
   repo for each release aside from normal tagging.  The version is
   recorded in one file only, that is automatically generated and will
   never need to be committed.

 - Does not require gnu-make features for the autoconf builds.

It does not currently:

 - Keep a checksum of every source file in tarball releases to mangle the
   version if people modify the tarball source.  Responsible people can
   manually update the version easily though in such cases.

The version.mk file is now only used by the VC project files.  Once they
are updated to use the package_version file too, then it can be deleted
from the repository.

6 years agoBump version to match 1.0.x branch
Jean-Marc Valin [Thu, 9 May 2013 20:52:26 +0000 (16:52 -0400)]
Bump version to match 1.0.x branch

6 years agoFixes an assertion failure in SILK
Jean-Marc Valin [Thu, 9 May 2013 20:17:13 +0000 (16:17 -0400)]
Fixes an assertion failure in SILK

We stop the schur recursion before any reflection coefficient
goes outside of ]-1,1[ and we force reporting a residual energy
of at least 1.
Assertion was:
Fatal (internal) error in ../silk/fixed/noise_shape_analysis_FIX.c, line 290: assertion failed: nrg >= 0
triggered by:
opus_demo voip 16000 1 12500 -bandwidth WB -complexity 10 pl04f087.stp-crash out.pcm

6 years agoFix bustage from c152d602.
Timothy B. Terriberry [Wed, 8 May 2013 21:08:42 +0000 (14:08 -0700)]
Fix bustage from c152d602.

silk_setup_resamples() was using x_bufFIX for two purposes, and I
 only allocated enough space for one of them.
This patch also switches to slightly more descriptive variable
 names than nSamples_temp and computes the resampler input/ouput
 sizes in a way that a little more obviously doesn't have issues
 with fractional samples (and replaces a divide with a variable
 divisor by one with a constant divisor).

6 years agoUse dynamic stack allocation in the SILK encoder.
Timothy B. Terriberry [Wed, 8 May 2013 17:32:37 +0000 (10:32 -0700)]
Use dynamic stack allocation in the SILK encoder.

This makes all remaining large stack allocations use the vararray
 macros.
This continues the work of 6f2d9f50 to allow compiling with
 NONTHREADSAFE_PSEUDOSTACK to move the memory for large buffers
 off the stack for devices where it is very limited.

It also does this for some additional large buffers used by the
 PLC in the decoder.

6 years agoFix several memory errors in the SILK resampler.
Timothy B. Terriberry [Wed, 8 May 2013 17:25:52 +0000 (10:25 -0700)]
Fix several memory errors in the SILK resampler.

1) The memcpy's were using sizeof(opus_int32), but the type of the
    local buffer was opus_int16.
2) Because the size was wrong, this potentially allowed the source
    and destination regions of the memcpy overlap.
   I _believe_ that nSamplesIn is at least fs_in_khZ, which is at
    least 8.
   Since RESAMPLER_ORDER_FIR_12 is only 8, I don't think that's a
    problem once you fix the type size.
3) The size of the buffer used RESAMPLER_MAX_BATCH_SIZE_IN, but the
    data stored in it was actually _twice_ the input batch size
    (nSamplesIn<<1).

Because this never blew up in testing, I suspect that in practice
 the batch sizes are reasonable enough that none of these things
 was ever a problem, but proving that seems non-obvious.

This patch just converts the whole thing to use CELT's vararrays.
This fixes the buffer size problems (since we allocate a buffer
 with the actual size we use) and gets these large buffers off the
 stack on devices using the pseudo-stack.
It also fixes the memcpy problems by changing the sizeof to
 opus_int16.
It turns out sFIR, which saved state between calls, was being used
 elsewhere as opus_int32, so this converts it to a union to make
 this sharing explicit.

6 years agoRemove trailing whitespace.
Timothy B. Terriberry [Sat, 6 Apr 2013 04:48:35 +0000 (21:48 -0700)]
Remove trailing whitespace.

6 years agoFix some warnings.
Timothy B. Terriberry [Thu, 4 Apr 2013 02:38:35 +0000 (19:38 -0700)]
Fix some warnings.

You can't use /* within a comment.

6 years agoUpdate implementation status for Firefox 20 stable release.
Ralph Giles [Tue, 30 Apr 2013 20:37:12 +0000 (13:37 -0700)]
Update implementation status for Firefox 20 stable release.

Release date based on directory timestamps in
https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0/

6 years agoRevisit surround rate allocation surround
Jean-Marc Valin [Mon, 6 May 2013 20:03:39 +0000 (16:03 -0400)]
Revisit surround rate allocation

Stereo now gets twice the "marginal allocation" compared to mono, but has
a 20 kb/s offset. This should be more realistic across a wide range of
bitrates.

6 years agoAdds spreading to the surround masking computation
Jean-Marc Valin [Mon, 6 May 2013 20:02:31 +0000 (16:02 -0400)]
Adds spreading to the surround masking computation

This avoids a single low-energy band from changing the masking results.

6 years agoImplements basic surround masking
Jean-Marc Valin [Sun, 5 May 2013 03:54:20 +0000 (23:54 -0400)]
Implements basic surround masking

The idea is that the rate of each stream is adjusted based on its
contribution to the total energy of a stereo downmix.

6 years agoAdds support for all Vorbis mappings
Jean-Marc Valin [Mon, 29 Apr 2013 22:32:27 +0000 (18:32 -0400)]
Adds support for all Vorbis mappings

6 years agoMore forced decisions in CELT LFE encoding
Jean-Marc Valin [Sat, 27 Apr 2013 06:29:52 +0000 (02:29 -0400)]
More forced decisions in CELT LFE encoding

6 years agoSurround: Better LFE handling
Jean-Marc Valin [Fri, 26 Apr 2013 20:32:10 +0000 (16:32 -0400)]
Surround: Better LFE handling

Forces CELT-only mode for LFE (despite the rate) and "locks" most of the
CELT analysis:
- No transient or TF
- Band boost on first band
- Only first two bands get PVQ bits
- Forced energy decay after the first two bands

6 years agoInitial surround code with new API
Jean-Marc Valin [Fri, 26 Apr 2013 01:34:04 +0000 (21:34 -0400)]
Initial surround code with new API

Conflicts:
src/opus_multistream_encoder.c

6 years agoFixes missing initialization in OpusMSEncoder
Jean-Marc Valin [Sun, 5 May 2013 06:22:06 +0000 (02:22 -0400)]
Fixes missing initialization in OpusMSEncoder

Problem found using valgrind.

6 years agoFixes FEC issues introduced in 7fcd66c
Jean-Marc Valin [Tue, 23 Apr 2013 06:41:28 +0000 (02:41 -0400)]
Fixes FEC issues introduced in 7fcd66c

This left FEC disabled on the decoder side for all cases except concatenated
packets. Also fixes a FEC bug in opus_demo (wrong output buffer size
calculation).

6 years agoVBR bitrate calibration for variable duration.
Jean-Marc Valin [Sat, 20 Apr 2013 02:44:03 +0000 (22:44 -0400)]
VBR bitrate calibration for variable duration.

Also fixes uninitialized value in previous commit.

6 years agoVariable framesize improvements
Jean-Marc Valin [Fri, 19 Apr 2013 07:14:28 +0000 (03:14 -0400)]
Variable framesize improvements

- Properly apply the transient boost by counting all the bits in the cost
- Disable the post-filter for non-20-ms frames that follow a transient (applies
  only to variable framesize)

6 years agoConverts the analysis to ALLOC()
Jean-Marc Valin [Mon, 15 Apr 2013 19:49:40 +0000 (15:49 -0400)]
Converts the analysis to ALLOC()

6 years agoFixes a minor bug found by valgrind in the bandwidth detector
Jean-Marc Valin [Mon, 15 Apr 2013 06:45:02 +0000 (02:45 -0400)]
Fixes a minor bug found by valgrind in the bandwidth detector

The energy calculation from the packed FFTs ended up reading out-of-bound
memory for frequency zero. The bug was exposed by c5e04e4.

6 years agoRandom complexity in the encoder tests.
Gregory Maxwell [Sat, 6 Apr 2013 02:16:58 +0000 (19:16 -0700)]
Random complexity in the encoder tests.

6 years agoFix some 16-bit int issues in the multistream API.
Timothy B. Terriberry [Mon, 18 Mar 2013 21:42:44 +0000 (14:42 -0700)]
Fix some 16-bit int issues in the multistream API.

With 120 ms frames and 6 or more channels, the total number of
 samples in the buffer could overflow.