Commit graph

322 commits

Author SHA1 Message Date
Jean-Marc Valin
7a56741b2e removing redundant calls to log2() 2009-06-13 23:02:54 -04:00
Jean-Marc Valin
52cb5fb3f6 Adding extra fine bits only when we have rounded down in the allocation 2009-06-10 08:08:55 -04:00
Jean-Marc Valin
c871c8de38 The 010101 end of stream pattern is no longer needed now that we use the
remaining bits for fine energy
2009-06-09 00:57:00 -04:00
Jean-Marc Valin
39710536fc This makes it possible to use the bits left after PVQ for fine energy. 2009-06-09 00:52:16 -04:00
Jean-Marc Valin
52b4cb2166 Merge commit 'greg/master'
Conflicts:
	libcelt/celt.c
	libcelt/celt.h
2009-06-05 17:21:17 -04:00
Jean-Marc Valin
56522addc2 IETF doc update, including better source code formatting 2009-06-05 17:17:25 -04:00
Gregory Maxwell
2dd3d3258a For celt_encoder_ctl CELT_SET_LTP is replaced with CELT_SET_PREDICTION
which allows the caller to request that frames be independent.
2009-06-05 14:47:21 -04:00
Gregory Maxwell
dc67fa9a4c Handle malloc failure in mode_create gracefully without leaking memory. 2009-06-04 21:51:12 -04:00
Gregory Maxwell
1716999bbe Add paranoid checking for the validity of the encoder and the decoder
state before using it. Handle malloc failures for the encoder and
decoder setup gracefully and without leaks.
2009-06-04 21:42:53 -04:00
Gregory Maxwell
f3b44ef42c Add get_mode CTL for the encoder and decoder. 2009-06-03 13:37:45 -04:00
Jean-Marc Valin
9a44cde205 Removed support for band-per-band stereo_mode that was never really used 2009-06-02 20:21:53 -04:00
Jean-Marc Valin
7353203b81 Updating DISABLE_STEREO to the new stereo code (i.e. disabling more stuff) 2009-06-02 20:07:25 -04:00
Jean-Marc Valin
527db5c450 Adding a decision mechanism for turning folding on or off depending on the
signal characteristics
2009-06-02 07:56:19 -04:00
Jean-Marc Valin
e4c05a4d74 Making the modified transient code work with stereo as well 2009-05-30 10:09:06 -04:00
Jean-Marc Valin
aa9362564d New transient handling code that weights the MDCTs directly unless there's
a really big amplitude change, in which case the original time-domain window
is used.
2009-05-29 22:14:20 -04:00
Gregory Maxwell
c4b146c4ba Fixing the encoder's handling of no-folding; with folding enabled
the encoder could attempt to create folding-free short blocks which
is not permitted by the bitstream.
2009-05-26 21:56:27 -04:00
Gregory Maxwell
0ac2b2fe0b The change to FLOAT2INT16 in a8734e0f would break float input for
fixed point compilation because SCALEIN is a no-op in fixed point
mode but the float interface is still normally +/- 1.0.

This patch adds a seperate define for the scaling factor so people
can adjust it for unusual input levels.
2009-05-21 23:08:46 -04:00
John Ridges
454d1d0c21 This code does a very naive reset of the state. It is possible (even likely)
that I'm resetting more than is necessary, but I would have to know a lot
more about how CELT works to determine that.
2009-05-21 22:38:39 -04:00
Jean-Marc Valin
a8734e0fd9 Proper use of SCALEIN() as suggested by John Ridges 2009-05-21 22:29:09 -04:00
Gregory Maxwell
888d8ce939 VBR support. VBR API and VBR support in celtenc. 2009-05-21 22:23:25 -04:00
Gregory Maxwell
8842fdee21 Fixing stereo: Do not attempt to use more bits than are available.
This change breaks the bitstream.

Make the first frame out of the encoder an intra-frame. (While not required this may help
in the case that the decoder has old state laying around, and it shouldn't hurt)
2009-05-05 07:31:44 -04:00
Jean-Marc Valin
74f4e9f385 The intra decision is now made for the following frame, not the current one.
Also, setting transient shift to zero when not using short blocks (this causes a
failed assertion otherwise)
2009-05-02 23:37:48 -04:00
Jean-Marc Valin
32ec58cc3e Dynamically selecting intra energy based on energy variations from the previous
frame
2009-05-01 21:28:58 -04:00
Jean-Marc Valin
18a3b79d24 Add support for intra-coding of the coarse energy. 2009-05-01 19:58:55 -04:00
Jean-Marc Valin
a8be38a376 Apparently the 0b notation used for the flags isn't standard C. 2009-04-29 22:16:26 -04:00
Jean-Marc Valin
05ed03e6e3 New code for encoding the flags 2009-04-29 07:44:13 -04:00
Jean-Marc Valin
eafbdd5531 Making it easier to Torben to develop his new PLC code 2009-04-27 20:05:30 -04:00
Jean-Marc Valin
6db6cbd4f0 Making the "data" argument to celt_decode() const as pointed out by Bjoern
Rasmussen.
2009-04-11 22:01:20 -04:00
Jean-Marc Valin
d27e6e34a5 Cleanup: getting rid of some old bits of stereo code that are no longer useful 2009-03-29 22:29:52 -04:00
Jean-Marc Valin
ca53b7c919 Squashed commit of the following:
commit ea807b68678dd76175def2c5eb006c6bdb16679e
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Wed Mar 25 23:24:41 2009 -0400

    cleanup before merge

commit 73ad1a0202641be6a23903e464ece21fe332a131
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sat Mar 21 00:02:16 2009 -0400

    Some tuning of the new stereo

commit c05057eb57a7723045214a2f830fd561388ae48a
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Mar 15 19:56:11 2009 -0400

    fixed-point: atan2() converted

commit a8476cf8be55b0612d42df98d9807ca1335adfe3
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sat Mar 14 23:10:04 2009 -0400

    fixed-point: Getting the new stereo code working in fixed-point (still more
    work left)

commit 70a452761a5ce15700664e7167886dce5914cbd0
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Mon Mar 2 23:36:25 2009 -0500

    Coding left and right independently for lower bands

commit 4efd1e6385c7d036749080265a8d26668312b91b
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Mar 1 23:56:46 2009 -0500

    Removed the sqrt(C) from the normalisation, which simplifies a lot of things.

commit a4f3c5c60bc396bf644afa49b49e6b24ccf144f8
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Fri Feb 20 20:49:38 2009 -0500

    Better point stereo calculation when we don't encode the side anyway

commit f08525de4739f4017d19ec2e2022883deda8f826
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Thu Feb 19 19:43:09 2009 -0500

    Apparently, Timothy's calculations for fine energy allocation also apply
    to the quantisation of theta.

commit 6548cffc9d3f996b8a8dbfab982f0da0bc6c2dc2
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Thu Feb 19 07:35:24 2009 -0500

    Better handling of the "theta bits" and disabling the orthogonalize()

commit 7aa82c694967afa85dd30be8cc670663f98829fe
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Wed Feb 18 08:01:07 2009 -0500

    tuning the new stereo

commit c2b780a773de66fd9613c7cd54c09b705fe9ce45
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Feb 15 22:24:52 2009 -0500

    The new stereo coupling actually decodes properly now.

commit 85513c203d773bebcf0a6055f953170d563d890c
Author: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date:   Sun Feb 15 21:31:16 2009 -0500

    First attempt at a new "constrained" MS stereo scheme
2009-03-26 20:23:14 -04:00
Gregory Maxwell
54547f16d5 Miscellaneous comment, copyright notice, readme updates. 2009-02-16 19:52:02 -05:00
Jean-Marc Valin
28f0f65325 Preparing for version 0.5.2 2009-02-16 07:35:19 -05:00
Gregory Maxwell
520eeaee1a Simple check that application supplied packet length is not negative. 2009-02-09 01:33:21 -05:00
Gregory Maxwell
fea148f284 Additional copyright notices. 2009-02-03 23:09:52 -05:00
Jean-Marc Valin
aca0be91f4 Pitch now quantised at the band level, got rid of all the VQ code. 2009-01-13 23:04:12 -05:00
Jean-Marc Valin
77c80ce524 Moved the application of the pitch gain to (un)quant_bands(). This doesn't
change anything to the codec, but will make the next changes easier.
2009-01-13 20:48:30 -05:00
Gregory Maxwell
98046cadcf Add a SET_LTP call to allow on the fly activation/deactivation of the long term
predictor even in high complexity mode (LTP off is more loss robust), fix the
case where turning on LTP on a running stream can cause prediction against
bogus data by delaying the usage of the LTP until enough data has been encoded.
2008-12-13 21:31:38 -05:00
Gregory Maxwell
abe40f02a9 Minor pitch handling cleanups. 2008-12-13 01:31:32 -05:00
Gregory Maxwell
b0a73a0b1e Fix optional synthesis bug in fixed point mode. 2008-12-12 16:58:27 -05:00
Jean-Marc Valin
de1fd28740 Fixes a denormalisation issue occuring when multiple packets are lost and the
signal decays to "not quite zero"
2008-11-27 23:34:15 -05:00
Jean-Marc Valin
37ab9c6642 Bit of cleaning up and comments 2008-11-08 09:14:38 -05:00
Jean-Marc Valin
bc79991742 The fold bit can now be used by the encoder and decoder (encoder still needs
EXP_PSY)
2008-11-07 22:53:13 -05:00
Jean-Marc Valin
a2012d8dc5 experimental code for choosing whether to apply folding for the high bands 2008-11-05 21:54:37 -05:00
Jean-Marc Valin
c5f2a9d988 Latest psychoacoustics work -- still highly experimental 2008-10-26 22:00:26 -04:00
Jean-Marc Valin
8679a80ee2 Encoder now writes data directly in the user buffer 2008-10-18 07:44:35 -04:00
Jean-Marc Valin
dffd9449b5 Tonality estimation code 2008-10-15 07:29:58 -04:00
Jean-Marc Valin
b6f9061343 celt_encoder_ctl() is a bit more type-safe. 2008-10-05 22:39:13 -04:00
Wessel Lubberhuizen
33ba6cc6b6 fix stack handling 2008-10-03 07:09:29 -04:00
Gregory Maxwell
8259531160 API: Change celt_encode and celt_encode_float so that they take an optional synthesis parameter after the PCM input. If optional_synthesis is null the encoder will be able to save some computation. If optional_synthesis is non-null if will be used to write the encoder's expectation of the decoder's output. Synthesis may alias the input pcm, so calling the encoder with the same buffer twice will achieve the old behavior. Remove 'restrict' from the CTL prototype. 2008-09-30 23:32:35 -04:00
Jean-Marc Valin
c18fb1d031 Added celt_encoder_ctl() and CELT_SET_COMPLEXITY 2008-09-30 07:36:54 -04:00