flac.git
5 years agoAdd project files for Visual Studio 2010 and later.
Erik de Castro Lopo [Sun, 6 Jul 2014 10:48:26 +0000 (20:48 +1000)]
Add project files for Visual Studio 2010 and later.

Also allows building for x86-64 Windows.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC : Remove FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap().
Erik de Castro Lopo [Sun, 6 Jul 2014 10:27:28 +0000 (20:27 +1000)]
libFLAC :  Remove FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap().

This function was un-used because it showed no speed improvement over the
C version. As a result the bitreader_read_from_client_() function can be
made static again.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC : Remove FLAC__precompute_partition_info_sums_32bit_asm_ia32_().
Erik de Castro Lopo [Sun, 6 Jul 2014 10:20:58 +0000 (20:20 +1000)]
libFLAC : Remove FLAC__precompute_partition_info_sums_32bit_asm_ia32_().

This function offer no speed up from the C version of the function and were
commented out after the release of 1.3.0. We will now drop them completely.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agostream_encoder : Improve selection of residual accumulator width
Miroslav Lichvar [Thu, 19 Jun 2014 11:04:33 +0000 (13:04 +0200)]
stream_encoder : Improve selection of residual accumulator width

In the precompute_partition_info_sums_ function, instead of selecting
64-bit accumulator when the signal bps is larger than 16, revert to the
original approach based on partition size, but make room for few extra
bits to not overflow with unusual signals where the average residual
magnitude may be larger than bps.

It slightly improves the performance with standard encoding levels and
16-bit files as the 17-bit side channel can still be processed with the
32-bit accumulator and correctly selects the 64-bit accumulator with
very large 16-bit partitions.

This is related to commits 6f7ec60c and 187e596e.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agotest_libFLAC/test_libFLAC.vcproj : One more CPU_IS_LITTLE_ENDIAN fix.
Erik de Castro Lopo [Thu, 3 Jul 2014 23:02:17 +0000 (09:02 +1000)]
test_libFLAC/test_libFLAC.vcproj : One more CPU_IS_LITTLE_ENDIAN fix.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/ : Remove un-needed MSVC6 workaround.
Erik de Castro Lopo [Thu, 3 Jul 2014 22:31:57 +0000 (08:31 +1000)]
src/ : Remove un-needed MSVC6 workaround.

MSVC6 was not able to cast from a uint64_t to a double and this
commit removes some #ifdef hackery designed to work around this
problem.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agotest_libFLAC/endswap.c : Add casts to prevent compiler warnings.
Erik de Castro Lopo [Thu, 3 Jul 2014 10:24:33 +0000 (20:24 +1000)]
test_libFLAC/endswap.c : Add casts to prevent compiler warnings.

5 years agotest_libFLAC/test_libFLAC.vcproj : Add define for CPU_IS_LITTLE_ENDIAN.
Erik de Castro Lopo [Thu, 3 Jul 2014 09:19:08 +0000 (19:19 +1000)]
test_libFLAC/test_libFLAC.vcproj : Add define for CPU_IS_LITTLE_ENDIAN.

5 years agoFix bswap16 issue on Debian 6.
Ralph Giles [Wed, 2 Jul 2014 21:12:38 +0000 (14:12 -0700)]
Fix bswap16 issue on Debian 6.

Versions of GCC prior to 4.8 didn't provide an implementation
of __builtin_bswap16 on x86_64. Detect those versions and
supply a fallback implementation. A cleaner fix would be
to detect bswap16 independently of bswap32 in configure
and handle them separately.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agotest_libFLAC : Fix Windows build after addidion of endian tests.
Erik de Castro Lopo [Wed, 2 Jul 2014 19:38:09 +0000 (05:38 +1000)]
test_libFLAC : Fix Windows build after addidion of endian tests.

* Use "share/compat.h" instead of <stdint.h>.
* Update test_libFLAC.vcproj project file.
* Update Makefile.lite build system.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/flac/main.c : Improve raw format help text help.
Erik de Castro Lopo [Wed, 2 Jul 2014 19:35:55 +0000 (05:35 +1000)]
src/flac/main.c : Improve raw format help text help.

The --endian and --sign options aren't just for raw input, but also
for raw output.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/flac/encode.c : Fix compression failure warning when encoding from stdin.
Erik de Castro Lopo [Wed, 2 Jul 2014 08:33:30 +0000 (18:33 +1000)]
src/flac/encode.c :  Fix compression failure warning when encoding from stdin.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agotest_libFLAC/md5.c : Fix the tests.
Erik de Castro Lopo [Tue, 1 Jul 2014 10:00:07 +0000 (20:00 +1000)]
test_libFLAC/md5.c : Fix the tests.

The previous version of this test worked on amd64 and powerpc64 but
failed on armhf. Investigation show that the previous version of the
test data was generated for a case where the ARRAY_LEN macro was
exploiting undefined behaviour.
Fix was ditching the ARRAY_LEN macro and then recalculating the
target data.

5 years agotest_libFLAC/endswap.c : Improvements.
Erik de Castro Lopo [Tue, 1 Jul 2014 08:03:08 +0000 (18:03 +1000)]
test_libFLAC/endswap.c : Improvements.

* Print endian-ness of test host.
* Replace ugly macro with C code.
* Add tests for H2LE_16 and H2LE_32 macros.

5 years agosrc/test_libFLAC : Add tests for end swap macros.
Erik de Castro Lopo [Mon, 30 Jun 2014 10:26:39 +0000 (20:26 +1000)]
src/test_libFLAC : Add tests for end swap macros.

5 years agosrc/flac/decode.c : Add comment about ubuf union.
Erik de Castro Lopo [Mon, 30 Jun 2014 09:55:21 +0000 (19:55 +1000)]
src/flac/decode.c : Add comment about ubuf union.

5 years agoinclude/share/endswap.h : Fix fallback ENDSWAP_16 macro.
Erik de Castro Lopo [Sun, 29 Jun 2014 20:28:39 +0000 (06:28 +1000)]
include/share/endswap.h : Fix fallback ENDSWAP_16 macro.

5 years agosrc/flac/encode.c : Fix cast-align warning on ARM systems.
Erik de Castro Lopo [Sun, 29 Jun 2014 12:30:36 +0000 (22:30 +1000)]
src/flac/encode.c : Fix cast-align warning on ARM systems.

Use the union of pointers trick again.

5 years agolibFLAC/md5: Fix for cast-align warnings on ARM.
Erik de Castro Lopo [Sun, 29 Jun 2014 11:52:06 +0000 (21:52 +1000)]
libFLAC/md5: Fix for cast-align warnings on ARM.

Rather than the buffer into format_input_() as a FLAC__byte pointer, pass
it as a pointer to a union of three pointers, one each for for FLAC__byte,
FLAC__int16 and FLAC_int32.
This should have zero measurable performance impact.

5 years agolibFLAC/md5.c : Massive refactoring of format_input_ function.
Erik de Castro Lopo [Sun, 29 Jun 2014 10:21:52 +0000 (20:21 +1000)]
libFLAC/md5.c : Massive refactoring of format_input_ function.

This refactoring is in preparation for fixing the cast-align warning when
compiling on ARM (and possibly others). Testing on stereo 16 bit files
suggests that the difference between the performance of this code and the
old code is negligible (tested only on amd64/linux).

5 years agoinclude/share/endswap.h : Add endswapping of 16 bit values.
Erik de Castro Lopo [Sun, 29 Jun 2014 10:19:59 +0000 (20:19 +1000)]
include/share/endswap.h : Add endswapping of 16 bit values.

Also add macros H2LE_16 and H2LE_32, which do host to little-endian
swapping of 16 and 32 bit values respectively.

5 years agolibFLAC/bitmath : Restore an ASSERT that was removed some time after 1.2.1.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:59:10 +0000 (21:59 +1000)]
libFLAC/bitmath : Restore an ASSERT that was removed some time after 1.2.1.

Restore a FLAC__ASSERT() to bitmath functions FLAC__bitmath_ilog2 and
FLAC__bitmath_ilog2_wide functions. This prevents the return of an
"undefined" value.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC/lpc_intrin_sseN.c : Disambiguate macro names.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:55:25 +0000 (21:55 +1000)]
libFLAC/lpc_intrin_sseN.c : Disambiguate macro names.

Previously, the files lpc_intrin_sse2.c and lpc_intrin_sse41.c both defined
macros RESIDUAL_RESULT and DATA_RESULT. This situation made it impossible
to merge these files which we may do at some stage.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC: CPUID detecion improvements.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:50:09 +0000 (21:50 +1000)]
libFLAC: CPUID detecion improvements.

According to docs, it's incorrect to just call CPUID with EAX=1.
One must to ensure that this value is supported.

CPUs that don't support CPUID level 1 are very old, but...
if FLAC tests CPUID presence it should also test CPUID level support.

Also the function FLAC__cpu_have_cpuid_asm_ia32 was simplified
according to the docs at Intel website and in Wikipedia.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoflac: Fix channel order for mono files.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:45:50 +0000 (21:45 +1000)]
flac: Fix channel order for mono files.

* The default channel mask for mono files was 0x0001 (front left) but it
  makes more sense to use 0x0004 (front center) for such files.

* Also FLAC will accept not only mono WAV files with 0x0001 mask, but also
  with 0x0002 (requested at https://sourceforge.net/p/flac/bugs/390/)
  and 0x0004 (e.g. SoX creates mono files with this mask).

* The comment about channel support was updated.

* The error message
     "Use --channel-map=none option to store channels in current order; FLAC files
     must also be decoded with --channel-map=none to restore correct order."
  is misleading: FLAC never changes the order of channels.
  Decoding with this options also sets the channel mask of the resulting WAV
  file to 0. Without this option the mask is equal to the value of
  WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoflac: Fix encoder and decode progress messages with --ogg.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:40:59 +0000 (21:40 +1000)]
flac: Fix encoder and decode progress messages with --ogg.

Problem discussed here:

   http://lists.xiph.org/pipermail/flac-dev/2014-June/004808.html

The values for the interval between two updates (e->stats_mask,
e->stats_frames_interval) were set ~10 years ago, and it is small
for current CPUs. It was now been increased too (0x3f -> 0xff, etc).
The update interval is still less than 1 second.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoflac : Fix handling of raw input option.
Erik de Castro Lopo [Sat, 28 Jun 2014 11:35:40 +0000 (21:35 +1000)]
flac : Fix handling of raw input option.

FLAC was silently ignoring options for raw input for encoding mode (but
prints an error and aborts when _de_coding).

This can lead to bug reports such as https://sourceforge.net/p/flac/bugs/389/

FLAC now prints a message about options misuse for encoding mode.

Help messages were also updated.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agotest_libFLAC/md5.c: Add tests for MD5 calculation.
Erik de Castro Lopo [Fri, 27 Jun 2014 12:02:54 +0000 (22:02 +1000)]
test_libFLAC/md5.c: Add tests for MD5 calculation.

Test all channel counts from 1 to 8 inclusive and all byte widths
from 1 to 4 inclusive.

5 years agoAUTHORS : Tweaks.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:52:52 +0000 (09:52 +1000)]
AUTHORS : Tweaks.

5 years agoflac: Fix padding for --replay-gain option.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:32:57 +0000 (09:32 +1000)]
flac: Fix padding for --replay-gain option.

Patches ported from the flac 1.2.1 maintenance branch.

    http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/flac/encode.c?
    r1=1.194&r2=1.194.2.1&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH

    http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/flac/main.c?
    r1=1.169&r2=1.169.2.1&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agostream_decoder : Two read_metadata() fixes from 1.2.1 maintenance branch.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:25:25 +0000 (09:25 +1000)]
stream_decoder : Two read_metadata() fixes from 1.2.1 maintenance branch.

* Fix leaks in read_metadata_() that could occur because of read errors or
  malformed streams.
    http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/libFLAC/
    stream_decoder.c?
    r1=1.147&r2=1.147.2.1&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH

* Fix metadata block initialization bug in read_metadata_().
    http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/libFLAC/
    stream_decoder.c?
    r1=1.147.2.1&r2=1.147.2.2&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoREADME updates.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:21:05 +0000 (09:21 +1000)]
README updates.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agotest/test_replaygain.sh : Update tests after work aroind for GCC bug.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:19:59 +0000 (09:19 +1000)]
test/test_replaygain.sh : Update tests after work aroind for GCC bug.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoUnderscore fixes.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:17:26 +0000 (09:17 +1000)]
Underscore fixes.

* Replace _declspec with __declspec.
* Replace __wgetmainargs_ with __wgetmainargs_t and __wgetmainargs
  with wgetmainargs because identifiers with leading underscores are
  reserved for the compiler.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoUpdate URLs as nedeed.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:12:06 +0000 (09:12 +1000)]
Update URLs as nedeed.

Sourceforge.net links updated as nedeed with some of them
being changed to point to xiph.org/flac.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoCorreections for comments.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:10:28 +0000 (09:10 +1000)]
Correections for comments.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoRemove un-needed code.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:08:47 +0000 (09:08 +1000)]
Remove un-needed code.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoFix VS project file for iffscan.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:07:34 +0000 (09:07 +1000)]
Fix VS project file for iffscan.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoreplaygain_analysis: Add include guard for <stdint.h>.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:06:00 +0000 (09:06 +1000)]
replaygain_analysis: Add include guard for <stdint.h>.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoVcprojs : Remove include/share from include paths.
Erik de Castro Lopo [Fri, 27 Jun 2014 23:03:54 +0000 (09:03 +1000)]
Vcprojs : Remove include/share from include paths.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/flac/decode.c : Fix a cast-align warning from GCC.
Erik de Castro Lopo [Fri, 27 Jun 2014 11:58:26 +0000 (21:58 +1000)]
src/flac/decode.c : Fix a cast-align warning from GCC.

The old code was creating an array of FLAC__int8, and then casting
that to a set of signed and unsigned 16 and 32 bit integers. This
was replaced with a single union containing all the requred array.

This solution means that there are fewer pointer casts and actually
gives the compiler more information with which to generate fast code.

5 years agoAUTHORS : Update and add contributors.
Erik de Castro Lopo [Fri, 27 Jun 2014 10:11:18 +0000 (20:11 +1000)]
AUTHORS : Update and add contributors.

5 years agoFurther updates to the Makefile.lite build system.
Evan Ramos [Thu, 26 Jun 2014 22:25:48 +0000 (17:25 -0500)]
Further updates to the Makefile.lite build system.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agoFix Makefile.lite build system on Linux.
Erik de Castro Lopo [Thu, 26 Jun 2014 09:18:29 +0000 (19:18 +1000)]
Fix Makefile.lite build system on Linux.

5 years ago.gitignore : Tweaked.
Erik de Castro Lopo [Thu, 26 Jun 2014 09:02:39 +0000 (19:02 +1000)]
.gitignore : Tweaked.

5 years agoUpdate Makefile.lite build system.
Evan Ramos [Mon, 23 Jun 2014 21:24:49 +0000 (16:24 -0500)]
Update Makefile.lite build system.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agoreplaygain_analysis : Rename float_t -> flac_float_t.
Erik de Castro Lopo [Tue, 24 Jun 2014 11:00:58 +0000 (21:00 +1000)]
replaygain_analysis : Rename float_t -> flac_float_t.

There were a number of reports that float_t clashed with a type
defined in Linux system header files.

5 years agoMakefile.ams : Drop passing of include/share as an include directory.
Erik de Castro Lopo [Mon, 16 Jun 2014 04:23:50 +0000 (14:23 +1000)]
Makefile.ams : Drop passing of include/share as an include directory.

Some files needed to be updated to incude "share/xxx.h" instead of
"xxx.h".

Suggested-by: lvqcl <lvqcl.mail@gmail.com>
5 years agoreplaygain_analysis : Switch to standard C sized integer types.
Erik de Castro Lopo [Sun, 15 Jun 2014 21:24:43 +0000 (07:24 +1000)]
replaygain_analysis : Switch to standard C sized integer types.

5 years agoregainplay_analysis : Work around GCC optimizer bug.
Erik de Castro Lopo [Sun, 15 Jun 2014 10:32:45 +0000 (20:32 +1000)]
regainplay_analysis : Work around GCC optimizer bug.

Discussion: http://lists.xiph.org/pipermail/flac-dev/2014-June/004720.html
Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoRevert "Replace FLAC__CPU_X86_64 with FLaC__CPU_X86_64."
Erik de Castro Lopo [Sun, 15 Jun 2014 10:29:34 +0000 (20:29 +1000)]
Revert "Replace FLAC__CPU_X86_64 with FLaC__CPU_X86_64."

This reverts commit 151739921b74fbf31420358a5fbeb094efa017ed.

This patch only when part way to replace all FLAC_* with FLaC_*
and its really not worth going all the way.

5 years agoReplace FLAC__CPU_X86_64 with FLaC__CPU_X86_64.
Erik de Castro Lopo [Sun, 1 Jun 2014 07:31:02 +0000 (17:31 +1000)]
Replace FLAC__CPU_X86_64 with FLaC__CPU_X86_64.

Previous autorconf versions had problems with variable begining witj
'FLAC_' (autoconf uses 'AC_').

Reported-by: lvqcl <lvqcl.mail@gmail.com>
5 years agosrc/ : Fix two typos.
Erik de Castro Lopo [Sun, 1 Jun 2014 07:29:32 +0000 (17:29 +1000)]
src/ : Fix two typos.

* 'norrmal' -> 'normal'.
* 'fames' -> 'frames'.

Reported-by: lvqcl <lvqcl.mail@gmail.com>
5 years agoconfigure.ac : Add -fvisibility=hidden to OSX build.
Erik de Castro Lopo [Sun, 25 May 2014 09:42:53 +0000 (19:42 +1000)]
configure.ac : Add -fvisibility=hidden to OSX build.

Patch-from : Ozkan Sezer <sezeroz@gmail.com>

5 years agoreplaygain_synthesis.c : Replace an int64_t/int32_t operation with a shift.
Erik de Castro Lopo [Sun, 18 May 2014 03:40:15 +0000 (13:40 +1000)]
replaygain_synthesis.c : Replace an int64_t/int32_t operation with a shift.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/share/replaygain_synthesis/ : Remove old fast float math hack.
Erik de Castro Lopo [Sun, 18 May 2014 03:18:14 +0000 (13:18 +1000)]
src/share/replaygain_synthesis/ : Remove old fast float math hack.

Old code was for the Intel compiler, had no appreciable performance benefits
and doesn't actually work with current version of that compiler.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoRemove Monkey's Audio from FLAC.sln.
Erik de Castro Lopo [Wed, 14 May 2014 11:57:05 +0000 (21:57 +1000)]
Remove Monkey's Audio from FLAC.sln.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoPurge src/monkeys_audio_utilities/ tree.
Erik de Castro Lopo [Wed, 14 May 2014 11:48:03 +0000 (21:48 +1000)]
Purge src/monkeys_audio_utilities/ tree.

Monkey's Audio Utilities seem to have been dead for some time.

5 years agolibFLAC/ : Refactoring and add comments.
Erik de Castro Lopo [Wed, 14 May 2014 11:27:31 +0000 (21:27 +1000)]
libFLAC/ : Refactoring and add comments.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoreplaygain_synthesis.h : Fix FLAC_SHARE__MAX_SUPPORTED_CHANNELS.
Erik de Castro Lopo [Sun, 11 May 2014 10:24:27 +0000 (03:24 -0700)]
replaygain_synthesis.h : Fix FLAC_SHARE__MAX_SUPPORTED_CHANNELS.

Was previously hard coded as 2 when it should be FLAC__MAX_CHANNELS.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/libFLAC/memory.c : Wrap inclusion of <stdint.h> in #ifdef.
Erik de Castro Lopo [Sun, 11 May 2014 10:06:45 +0000 (03:06 -0700)]
src/libFLAC/memory.c : Wrap inclusion of <stdint.h> in #ifdef.

Lack of the #ifdef was causing problems on VS2008.

5 years agosrc/flac/decode.c : Decode WAVEFORMATEXTENSIBLE_CHANNEL_MASK.
Erik de Castro Lopo [Sun, 27 Apr 2014 19:10:12 +0000 (05:10 +1000)]
src/flac/decode.c : Decode WAVEFORMATEXTENSIBLE_CHANNEL_MASK.

When decoding, read the contents of the WAVEFORMATEXTENSIBLE_CHANNEL_MASK
tag and write write the channel mask to the WAV file.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC/stream_encoder.c : Fix if else wibble.
Erik de Castro Lopo [Tue, 15 Apr 2014 08:36:40 +0000 (18:36 +1000)]
libFLAC/stream_encoder.c : Fix if else wibble.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/flac/utils.c : Fix compile guard for ioctl().
Erik de Castro Lopo [Tue, 15 Apr 2014 08:31:58 +0000 (18:31 +1000)]
src/flac/utils.c : Fix compile guard for ioctl().

5 years agoAdd files missing from commit 93f6109c9016.
Erik de Castro Lopo [Fri, 11 Apr 2014 21:13:08 +0000 (07:13 +1000)]
Add files missing from commit 93f6109c9016.

5 years agoAdd intrinsics version of two lpc functions.
Erik de Castro Lopo [Thu, 10 Apr 2014 20:21:09 +0000 (06:21 +1000)]
Add intrinsics version of two lpc functions.

Functions:
- FLAC__fixed_compute_best_predictor
- FLAC__fixed_compute_best_predictor_wide

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoSuppress MSVS warnings when compiling for x86-64.
Erik de Castro Lopo [Thu, 10 Apr 2014 20:18:47 +0000 (06:18 +1000)]
Suppress MSVS warnings when compiling for x86-64.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoUse _M_X64 instead of _WIN64.
Erik de Castro Lopo [Thu, 10 Apr 2014 20:16:32 +0000 (06:16 +1000)]
Use _M_X64 instead of _WIN64.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoshare/compat.h : Remove duplicate flac_stat definition.
Erik de Castro Lopo [Thu, 10 Apr 2014 20:14:37 +0000 (06:14 +1000)]
share/compat.h : Remove duplicate flac_stat definition.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoFix clang compiler warnings.
Erik de Castro Lopo [Wed, 9 Apr 2014 07:56:13 +0000 (17:56 +1000)]
Fix clang compiler warnings.

These were most arising from -Wenum-conversion where an enum of
one type was being assigned to a variable on another.

Originally reported by Lenny Maiorani <lenny@colorado.edu> on the
flac-dev mailing list.

5 years agoconfigure.ac : Allow -Werror to be enabled when using clang.
Erik de Castro Lopo [Tue, 8 Apr 2014 10:48:13 +0000 (20:48 +1000)]
configure.ac : Allow -Werror to be enabled when using clang.

5 years agolibFLAC/cpu.c : Bundle of minor fixes.
Erik de Castro Lopo [Thu, 27 Mar 2014 08:30:43 +0000 (19:30 +1100)]
libFLAC/cpu.c : Bundle of minor fixes.

Includes:

* Replace 'CALLBACK' with 'WINAPI' because the signature of an unhandled
  exception filter uses 'WINAPI'.
* Improvements to OS SSE testing code.
* Improvements to GCC asm code.
* Comment fixes.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agotest_libFLAC.vcproj : Add missing files.
Erik de Castro Lopo [Thu, 27 Mar 2014 08:27:19 +0000 (19:27 +1100)]
test_libFLAC.vcproj : Add missing files.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoFix all instances of '#if HAVE_CONFIG_H'.
Erik de Castro Lopo [Sun, 23 Mar 2014 10:59:46 +0000 (21:59 +1100)]
Fix all instances of '#if HAVE_CONFIG_H'.

Should be '#ifdef HAVE_CONFIG_H'.

Closes: https://sourceforge.net/p/flac/bugs/410/

5 years agometadata_object.c : Fix handling of zero length vorbis comment string.
Erik de Castro Lopo [Sun, 23 Mar 2014 10:40:54 +0000 (21:40 +1100)]
metadata_object.c : Fix handling of zero length vorbis comment string.

Previously if a zero length string was passed in, the pointer would be
stored regardless of the copy parameter. If the original source pointer
was reassigned to something else bad things could happen.

Closes:  https://sourceforge.net/p/flac/bugs/377/

5 years agoRevert "Attempt to fix differences between x86 FPU and SSE calculations."
Erik de Castro Lopo [Sun, 23 Mar 2014 08:58:44 +0000 (19:58 +1100)]
Revert "Attempt to fix differences between x86 FPU and SSE calculations."

This reverts commit 70b078cfd5f9d4b0692c33f018cac3c652b14f90.

The code in the patch we're reverting probably only works for one
compiler and could easily stop working with the next release of
that compiler.

5 years agoAttempt to fix differences between x86 FPU and SSE calculations.
Erik de Castro Lopo [Fri, 21 Mar 2014 08:25:55 +0000 (19:25 +1100)]
Attempt to fix differences between x86 FPU and SSE calculations.

The x86 FPU holds intermediate results in larger registers than what
the SSE unit uses, resulting in slighlty different encodings of audio
data. Attempt to fix this by modifying libFLAC/lpc.c to store calculation
results in a FLAC__read before adding it to a sum.

At the moment this works, but I could easily imagine a new version of
the compiler optimising this store to the FLAC__real away leaving us
in the same situation we have now.

Patch-from: Oliver Stöneberg on sourceforge.net
Closes: https://sourceforge.net/p/flac/bugs/409/

5 years agoconfigure.ac : Add -Wunreachable-code to GCC CFLAGS.
Erik de Castro Lopo [Fri, 21 Mar 2014 07:52:24 +0000 (18:52 +1100)]
configure.ac : Add -Wunreachable-code to GCC CFLAGS.

5 years agoconfigure.ac : Add AC_PROG_MKDIR_P.
Erik de Castro Lopo [Fri, 21 Mar 2014 07:27:37 +0000 (18:27 +1100)]
configure.ac : Add AC_PROG_MKDIR_P.

Closes: https://sourceforge.net/p/flac/bugs/404/

5 years agoFix build issue on OSX with GCC 4.2/Xcode.
Erik de Castro Lopo [Fri, 21 Mar 2014 06:45:18 +0000 (17:45 +1100)]
Fix build issue on OSX with GCC 4.2/Xcode.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoAdd a test to validate that FLAC__MD5Final clears the MD5Context.
Erik de Castro Lopo [Sat, 15 Mar 2014 07:25:22 +0000 (18:25 +1100)]
Add a test to validate that FLAC__MD5Final clears the MD5Context.

Closes: https://sourceforge.net/p/flac/bugs/407/

5 years agoconfigure.ac : Make --enable-sse the default.
Erik de Castro Lopo [Sat, 15 Mar 2014 05:47:49 +0000 (16:47 +1100)]
configure.ac : Make --enable-sse the default.

SSE can still be disabled by configuring with --disable-sse but SSE
will be enabled by default.

5 years agoSlight improvements to application metadata tests.
Erik de Castro Lopo [Fri, 14 Mar 2014 23:45:40 +0000 (10:45 +1100)]
Slight improvements to application metadata tests.

5 years agolibFLAC/cpu.c : Detect SSE correctly on Windows when compiling with MinGW.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:40:53 +0000 (15:40 +1100)]
libFLAC/cpu.c : Detect SSE correctly on Windows when compiling with MinGW.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agostream_encoder/decoder : Comment fixes.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:29:54 +0000 (15:29 +1100)]
stream_encoder/decoder : Comment fixes.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolibFLAC/format.c : Remove MSVC6 specific hack.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:27:35 +0000 (15:27 +1100)]
libFLAC/format.c : Remove MSVC6 specific hack.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agolpc_asm.nasm : Whitespace.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:25:46 +0000 (15:25 +1100)]
lpc_asm.nasm : Whitespace.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoWhitespace.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:24:53 +0000 (15:24 +1100)]
Whitespace.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoRemove _MSC_VER specific FLAC__I64L definition.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:23:32 +0000 (15:23 +1100)]
Remove _MSC_VER specific FLAC__I64L definition.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/test_seeking : Remove un-needed local__strtoull.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:19:56 +0000 (15:19 +1100)]
src/test_seeking : Remove un-needed local__strtoull.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoMove FLAC__STRCASECMP definition to compat.h.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:18:04 +0000 (15:18 +1100)]
Move FLAC__STRCASECMP definition to compat.h.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoFix pragma warning.
Erik de Castro Lopo [Fri, 14 Mar 2014 04:15:48 +0000 (15:15 +1100)]
Fix pragma warning.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoUsing uintptr_t to simplify pointer handling a little bit
Fengwei Yin [Fri, 7 Mar 2014 01:05:08 +0000 (09:05 +0800)]
Using uintptr_t to simplify pointer handling a little bit

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agoRepairs test_grabbag.sh
Martijn van Beurden [Mon, 3 Mar 2014 13:17:56 +0000 (14:17 +0100)]
Repairs test_grabbag.sh

The change from /bin/sh to /bin/bash -e (commit 1d3d50) broke
the cuesheet tests. This should fix it

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
5 years agosrc/libFLAC/ : CPU feature detection improvements.
Erik de Castro Lopo [Sun, 2 Mar 2014 10:36:37 +0000 (21:36 +1100)]
src/libFLAC/ : CPU feature detection improvements.

CPU detection used to depend on ASM code. Now CPU features are
also detected when only FLAC__HAS_X86INTRIN is defined.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agostream_encoder.c : ifdef cleanup.
Erik de Castro Lopo [Tue, 25 Feb 2014 07:28:22 +0000 (18:28 +1100)]
stream_encoder.c : ifdef cleanup.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoFix typos in comments.
Erik de Castro Lopo [Mon, 24 Feb 2014 10:47:16 +0000 (21:47 +1100)]
Fix typos in comments.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agoDon't use intrinsics when they are slower.
Erik de Castro Lopo [Mon, 24 Feb 2014 10:45:32 +0000 (21:45 +1100)]
Don't use intrinsics when they are slower.

More thorough en-/decoding tests show that sometimes the functions
that use intrinsics are slower (or not really faster) than old
plain C functions.

After this patch the encoder doesn't use these new functions
when their usefulness is questionable.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

5 years agosrc/share/utf8/charset.c : Fix typo in conditional.
Erik de Castro Lopo [Mon, 3 Feb 2014 07:48:24 +0000 (18:48 +1100)]
src/share/utf8/charset.c : Fix typo in conditional.

Typo in the conditional to check the exit condition in ascii_strcasecmp.
It checks for (!*s1 || !*s1) instead of (!*s1 || !*s2). The typo did
not affect the result of the function as the loop  is exited before
changing s1 or s2 anyway.

The problem was found by cppcheck which is run automatically on the
Debian sources. Results here:
http://cppcheck.sourceforge.net/devinfo/daca2-cppcheck1.63/daca2.html

Patch-from: Robert Kausch <robert.kausch@freac.org>

5 years agobitmath.h : Fixes for FLAC__bitmath_ilog2_wide().
Erik de Castro Lopo [Sat, 1 Feb 2014 23:42:17 +0000 (10:42 +1100)]
bitmath.h : Fixes for FLAC__bitmath_ilog2_wide().

Existing version had a number of problems:
1) it didn't compile with MSVS
2) it returned correct results only when compiles with GNUC
3) it mentioned LGPL which isn't good for a BSD-licensed library

LGPL -> BSD issue documented here:
http://lists.xiph.org/pipermail/flac-dev/2013-September/004356.html

Patch-from: lvqcl <lvqcl.mail@gmail.com>