Commit graph

3269 commits

Author SHA1 Message Date
Jean-Marc Valin
b08c4ca3f5 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
2013-05-05 02:31:38 -04:00
Jean-Marc Valin
1b72386a7c Initial surround code with new API
Conflicts:
	src/opus_multistream_encoder.c
2013-05-05 02:31:09 -04:00
Jean-Marc Valin
b042935693 Fixes missing initialization in OpusMSEncoder
Problem found using valgrind.
2013-05-05 02:22:06 -04:00
Jean-Marc Valin
1bf32bb5ac 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).
2013-04-23 02:41:28 -04:00
Jean-Marc Valin
f77410deb6 VBR bitrate calibration for variable duration.
Also fixes uninitialized value in previous commit.
2013-04-19 22:44:03 -04:00
Jean-Marc Valin
3252bf2a68 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)
2013-04-19 03:20:40 -04:00
Jean-Marc Valin
a8783a15b4 Converts the analysis to ALLOC() 2013-04-15 15:49:40 -04:00
Jean-Marc Valin
c37834b27e 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.
2013-04-15 02:53:09 -04:00
Gregory Maxwell
2fb4f5c439 Random complexity in the encoder tests. 2013-04-05 19:16:58 -07:00
Timothy B. Terriberry
a8f04b23f9 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.
2013-03-18 14:42:44 -07:00
Jean-Marc Valin
74d43f0a36 Minor soft clipping doc fix 2013-03-18 17:06:43 -04:00
Ralph Giles
99e8a9352b Remove -Wdeclaration-after-statement.
This causes warnings with the ALLOC() macro.
2013-03-12 22:57:00 -07:00
Jean-Marc Valin
c5e04e4aa4 Makes bandwidth detection less aggressive.
The original code was causing parts of a sine sweep to be completely dropped
due to the 300 Hz margin and the hysteresis. Also, fixes scaling for the
analysis downmix when the input is 16-bit PCM.
2013-03-12 11:24:53 -04:00
Jean-Marc Valin
f982b84d1e Fixes a minor glitch on SILK bandwidth changes
We weren't doing the prefilling for SILK->SILK transitions.
2013-03-11 17:13:34 -04:00
Ralph Giles
42f39c547b Add -Wdeclaration-after-statement.
We keep accidentally adding these which break the -pedantic build,
so complain about it in the normal build.

Also de-duplicate the warning list.
2013-03-11 10:59:13 -07:00
Koen Vos
933a2754fc High-band attenuation tuning for hybrid mode
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2013-03-11 13:43:17 -04:00
Jean-Marc Valin
5a6e7c8b2f Fixes pseudo-stack 2013-03-11 13:41:11 -04:00
Taihei Momma
22345ef16e Fixes OPUS_SET_EXPERT_FRAME_DURATION_REQUEST for multi-stream
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2013-03-11 13:39:26 -04:00
Robert Meakins
097fd4b111 Fixes C90 issues for obsolete compilers
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
2013-03-11 13:39:17 -04:00
Jean-Marc Valin
d865fe6187 Adds stereo width computation
Using this to change the encoder based on mono/stereo rather than looking
at the number of input channels.
2013-03-11 11:35:10 -04:00
Jean-Marc Valin
f96fc8cc83 Merge branch 'exp_analysis'
Conflicts:
	celt/celt_encoder.c
2013-03-08 12:29:53 -05:00
Jean-Marc Valin
fa43c770e0 Making CELT stereo<->mono transitions gradual
This not only avoids sudden changes in audio quality, but also increases
quality when we don't have enough bits to code a wide stereo image.
2013-03-08 11:35:15 -05:00
Jean-Marc Valin
f55b0eaca5 Documentation fixes
Improved version of:
f44b28ab56
2013-03-07 18:17:52 -05:00
James Zern
a41a585f35 test_opus_decode: force integer constants unsigned
Quiets:
warning: this decimal constant is unsigned only in ISO C90

when building with e.g., gcc -m32 -std=gnu90
2013-03-05 09:18:07 -08:00
Jean-Marc Valin
d9aa6e046b Oops, fixed API name from previous commit 2013-03-01 16:07:02 -05:00
Jean-Marc Valin
32c4a0c96e Applies soft-clipping to the int decoder API.
opus_decode() and opus_multistream_decode() now apply soft clipping
before converting to 16-bit int. This should produce better a higher
quality result than hard clipping like we were doing before. The _float()
API isn't affected, but the clipping function is exported so users can
manually apply the soft clipping.
2013-03-01 15:23:01 -05:00
Jean-Marc Valin
73142b100a Makes the speech/music probability estimation mode conservative
This is done using an adaptive beta and an estimate of the speech
and music detection confidence
2013-02-28 15:30:51 -05:00
Jean-Marc Valin
742aac1056 Adds silence probability to speech/music detector
Avoids biasing the decision when it's all silence/noise.
2013-02-22 16:44:56 -05:00
Jean-Marc Valin
74f36b56dd oops s/IMAX/IMIN/ 2013-02-20 22:32:19 -05:00
Jean-Marc Valin
51f4a32ec2 Adds support for delayed decision
Variable duration option renamed to OPUS_SET_EXPERT_FRAME_DURATION,
with new API.
Also moves up the analysis to avoid having to do int->float conversion
on large buffers.
2013-02-20 04:08:34 -05:00
Jean-Marc Valin
69c3dcd105 Fixes a bug introduced in 851f803 2013-02-19 03:42:18 -05:00
Jean-Marc Valin
3ecd9c20cb Fixes two bandwidth decision issues
1) In cases where the SILK desired bandwidth went down, then quickly up, we
count get stuck in a mode with the LP variation going the wrong way.
2) Bandwidth detection can no longer force SILK to go below wideband to
avoid switches that require redundancy.
2013-02-19 00:42:15 -05:00
Jean-Marc Valin
851f8033f6 Moves mono downmixing and upsampling to the compute_mdcts() 2013-02-18 01:43:43 -05:00
Jean-Marc Valin
541a472ff6 Adds code to revise the transient decision using the band energy
Detects a transient when the average band energy jumps by more than 6 dB
between two consecutive frames. This fixes some undetected transients on
Gainless' Muse_Breaks_Rmx sample.
2013-02-17 21:21:30 -05:00
Jean-Marc Valin
10a34a5dd6 Making multistream variable duration work for both the float and int API 2013-02-10 23:53:44 -05:00
Jean-Marc Valin
bb43b8b69d No need for extra_buffer anymore 2013-02-10 23:53:44 -05:00
Jean-Marc Valin
95561be6de Better handling of the multistream bitrate
Now supports OPUS_AUTO and OPUS_BITRATE_MAX
2013-02-10 23:53:43 -05:00
Jean-Marc Valin
7448366046 Multistream support for variable frame duration
Also fixes a bug with stereo streams where the initial memory was only
using the left channel.
2013-02-10 23:53:43 -05:00
Jean-Marc Valin
f548a5a35d Makes variable framesize less aggressive at lower rates 2013-02-10 23:53:43 -05:00
Jean-Marc Valin
8547964815 Re-enable analysis for 40- and 60-ms frames 2013-02-10 23:53:27 -05:00
Jean-Marc Valin
49583ed672 First attempt at varying the frame size depending on the audio (float only)
The search is based on minimizing the bitrate increase due to transients
by considering we can reduce the "transient boost" by reducing the frame
size, at the cost of increasing the normal overhead.
2013-02-10 00:18:08 -05:00
Jean-Marc Valin
e85a6f5cbe Makes opus_demo rubust to the encoder using variable frame duration
Also, the encode+decode mode now produces an output of the same size
as the original.
2013-02-10 00:15:49 -05:00
Jean-Marc Valin
2a5f0565b8 Running transient_analysis() even for 2.5 ms frames
This means 2.5 ms frames can now use a higher bitrate for transients.
2013-02-10 00:15:49 -05:00
Jean-Marc Valin
48ac122141 Makes analysis usable for all frame sizes 2013-02-10 00:15:49 -05:00
Jean-Marc Valin
7ebacf430a Moves analysis to the beginning of opus_encode() 2013-02-10 00:05:46 -05:00
Jean-Marc Valin
6044907c82 Fixes a SILK fixed-point encoder issue reported by Cliff Parris <cliff@espico.com> 2013-02-07 15:31:30 -05:00
Jean-Marc Valin
e51a3f33cf Fixes a minor CELT->SILK switching glitch in the decoder
By not reinitializing the stereo state during a switch, the old stereo
memory would create a false impulse (i.e. single sample) in the decoded audio.
This change affects the normative part of the decoder. Fortunately,
the modified decoder is still compliant with the specification because
it still easily passes the testvectors. For example, for the float decoder
at 48 kHz, the opus_compare (arbitrary) "quality score" changes from
from 99.9333% to 99.925%.
2013-02-06 23:48:09 -05:00
Jean-Marc Valin
61e9eb15cc Adds a ramp up in the SILK prefill
This improves quality of CELT->SILK switches by not having the SILK encoder
attempt to encode a discontinuity. Overall, it's a small PQ improvement,
confirmed by some listening.
2013-02-06 18:10:51 -05:00
Jean-Marc Valin
4ed7e48e1d Fixes a hybrid stereo encoder issue
This was causing periodic glitches in the right channel in hybrid mode.
2013-02-05 01:32:52 -05:00
Ralph Giles
2fd3d0aa27 Split mapping families into sections and add dowmix matrices.
The channel mapping family nested lists were hard to read.
Promoting each family description to a subsection makes it
more clear where one is in the document.

Also add suggested downmix matricies. These are what we're
currently using in opus-tools, opusfile, and Firefox.
Ascii-art matrices in 69 columns is hard.
2013-01-16 16:30:55 -08:00