libFLAC/fixed_intrin_sse2.c : Fix comments.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
autogen.sh : Use long names for options to autoreconf.
stream_encoder.c : Add apodization field to CompressionLevels struct.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
Add autoconf macro to check for the bswap16 intrinsic.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Use a configure check for bswap16 instead of gcc version #ifdefs.

Fixes a build problem on apple clang.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Clean up bswap32 autoconf macro.

Improve 'checking' message and don't hog the cache namespace.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Fix indenting on the bswap32 autoconf macro.

We generally prefer spaces to tabs.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Retune FLAC compression levels

This patch changes a the settings associated with compression
levels 6, 7 and 8. With this patch, -e is no longer used, but
instead apodization functions are added. This should improve
compression with at least 95% of all material while not changing
the speed much. Decoding ways, 6 and 8 stay the same, and 7 is
slowed a bit, which makes it as fast as 8.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Make test_compression a little more forgiving

The retune of compression levels makes this test fail. This is due
to a few approximations used in the encoder that determine which
LP coefficient should result in the smallest file. Differences are
usually very small, but in my case this resulted in compression
level 6 giving a 3 byte bigger file.

This patch lets the compression test pass even if the a compression
level results in a file that is up to 10 byte larger than the
previous level

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Update documentation for new compression presets

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
include/share/endswap.h : Fix usage of HAVE_BSWAP16.

The code was incorrectly using #ifndef on a value that was always defined
to a value of either 0 or 1.
libFLAC : Add more checks to partial_tukey and punchout_tukey windows.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
metadata_iterators.c : Set status when metadata itereator is not writable.

The status should be FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT.

Closes: http://sourceforge.net/p/flac/patches/50/
Improve description of encoding preset equivalents.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
libFLAC: fix more problems with new window functions

This fixes two problems with handling of out-of-bounds arguments
for the window functions, one of which involving an infinite loop

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
src/libFLAC/stream_decoder.c : Fix buffer read overflow.

This is CVE-2014-8962.

Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
examples/c/decode/file/main.c : Add extra error handling.

Michele Spagnuolo provided a file that initially had frames with two
channels but then had a frame with a single channel. This example
program only supports exactly two channels and previously had
insufficient validation.

Closes: https://sourceforge.net/p/flac/bugs/418/
Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
Rename Visual Studio solution files.

* FLAC-vs2010.sln -> FLAC.sln
* FLAC.sln -> FLAC-vs2005.sln
doc/html/changelog.html : Update for 1.3.1 release.
doc/html/changelog.html : Add attributions and fix a typo.