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.
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.
OPUS_EXPORT was conditionalized on OPUS_BUILD, so that symbols
are export based on public header declarations when building
opus as a library, but not when those headers are included in
other programmes. This doesn't address the case when the opus
source and its caller are both included in the same monolithic
build.
In that case we want to define OPUS_BUILD, to indicate that we
are compiling the codec source, but not export the symbols. To
support this, only define OPUS_EXPORT if it is not already defined.
This allows build scripts to -DOPUS_EXPORT and override the
platform-specific attribute decortation in opus_defines.h.
Based on a patch by Sergey Ulanov.
http://git.chromium.org/gitweb/?p=chromium/deps/opus.git;a=commitdiff;h=6304b9628cb7244e3cc78f740aeb6659562f1857
This avoids allocating any buffers on the stack that depend on the
total channel count.
Such buffers could easily exceed the size of the
NONTHREADSAFE_PSEUDOSTACK.
It also checks the frame_size argument in both the encoder and
decoder to avoid allocating large stack buffers for opus_encode()
calls that would fail anyway or opus_decode() calls that would
never use all that space anyway.
In particular we no longer document the default complexity because
we're not guaranteeing to keep the default value constant. In the
future the default may be lowered in order to keep the default
speed constant.
In addition to general reformatting and cleanup, this fixes a
couple of important mistakes:
- The arguments to OPUS_SET_FORCE_CHANNELS are now 1 and 2, not 0
and 1 (as they were when this was called OPUS_SET_FORCE_MONO).
- The default encoder mode is now constrained VBR, not unconstrained
VBR.
It also documents defaults for all the other parameters.
This implements an API used in future encoders to avoid dynalloc doing silly things
on periodic LSB patterns and to reduce the bitrate on near-silence.
We had previously advised people to -Drestrict on
non-C99 compilers, but this creates problems for
some of the MSVC headers. Instead this just
uses a macro and defines it sanely.
This is the less-surprising behavior and will hopefully
result in fewer corner case bugs (e.g. losing gain
after seeking). This commit also updates the documentation.
In places where an ignored return or a null-arg is a sure indication
of a bug add the GCC warning attributes. The null arg annotation
is not enable for Opus itself because it will cause the compiler
to optimize out some null checks. I don't trust our callers
quite that much.
Doxygen is smart enough to insert a period if the paragraph
before the @see directive, which starts a new section, doesn't
have one. Unfortunately it's not smart enough to convert a
comma to a period. So while the "description, @see foo" idiom
used for the CTL documentation scans well in the header file,
the Doxygen output end up with "description,.\n".
Minimal change to remove the offending commas.
We use macros to encapsulate the appropriate type and size
information for the different CTL requests, but the macros
still need to be used with the _ctl() function call and an
encoder or decoder instance structure. As such, just listing
the macro defines is confusing. Adding some examples outside
the OpusEncoder overview page should help with this.
Also document that OPUS_SET_APPLICATION can take
OPUS_APPLICATION_RESTRICTED_LOWDELAY.