I'm not sure how this worked before, the the previous version
string fiddling commit ended up not defining OPUS_VERSION in
the autoconf build, so opus_get_version_string() returned
'unknown'.
Microsoft Visual Studio 2010 warns about 'C4146: unary minus
operator applied to unsigned type, result still unsigned'
because of the '&-sizeof(void*)' in align().
This commit works around the warning by casting the size_t
to int before negation.
Patch by Hauke, who reported the issue on the opus mailing
list. Reviewed by derf.
Previously we defined the release version string in configure.ac,
and overrode that with 'git describe --tags' if possible. This
made it difficult for non-autoconf builds to set their version
string correctly.
Instead we create, and check into version control, a file called
version.mk which defines OPUS_VERSION. The configure script reads
that file and uses it as a fallback if the git revision isn't available.
The expectation is that version.mk will be manually updated for
releases, just as the previous configure.ac version was. However,
since this is a simpler format, it is easier for alternate build
systems to use, reducing the number of places which must be updated.
Also removes the OPUS_MINOR_VERSION, etc. defines from config.h.
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.
We were installing every readable file in man/man3, but
only unstalling files matching opus_*.3. Some doxygen
versions construct manpage versions of the marked up
header files and directory index, which got left on the
system after 'make uninstall'.
I don't think the 'uninstall' target is widely used, it's
often broken and can easily break other software. However,
we rely on 'make distcheck' which does verify this issue.
Instead, only install the opus_*.3 manpages, which are the
core api documentation.
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.
Signed-off-by: Gregory Maxwell <greg@xiph.org>
silk_get_TOC is unused, unreachable, and not useful without some
packet pre-processing, but until we remove it it should be correct.
This was also reported by Mozilla.
We now have rates for each possible threshold. This also adds some
histeresis but it's not that useful for now because the effective rate
doesn't changes from frame to frame (unless one changes the target rate).
This change also has the side effect of lowering the intensity stereo
point for 64 kb/s to band 15 (instead of 16).
This prevents rate reduction due to channel correlation from increasing
by more than 0.25 bit/sample between two frames. This issue was observed
on r.flac where the frame following a transient would lose nearly
1 bit/sample
This only increases the average rate by about 1.5 kb/s, but it
restores the high quality of transients from 1.0. Also it
ensures that dynalloc can never starve other bands when used
aggressively.
1) Stereo saving was being too aggressive because it only considered the LF
and because the savings were multiplied by coded_bins rather than by
just the number of "side bins" below the intensity threshold
2) In the case of bandlimited signals, dynalloc would allocate way too many
bits to the last non-zero band. We now explicitly check for the last
band with a meaningful signal.
These issues were really obvious when encoding the decoded test01.mp3
because of the strong inter-channel correlation and (especially) the 16 kHz
lowpass used by the mp3 encoder.
The usage of restrict in include/opus_custom.h was missed
by the prior commit replacing this keyword with a macro.
Also fixes some prototype/function agreement with respect to
restrict.
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.