opus.git
11 years agofix minor compilation error/warning
Jean-Marc Valin [Fri, 11 Apr 2008 20:55:39 +0000 (06:55 +1000)]
fix minor compilation error/warning

11 years agofixed three declaration-after-statement issues
Jean-Marc Valin [Fri, 11 Apr 2008 07:23:01 +0000 (17:23 +1000)]
fixed three declaration-after-statement issues

11 years agofixed a few warnings, no real change
Jean-Marc Valin [Thu, 10 Apr 2008 21:23:53 +0000 (07:23 +1000)]
fixed a few warnings, no real change

11 years agoReworked the static modes. Now, if all static modes have the same frame size,
Jean-Marc Valin [Thu, 10 Apr 2008 18:07:52 +0000 (04:07 +1000)]
Reworked the static modes. Now, if all static modes have the same frame size,
overlap or number of channels, we can pass the hint to the compiler.

11 years agosome index work (simplifications for dumb compilers) on IMDCT
Jean-Marc Valin [Thu, 10 Apr 2008 08:54:02 +0000 (18:54 +1000)]
some index work (simplifications for dumb compilers) on IMDCT

11 years agoAdded a missing RESTORE_STACK in intra_prediction()
Jean-Marc Valin [Thu, 10 Apr 2008 04:43:59 +0000 (14:43 +1000)]
Added a missing RESTORE_STACK in intra_prediction()

11 years agoNot all compilers are equal -- making it clearer how the MDCT indexing is done
Jean-Marc Valin [Thu, 10 Apr 2008 04:38:14 +0000 (14:38 +1000)]
Not all compilers are equal -- making it clearer how the MDCT indexing is done

11 years agoDefining IMUL32 for 32x32=>32 int multiplications and using it in the range
Jean-Marc Valin [Thu, 10 Apr 2008 03:24:48 +0000 (13:24 +1000)]
Defining IMUL32 for 32x32=>32 int multiplications and using it in the range
coder

11 years agoSimplified indexing in intra_prediction()
Jean-Marc Valin [Thu, 10 Apr 2008 02:21:26 +0000 (12:21 +1000)]
Simplified indexing in intra_prediction()

11 years agofixed ordering of the channels in the intra prediction.
Jean-Marc Valin [Thu, 10 Apr 2008 01:00:51 +0000 (11:00 +1000)]
fixed ordering of the channels in the intra prediction.

11 years agoDefining DISABLE_STEREO now optimises for the mono case
Jean-Marc Valin [Wed, 9 Apr 2008 23:13:05 +0000 (09:13 +1000)]
Defining DISABLE_STEREO now optimises for the mono case

11 years agoFixed a stereo regression introduced in e28f25f0d14959d521fda0cdb8f1220995bc50e8
Jean-Marc Valin [Wed, 9 Apr 2008 23:00:12 +0000 (09:00 +1000)]
Fixed a stereo regression introduced in e28f25f0d14959d521fda0cdb8f1220995bc50e8

11 years agoFixed rsqrt testcase for float
Jean-Marc Valin [Sat, 5 Apr 2008 04:36:05 +0000 (14:36 +1000)]
Fixed rsqrt testcase for float

11 years agoRework CWRS code.
Timothy B. Terriberry [Fri, 4 Apr 2008 14:16:19 +0000 (10:16 -0400)]
Rework CWRS code.

This eliminates an extra O(nm) lookups on decode, and reduces the rate control
 from O(nm^2) to O(nm), in addition to eliminating O(m) lookups on both encode
 and decode.
Although the interface is slightly more complex, the internal code is also
 simpler.

11 years agoChanged the rules for using the pulse spreading. It should be used less often
Jean-Marc Valin [Fri, 28 Mar 2008 06:59:36 +0000 (17:59 +1100)]
Changed the rules for using the pulse spreading. It should be used less often
and mainly in the mid-range.

11 years agoRevert ABS16/32 on C55 -- ended up being slower
Jean-Marc Valin [Thu, 27 Mar 2008 21:45:46 +0000 (08:45 +1100)]
Revert ABS16/32 on C55 -- ended up being slower

11 years agoABS16 and ABS32 for the C55
Jean-Marc Valin [Thu, 27 Mar 2008 21:31:33 +0000 (08:31 +1100)]
ABS16 and ABS32 for the C55

11 years agoMaking the pulsesAtOnce code 16-bit safe.
Jean-Marc Valin [Thu, 27 Mar 2008 13:33:04 +0000 (00:33 +1100)]
Making the pulsesAtOnce code 16-bit safe.

11 years agoJust commenting -- nothing to see.
Jean-Marc Valin [Thu, 27 Mar 2008 07:05:01 +0000 (18:05 +1100)]
Just commenting -- nothing to see.

11 years agoOptimisation: got rid of about 10% of the 32-bit divisions by using ec_enc_uint
Jean-Marc Valin [Thu, 27 Mar 2008 04:41:38 +0000 (15:41 +1100)]
Optimisation: got rid of about 10% of the 32-bit divisions by using ec_enc_uint
in energy quantisation when possible.

11 years agoRemoved a few int divisions from the intra prediction code.
Jean-Marc Valin [Thu, 27 Mar 2008 03:18:28 +0000 (14:18 +1100)]
Removed a few int divisions from the intra prediction code.

11 years agoremoved some int div
Jean-Marc Valin [Thu, 27 Mar 2008 01:22:44 +0000 (12:22 +1100)]
removed some int div

11 years agofixed-point: using MULT16_16 instead of * in compute_band_energies()
Jean-Marc Valin [Wed, 26 Mar 2008 23:22:42 +0000 (10:22 +1100)]
fixed-point: using MULT16_16 instead of * in compute_band_energies()

11 years agoMaking a few functions static inline
Jean-Marc Valin [Wed, 26 Mar 2008 22:00:14 +0000 (09:00 +1100)]
Making a few functions static inline

11 years agoTrying to clean up celt_ilog2() vs. EC_ILOG a bit.
Jean-Marc Valin [Wed, 26 Mar 2008 21:40:45 +0000 (08:40 +1100)]
Trying to clean up celt_ilog2() vs. EC_ILOG a bit.

11 years agomaking {next|prev}_cwrs* inline
Jean-Marc Valin [Wed, 26 Mar 2008 12:33:06 +0000 (23:33 +1100)]
making {next|prev}_cwrs* inline

11 years agooptimisation: changed some for() loops to do-while() to give the compiler
Jean-Marc Valin [Wed, 26 Mar 2008 10:31:56 +0000 (21:31 +1100)]
optimisation: changed some for() loops to do-while() to give the compiler
a hint that there has to be at least one iteration.

11 years agoMaking it obvious to the compiler how to generate a dual-MAC in
Jean-Marc Valin [Wed, 26 Mar 2008 07:03:22 +0000 (18:03 +1100)]
Making it obvious to the compiler how to generate a dual-MAC in
mix_pitch_and_residual()

11 years agomix_pitch_and_residual() no longer computing Ryp twice
Jean-Marc Valin [Wed, 26 Mar 2008 06:57:49 +0000 (17:57 +1100)]
mix_pitch_and_residual() no longer computing Ryp twice

11 years agooptimisation: defined a reciprocal square root (celt_rsqrt) for use in
Jean-Marc Valin [Wed, 26 Mar 2008 05:42:42 +0000 (16:42 +1100)]
optimisation: defined a reciprocal square root (celt_rsqrt) for use in
find_spectral_pitch instead of using celt_rcp(celt_sqrt(x))

11 years agoFixed the rcp() testcase for new assumptions (x is positive)
Jean-Marc Valin [Wed, 26 Mar 2008 04:56:07 +0000 (15:56 +1100)]
Fixed the rcp() testcase for new assumptions (x is positive)

11 years agooptimisation: shaving a few cycles off prev_cwrs* by not computed the values
Jean-Marc Valin [Wed, 26 Mar 2008 04:46:51 +0000 (15:46 +1100)]
optimisation: shaving a few cycles off prev_cwrs* by not computed the values
we're not going to use.

11 years agooptimisations: faster handling of the zero for compute_band_energies() and
Jean-Marc Valin [Wed, 26 Mar 2008 03:36:07 +0000 (14:36 +1100)]
optimisations: faster handling of the zero for compute_band_energies() and
normalise_bands(). Also, another bunch of restrict qualifiers -- mainly
to tell the compiler there's no aliasing between the array bounds and the
data.

11 years agochanged 1*rcp(x) to just rcp(x)
Jean-Marc Valin [Wed, 26 Mar 2008 02:45:01 +0000 (13:45 +1100)]
changed 1*rcp(x) to just rcp(x)

11 years agooptimisation: intra_prediction() no longer needs to divide inside the search
Jean-Marc Valin [Wed, 26 Mar 2008 01:16:00 +0000 (12:16 +1100)]
optimisation: intra_prediction() no longer needs to divide inside the search

11 years agooptimisation: The "simple" Rxy/sqrt(Ryy) case in alg_quant no longer requires
Jean-Marc Valin [Tue, 25 Mar 2008 23:34:23 +0000 (10:34 +1100)]
optimisation: The "simple" Rxy/sqrt(Ryy) case in alg_quant no longer requires
a division

11 years agoDecision on whether to use pitch is now taken only based on energy in the
Jean-Marc Valin [Tue, 25 Mar 2008 21:10:27 +0000 (08:10 +1100)]
Decision on whether to use pitch is now taken only based on energy in the
first three bands (instead of total MDCT window energy)

11 years agoproperly defined EPSILON for the float case
Jean-Marc Valin [Tue, 25 Mar 2008 13:00:18 +0000 (00:00 +1100)]
properly defined EPSILON for the float case

11 years agoA bunch of pointers marked as "restrict" to ease the job of the compiler
Jean-Marc Valin [Tue, 25 Mar 2008 11:38:58 +0000 (22:38 +1100)]
A bunch of pointers marked as "restrict" to ease the job of the compiler

11 years agooptimisation: spreading_func now in-place with no branch in the loop and half
Jean-Marc Valin [Tue, 25 Mar 2008 11:09:32 +0000 (22:09 +1100)]
optimisation: spreading_func now in-place with no branch in the loop and half
the multiplications

11 years agooops. find_max32() now uses VERY_LARGE32 (instead of VERY_LARGE16)
Jean-Marc Valin [Tue, 25 Mar 2008 10:31:12 +0000 (21:31 +1100)]
oops. find_max32() now uses VERY_LARGE32 (instead of VERY_LARGE16)

11 years agooptimisations: Another bunch of simplifications to alg_quant(), mainly to
Jean-Marc Valin [Tue, 25 Mar 2008 10:28:40 +0000 (21:28 +1100)]
optimisations: Another bunch of simplifications to alg_quant(), mainly to
remove unnecessary copying and some conditional branches.

11 years agooptimisation: Making use of restrict in find_spectral_pitch() to disambiguate
Jean-Marc Valin [Tue, 25 Mar 2008 07:04:08 +0000 (18:04 +1100)]
optimisation: Making use of restrict in find_spectral_pitch() to disambiguate
X and Y.

11 years agooptimisations: caching sign of x in alg_quant(), changed celt_div()/celt_rcp()
Jean-Marc Valin [Tue, 25 Mar 2008 05:07:05 +0000 (16:07 +1100)]
optimisations: caching sign of x in alg_quant(), changed celt_div()/celt_rcp()
to assume denominator is positive.

11 years agoOptimised intra prediction a bit -- removed a conditional branch and replaced
Jean-Marc Valin [Tue, 25 Mar 2008 04:25:08 +0000 (15:25 +1100)]
Optimised intra prediction a bit -- removed a conditional branch and replaced
some calls to ec_enc_uint() by calls to ec_enc_bits() (saves divisions)

11 years agoRemoved support for more than one MDCT blocks per frame. I don't think there's
Jean-Marc Valin [Tue, 25 Mar 2008 03:38:55 +0000 (14:38 +1100)]
Removed support for more than one MDCT blocks per frame. I don't think there's
a use for that anymore now that the overlap can be less than one frame.

11 years agoRemoved the "pitch compression" in the residual quantisation. Also, removed
Jean-Marc Valin [Tue, 25 Mar 2008 03:15:41 +0000 (14:15 +1100)]
Removed the "pitch compression" in the residual quantisation. Also, removed
the more complex "n-best search" and replaced it with a greedy search

11 years agoUnrolled the inner loop in vq_index() so that the codebook unpacking doesn't
Jean-Marc Valin [Mon, 24 Mar 2008 10:39:49 +0000 (21:39 +1100)]
Unrolled the inner loop in vq_index() so that the codebook unpacking doesn't
require a branch.

11 years agoMaking bits2pulses() use a fixed number of iterations to allow further
Jean-Marc Valin [Mon, 24 Mar 2008 06:06:08 +0000 (17:06 +1100)]
Making bits2pulses() use a fixed number of iterations to allow further
optimisations.

11 years agoinclude "dsplib.h" in fixed_c5x.h
Jean-Marc Valin [Sun, 23 Mar 2008 21:32:49 +0000 (08:32 +1100)]
include "dsplib.h" in fixed_c5x.h

11 years agoreplaced divisions by recoprocals in intra prediction and folding
Jean-Marc Valin [Sun, 23 Mar 2008 21:15:40 +0000 (08:15 +1100)]
replaced divisions by recoprocals in intra prediction and folding

11 years agodefined find_max16 and overrode it for C55x
Jean-Marc Valin [Sat, 22 Mar 2008 21:06:29 +0000 (08:06 +1100)]
defined find_max16 and overrode it for C55x

11 years agoMade a second version of ec_{en|de}code optimised for encoding bits (no div
Jean-Marc Valin [Sat, 22 Mar 2008 11:58:45 +0000 (22:58 +1100)]
Made a second version of ec_{en|de}code optimised for encoding bits (no div
required) and using it in ec_{en|de}c_bits()

11 years agoNo longer trying to save bits when encoding integers near the upper limit
Jean-Marc Valin [Sat, 22 Mar 2008 11:23:58 +0000 (22:23 +1100)]
No longer trying to save bits when encoding integers near the upper limit
(and fix for celt_div with 16-bit numerator on a 16-bit CPU)

11 years agofixed-point: added cheap celt_div() division using a reciprocal
Jean-Marc Valin [Sat, 22 Mar 2008 10:17:45 +0000 (21:17 +1100)]
fixed-point: added cheap celt_div() division using a reciprocal

11 years agomore use of restrict
Jean-Marc Valin [Sat, 22 Mar 2008 06:53:12 +0000 (17:53 +1100)]
more use of restrict

11 years agoUsing restrict to make it clear there's no aliasing issues in the mdct.
Jean-Marc Valin [Sat, 22 Mar 2008 00:23:57 +0000 (11:23 +1100)]
Using restrict to make it clear there's no aliasing issues in the mdct.

11 years agoAdded a few "restrict" keywords and changed some divisions to shifts
Jean-Marc Valin [Fri, 21 Mar 2008 22:01:50 +0000 (09:01 +1100)]
Added a few "restrict" keywords and changed some divisions to shifts

11 years agofixed TI fft code -- again
Jean-Marc Valin [Fri, 21 Mar 2008 11:54:41 +0000 (22:54 +1100)]
fixed TI fft code -- again

11 years agoRemoved potentially unused var in MDCT init
Jean-Marc Valin [Fri, 21 Mar 2008 02:11:16 +0000 (13:11 +1100)]
Removed potentially unused var in MDCT init

11 years agooops (TI FFT)
Jean-Marc Valin [Fri, 21 Mar 2008 02:02:53 +0000 (13:02 +1100)]
oops (TI FFT)

11 years agolocal var name maxval was shadowing the TI function used to compute it
Jean-Marc Valin [Fri, 21 Mar 2008 01:53:37 +0000 (12:53 +1100)]
local var name maxval was shadowing the TI function used to compute it

11 years agomake sure TRIG_UPSCALE is properly defined
Jean-Marc Valin [Fri, 21 Mar 2008 01:51:05 +0000 (12:51 +1100)]
make sure TRIG_UPSCALE is properly defined

11 years agofix for TI version of celt_maxabs16()
Jean-Marc Valin [Fri, 21 Mar 2008 01:49:36 +0000 (12:49 +1100)]
fix for TI version of celt_maxabs16()

11 years agofixed-point: fix for 32-bit TI FFT
Jean-Marc Valin [Fri, 21 Mar 2008 01:47:41 +0000 (12:47 +1100)]
fixed-point: fix for 32-bit TI FFT

11 years agofixed-point: Wrapper for the 32-bit complex FFT used in the MDCT so we can use
Jean-Marc Valin [Fri, 21 Mar 2008 01:09:27 +0000 (12:09 +1100)]
fixed-point: Wrapper for the 32-bit complex FFT used in the MDCT so we can use
the TI dsplib FFT.

11 years agofixed-point: defined celt_maxabs16() as basic operator
Jean-Marc Valin [Fri, 21 Mar 2008 00:13:51 +0000 (11:13 +1100)]
fixed-point: defined celt_maxabs16() as basic operator

11 years agofixed-point: MULT16_32_Q15 for TI DSP (not entirely happy with it)
Jean-Marc Valin [Thu, 20 Mar 2008 23:53:09 +0000 (10:53 +1100)]
fixed-point: MULT16_32_Q15 for TI DSP (not entirely happy with it)

11 years agos/ROUND/ROUND16/
Jean-Marc Valin [Thu, 20 Mar 2008 23:46:17 +0000 (10:46 +1100)]
s/ROUND/ROUND16/

11 years agofixed-point: using TI intrinsic for celt_ilog2() if available.
Jean-Marc Valin [Thu, 20 Mar 2008 23:40:43 +0000 (10:40 +1100)]
fixed-point: using TI intrinsic for celt_ilog2() if available.

11 years agoWrapper for the TI dsplib FFT
Jean-Marc Valin [Thu, 20 Mar 2008 12:17:18 +0000 (23:17 +1100)]
Wrapper for the TI dsplib FFT

11 years agoMaking the real/single FFT easier to replace
Jean-Marc Valin [Thu, 20 Mar 2008 11:23:54 +0000 (22:23 +1100)]
Making the real/single FFT easier to replace

11 years agoRandom numbers should work on 16-bit archs.
Jean-Marc Valin [Tue, 18 Mar 2008 22:33:49 +0000 (09:33 +1100)]
Random numbers should work on 16-bit archs.

11 years agofixed-point: more TI macros. Comments on the existing ones.
Jean-Marc Valin [Sun, 16 Mar 2008 12:33:02 +0000 (23:33 +1100)]
fixed-point: more TI macros. Comments on the existing ones.

11 years agoRemoved useless functions that caused warnings in skeleton.c
Jean-Marc Valin [Sun, 16 Mar 2008 10:39:05 +0000 (21:39 +1100)]
Removed useless functions that caused warnings in skeleton.c

11 years agoMaking sure not to use the C library calls directly
Jean-Marc Valin [Sat, 15 Mar 2008 20:55:29 +0000 (07:55 +1100)]
Making sure not to use the C library calls directly

11 years agoSome work on assertions.
Jean-Marc Valin [Sat, 15 Mar 2008 12:34:39 +0000 (23:34 +1100)]
Some work on assertions.

11 years agoNew C55 macro
Jean-Marc Valin [Fri, 14 Mar 2008 21:12:49 +0000 (08:12 +1100)]
New C55 macro

11 years agofixed-point: Fixed a "shift too large" warning by using a 16-bit mul instead
Jean-Marc Valin [Fri, 14 Mar 2008 21:04:16 +0000 (08:04 +1100)]
fixed-point: Fixed a "shift too large" warning by using a 16-bit mul instead
of 32-bit in find_spectral_pitch()

11 years agofixed-point: playing it safe. SHL32() now automatically casts input to 32-bit
Jean-Marc Valin [Fri, 14 Mar 2008 06:58:33 +0000 (17:58 +1100)]
fixed-point: playing it safe. SHL32() now automatically casts input to 32-bit
to prevent surprises. Also, a few comments.

11 years agofixed-point: fixed a 16-bit issue in normalise_bands() where Q15ONE was directly
Jean-Marc Valin [Fri, 14 Mar 2008 05:28:28 +0000 (16:28 +1100)]
fixed-point: fixed a 16-bit issue in normalise_bands() where Q15ONE was directly
shifted left

11 years agoRemoved unnecessary header inclusions
Jean-Marc Valin [Fri, 14 Mar 2008 00:09:50 +0000 (11:09 +1100)]
Removed unnecessary header inclusions

11 years agoAdjusting/fixing warnings
Jean-Marc Valin [Thu, 13 Mar 2008 12:01:55 +0000 (23:01 +1100)]
Adjusting/fixing warnings

11 years agofixed-point: Using reciproqual instead of DIV32_16 for find_spectral_pitch()
Jean-Marc Valin [Thu, 13 Mar 2008 06:55:03 +0000 (17:55 +1100)]
fixed-point: Using reciproqual instead of DIV32_16 for find_spectral_pitch()

11 years agoEnabling warnings and restricting symbol visibility
Jean-Marc Valin [Thu, 13 Mar 2008 06:39:55 +0000 (17:39 +1100)]
Enabling warnings and restricting symbol visibility

11 years agoAdded mathops-test
Jean-Marc Valin [Thu, 13 Mar 2008 06:20:08 +0000 (17:20 +1100)]
Added mathops-test

11 years agofixed-point: simplification of the gain in mix_pitch_and_residual()
Jean-Marc Valin [Thu, 13 Mar 2008 00:36:45 +0000 (11:36 +1100)]
fixed-point: simplification of the gain in mix_pitch_and_residual()

11 years agofixed-point: simplifying the arithmetic in alg_quant()
Jean-Marc Valin [Thu, 13 Mar 2008 00:18:15 +0000 (11:18 +1100)]
fixed-point: simplifying the arithmetic in alg_quant()

11 years agoMore accurate sqrt approximation using MULT16_16_Q15() instead of Q14.
Jean-Marc Valin [Wed, 12 Mar 2008 12:00:42 +0000 (23:00 +1100)]
More accurate sqrt approximation using MULT16_16_Q15() instead of Q14.

11 years agoTODO update
Jean-Marc Valin [Wed, 12 Mar 2008 11:21:46 +0000 (22:21 +1100)]
TODO update

11 years agoIncreased accuracy of the reciprocal approximation and made it use
Jean-Marc Valin [Wed, 12 Mar 2008 10:34:50 +0000 (21:34 +1100)]
Increased accuracy of the reciprocal approximation and made it use
MULT16_16_Q15() instead of Q14 (should be faster).

11 years agoTestcases should now work even when symbols aren't visible in the dso
Jean-Marc Valin [Wed, 12 Mar 2008 07:04:27 +0000 (18:04 +1100)]
Testcases should now work even when symbols aren't visible in the dso

11 years agoAdded info for properly exporting symbols
Jean-Marc Valin [Wed, 12 Mar 2008 06:46:04 +0000 (17:46 +1100)]
Added info for properly exporting symbols

11 years agoChanged definition of VARDECL to make it more flexible. No actual code change.
Jean-Marc Valin [Wed, 12 Mar 2008 06:17:23 +0000 (17:17 +1100)]
Changed definition of VARDECL to make it more flexible. No actual code change.

11 years agoUsing reciprocal approximation instead of full 32-bit division in alg_quant()
Jean-Marc Valin [Wed, 12 Mar 2008 02:26:37 +0000 (13:26 +1100)]
Using reciprocal approximation instead of full 32-bit division in alg_quant()

11 years agoconfigure update (MIXED_PRECISION and STATIC_MODES can now be used)
Jean-Marc Valin [Wed, 12 Mar 2008 00:47:19 +0000 (11:47 +1100)]
configure update (MIXED_PRECISION and STATIC_MODES can now be used)

11 years agoDefined the celt_rcp() reciprocal approximation
Jean-Marc Valin [Wed, 12 Mar 2008 00:28:26 +0000 (11:28 +1100)]
Defined the celt_rcp() reciprocal approximation

11 years ago__GNUC_PREREQ should be causing problems anymore.
Jean-Marc Valin [Tue, 11 Mar 2008 23:42:24 +0000 (10:42 +1100)]
__GNUC_PREREQ should be causing problems anymore.

11 years agoAdded macro definitions for the TI C5x family (untested)
Jean-Marc Valin [Tue, 11 Mar 2008 23:16:26 +0000 (10:16 +1100)]
Added macro definitions for the TI C5x family (untested)

11 years agoBetter heuristic for deciding when to use the 32-bit version of the cwrs code.
Jean-Marc Valin [Tue, 11 Mar 2008 04:24:07 +0000 (15:24 +1100)]
Better heuristic for deciding when to use the 32-bit version of the cwrs code.