Commit graph

293 commits

Author SHA1 Message Date
Jean-Marc Valin
4834c92e2b More simplifications from denorm pitch 2009-09-28 19:17:34 -04:00
Jean-Marc Valin
92ae37027f enabling denorm pitch only at low bit-rate 2009-09-16 07:57:17 -04:00
Jean-Marc Valin
ab220aa212 denorm pitch works in fixed-point (though there's still some floats left) 2009-09-15 22:38:40 -04:00
Jean-Marc Valin
4c77ea96d0 doing pitch in denormalized domain 2009-09-14 22:51:55 -04:00
Jean-Marc Valin
515136a3f1 removed unused #ifdefs 2009-09-13 20:15:24 -04:00
Jean-Marc Valin
0f0da999ae Better fading for PLC: no fading for the first loss, muting after 6 2009-08-12 21:35:36 -04:00
Jean-Marc Valin
5a70097d79 C89 and 16-bit fixes 2009-08-08 13:23:03 -04:00
Jean-Marc Valin
e610864c74 This fixes a VBR bug introduced by raw bits. We should not write any raw
bit before the rate is decided (otherwise they'll end up at the wrong place)
and we have to shrink the byte buffer before writing raw bits.
2009-08-01 23:05:47 +02:00
Jean-Marc Valin
91f07dc125 Changing some code to use BITRES directly instead of its value. 2009-07-25 20:42:24 -04:00
Jean-Marc Valin
c08be4485b Implemented "raw bits"
Making it so all the information encoded directly with ec_enc_bits() gets
stored at the end of the stream, without going through the range coder. This
should be both faster and reduce the effects of bit errors.

Conflicts:

	tests/ectest.c
2009-07-23 07:33:24 -04:00
Jean-Marc Valin
cb8780ca96 C89 compatibility fixes for pseudo-stack mode.
Conflicts:

	libcelt/celt.c
2009-07-20 23:40:35 -04:00
Gregory Maxwell
0719f6fc25 This patch makes it safe to call the encode / decode functions with a NULL pointer in place of the pcm buffer. 2009-07-12 01:01:33 -04:00
Jean-Marc Valin
e6d832a721 Allowing frame sizes up to 1024, with pitch enabled only up to 512 2009-07-08 22:21:31 -04:00
Jean-Marc Valin
ece2cfa2d2 removed useless comments 2009-07-04 22:46:38 -04:00
Gregory Maxwell
17ea4b7e2d For some frame sizes there can be 5 shorts in a frame.
Correct an out of bounds access in this case.
2009-06-30 11:42:01 -04:00
Gregory Maxwell
a80958b025 Note some more platforms where float-approx is tested, fix a bug in the prediction ctl,
and remove some dead code from bands.c.
2009-06-29 12:48:57 -04:00
Jean-Marc Valin
2014ca380e Minor simplification to the transient code 2009-06-18 23:33:04 -04:00
Jean-Marc Valin
5b9b51bc44 Forced intra now overrides intra avoidance at low rate. Also, using the number
of bands as criterion for auto-intra disabling.
2009-06-16 22:27:12 -04:00
Jean-Marc Valin
9dff02188c Minor stuff: preventing float underflow in celt_exp2(), preventing the use of
intra energy for low bitrates, and a bit of very high bitrate tuning
2009-06-15 22:40:06 -04:00
Jean-Marc Valin
08a82ffb45 More de-interleaving: denormalised MDCT no longer stored with interleaved
channels. Fixed two stereo bugs in the process: one in the handling of
mdct_weight_shift and one in the PLC.
2009-06-14 14:20:44 -04:00
Jean-Marc Valin
83c26e713c Now storing the band energies in de-interleaved format when doing stereo 2009-06-14 09:19:51 -04:00
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