flac.git
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>

5 years agosrc/flac/encode.c : Improve perf of format_input() when compiled with MSVC.
Erik de Castro Lopo [Sat, 1 Feb 2014 22:00:27 +0000 (09:00 +1100)]
src/flac/encode.c : Improve perf of format_input() when compiled with MSVC.

MSVS profiler shows that the encoder spends too much time inside format_input()
when the input is 24-bit. Increases encoding speed:

FLAC -5: from 27.1 to 24.2 seconds
FLAC -8: from 76.2 to 73.1 seconds
(MSVS 2010, 32-bit flac.exe, 24-bit stereo input file)

For GCC compiles the encoding speed remains the same. I suspect that GCC is
smart enough to use strict aliasing rule to optimize the code, and MSVS doesn't
even know about it.

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

5 years agoAdd sse2 intrinscics code for lpc_restore_signal_...()
Erik de Castro Lopo [Sat, 1 Feb 2014 21:55:49 +0000 (08:55 +1100)]
Add sse2 intrinscics code for lpc_restore_signal_...()

The new functions are analogous to FLAC__lpc_restore_signal_asm_ia32_mmx.
FLAC uses them for x86-64 arch and also for ia32 if NASM is not available.

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

5 years agolibFLAC/stream_encoder.c : Fall back to intrinsics if NASM is not available.
Erik de Castro Lopo [Sat, 1 Feb 2014 09:34:51 +0000 (20:34 +1100)]
libFLAC/stream_encoder.c : Fall back to intrinsics if NASM is not available.

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

5 years agosrc/flac/main.c : Change the default beahviour when compression fails.
Erik de Castro Lopo [Sat, 1 Feb 2014 08:45:33 +0000 (19:45 +1100)]
src/flac/main.c : Change the default beahviour when compression fails.

Previously the flac executable would return a non-zero exit code when the
output file was bigger than the input file and this could be disabled with
the --no-error-on-compression-fail option.

New beaviour is to print the failure message but return a zero exit code
in the above situation, and only return a non-zero exit code with the
--error--on-compression-fail option. The --no-error-on-compression-fail
command line option has been retained.

5 years agosrc/flac/encode.c : Improve message when compression fails.
Erik de Castro Lopo [Sat, 1 Feb 2014 08:42:34 +0000 (19:42 +1100)]
src/flac/encode.c : Improve message when compression fails.

As suggested by Brian Willoughby this is not an "ERROR" but a "FAILURE".
Also list a couple of possible causes of this failure and remove the
suggestion to contact the developers.

5 years agosrc/flac/main.c : Add --no-error-on-compression-fail to --help output.
Erik de Castro Lopo [Sat, 1 Feb 2014 07:04:54 +0000 (18:04 +1100)]
src/flac/main.c : Add --no-error-on-compression-fail to --help output.

5 years agostream_encoder : Remove un-needed conversion from __m128i to FLAC__uint64.
Erik de Castro Lopo [Fri, 31 Jan 2014 09:39:26 +0000 (20:39 +1100)]
stream_encoder : Remove un-needed conversion from __m128i to FLAC__uint64.

Encoding speed slightly increased (1...2% for FLAC -8).

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

5 years agoAdd a fast shift for int64 values.
Erik de Castro Lopo [Fri, 31 Jan 2014 09:36:18 +0000 (20:36 +1100)]
Add a fast shift for int64 values.

This patch changes the code from:
(FLAC__int32)(xmm.m128i_i64[0] >> lp_quantization)
into:
_mm_cvtsi128_si32(_mm_srli_epi64(xmm, lp_quantization));

Encoding of 24-bit .wav files with 32-bit FLAC became noticeably faster.

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

5 years agolpc_intrin_sse2.c : Add RESIDUAL16_RESULT macro.
Erik de Castro Lopo [Thu, 30 Jan 2014 11:17:01 +0000 (22:17 +1100)]
lpc_intrin_sse2.c : Add RESIDUAL16_RESULT macro.

RESIDUAL16_RESULT is analogous to the existing RESIDUAL_RESULT macro
and simplifies the code a little.

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

5 years agoRemove redundant inline macro def.
Erik de Castro Lopo [Thu, 30 Jan 2014 10:57:13 +0000 (21:57 +1100)]
Remove redundant inline macro def.

The inline macro already exists in include/share/compat.h.

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

5 years agoAdd __INTEL_COMPILER to _MSC_VER #ifdefs.
Erik de Castro Lopo [Thu, 30 Jan 2014 10:53:37 +0000 (21:53 +1100)]
Add __INTEL_COMPILER to _MSC_VER #ifdefs.

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

5 years agoAdd FLAC__SSE_SUPPORTED and FLAC__SSE2_SUPPORTED flags.
Erik de Castro Lopo [Thu, 30 Jan 2014 10:49:51 +0000 (21:49 +1100)]
Add FLAC__SSE_SUPPORTED and FLAC__SSE2_SUPPORTED flags.

* Allow compiling using GCC GCC w/o SSE support.
* Allow SSE4.1 intrinsic functions to be enabled.

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

5 years agolpc_asm.nasm : More 'mov cl' -> 'mov ecx' fixes.
Erik de Castro Lopo [Fri, 17 Jan 2014 20:31:41 +0000 (07:31 +1100)]
lpc_asm.nasm : More 'mov cl' -> 'mov ecx' fixes.

According to Agner Fog in optimizing_assembly.pdf:

  "... write to a partial register may result in false dependencies
   between instructions, so it is better to avoid it."

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

5 years agolibFLAC : Add asm versions for two _wide() functions.
Erik de Castro Lopo [Tue, 7 Jan 2014 10:35:03 +0000 (21:35 +1100)]
libFLAC : Add asm versions for two _wide() functions.

GCC generates slow ia32 code for FLAC__lpc_restore_signal_wide() and
FLAC__lpc_compute_residual_from_qlp_coefficients_wide() so 24-bit
encoding/decoding is slower for GCC compile than for MSVS or ICC
compile. This patch adds ia32 asm versions of these functions.

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

5 years agolibFLAC/ia32/lpc_asm.nasm : Match calls and returns.
Erik de Castro Lopo [Tue, 7 Jan 2014 10:25:03 +0000 (21:25 +1100)]
libFLAC/ia32/lpc_asm.nasm : Match calls and returns.

According to Agner Fog, "...you must make sure that all calls
are matched with returns. Never jump out of a subroutine without
a return and never use a return as an indirect jump."

(see paragraph 3.15 in microarchitecture.pdf and
examples 3.5a and 3.5b in optimizing_assembly.pdf)

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

5 years agoAdd FLAC__ prefix to precompute_partition_info_sums....
Erik de Castro Lopo [Tue, 7 Jan 2014 10:14:55 +0000 (21:14 +1100)]
Add FLAC__ prefix to precompute_partition_info_sums....

Most non-static functions have FLAC__ prefix, but they were missing
from the precompute_partition_info_sums_* functions.

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

5 years agocompat.h : Simplify definition of FLAC__U64L.
Erik de Castro Lopo [Tue, 7 Jan 2014 10:10:08 +0000 (21:10 +1100)]
compat.h : Simplify definition of FLAC__U64L.

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

5 years agoFix Makefile.am altivec logic
Gustavo Zacarias [Wed, 4 Dec 2013 16:31:28 +0000 (13:31 -0300)]
Fix Makefile.am altivec logic

Besides SPE (FSL e500v? cores) there are other powerpc processors
that don't support altivec instructions so only enable them when it's
100% sure that the target has it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
6 years agoDetect Clang masquerading as GCC.
Erik de Castro Lopo [Fri, 22 Nov 2013 07:13:36 +0000 (18:13 +1100)]
Detect Clang masquerading as GCC.

Autoconf detects the Clang compiler as GNU GCC (clang sets defines like
__GNUC__ etc) but Clang is *not* completely compatible. If we detect
Clang we set ac_vc_c_compiler_gnu to 'no'.

6 years agoSilence warning message when doxygen disabled.
Erik de Castro Lopo [Tue, 15 Oct 2013 07:01:28 +0000 (18:01 +1100)]
Silence warning message when doxygen disabled.

6 years agolibFLAC/stream_encoder.c : Fix MSVS profiler hot spot.
Erik de Castro Lopo [Thu, 10 Oct 2013 10:31:50 +0000 (21:31 +1100)]
libFLAC/stream_encoder.c : Fix MSVS profiler hot spot.

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

6 years agowin_utf8_io_static.vcproj : LF -> CRLF conversion.
Erik de Castro Lopo [Thu, 10 Oct 2013 08:22:06 +0000 (19:22 +1100)]
win_utf8_io_static.vcproj : LF -> CRLF conversion.

6 years agoAdds use of restrict keyword to improve encoding speed.
Erik de Castro Lopo [Thu, 10 Oct 2013 07:24:19 +0000 (18:24 +1100)]
Adds use of restrict keyword to improve encoding speed.

Restrict works very poorly in Visual Studio (much slower than without)
so defined flac_restrict in share/compat.h and use that in:

    lpc_compute_residual...()
    lpc_restore_signal...()

As a result, FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_sse41()
offers no advantage for 64-bit compiles and was removed from x86-64 part
of stream_encoder.c

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

6 years agoVcproj file updates.
Erik de Castro Lopo [Fri, 4 Oct 2013 03:50:01 +0000 (13:50 +1000)]
Vcproj file updates.

rplaces
     OutputDirectory="..\..\..\..\objs\debug\bin"
with
     OutputDirectory="$(SolutionDir)objs\$(ConfigurationName)\bin
and so on.

Rmoves
     OutputFile="..\..\objs\debug\lib\$(ProjectName).lib
when possible.

Also, in the current version "Whole program optimization" compiler option
is set, but the corresponding linker option isn't. From MSDN:
   "If you do not explicitly specify /LTCG when you pass /GL or MSIL modules
   to the linker, the linker eventually detects this and restarts the link
   by using /LTCG. Explicitly specify /LTCG when you pass /GL and MSIL modules
   to the linker for the fastest possible build performance."
So /LTCG option was added too.

Debug build now uses libogg_static.lib from .\objs\debug\lib folder.
(the dependency for both release and debug is
    objs\$(ConfigurationName)\lib\libogg_static.lib)

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

6 years agoImprove x86 instrinsic implementation.
Erik de Castro Lopo [Thu, 3 Oct 2013 15:38:00 +0000 (01:38 +1000)]
Improve x86 instrinsic implementation.

* Splits lpc_x86intrin.c to lpc_intrin_sse.c and lpc_intrin_sse2.c
* Add FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_sse2()
  function to lpc_intrin_sse2.c
* Add lpc_intrin_sse41.c with two ..._wide_intrin_sse41() functions
  (useful for 24-bit en-/decoding)
* Add precompute_partition_info_sums_intrin_sse2() / ...ssse3() and
  disables precompute_partition_info_sums_32bit_asm_ia32_().
  SSE2 version uses 4 SSE2 instructions instead of 1 SSSE3 instruction
  PABSD so it is slightly slower.

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

6 years agoAdd FLAC__HAS_X86INTRIN to vcproj files.
Erik de Castro Lopo [Thu, 26 Sep 2013 17:10:34 +0000 (03:10 +1000)]
Add FLAC__HAS_X86INTRIN to vcproj files.

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

6 years agoFLAC.sln : Fix for MSVS 2005.
Erik de Castro Lopo [Thu, 26 Sep 2013 17:07:48 +0000 (03:07 +1000)]
FLAC.sln : Fix for MSVS 2005.

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

6 years agoMove M_PI definition to include/share/compat.h.
Erik de Castro Lopo [Thu, 26 Sep 2013 17:05:02 +0000 (03:05 +1000)]
Move M_PI definition to include/share/compat.h.

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

6 years agoFix documentation rice partition order
Martijn van Beurden [Wed, 18 Sep 2013 16:51:17 +0000 (18:51 +0200)]
Fix documentation rice partition order

For some reason all documentation lists the max rice partition
order to be 16, while the maximum is 15. This fixes flac -H, the
man page and the HTML source code documentation

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
6 years agoconfigure.ac : Tweaks.
Erik de Castro Lopo [Wed, 25 Sep 2013 13:26:49 +0000 (23:26 +1000)]
configure.ac : Tweaks.

* Add FLAC__ALIGN_MALLOC_DATA for x86_64.
* Removes XIPH_ADD_CFLAGS([-msse]) as -msse2 implies -msse.
* Fix typo.

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

6 years agoreplaygain_synthesis.c : Replace float literal with double literal.
Erik de Castro Lopo [Wed, 25 Sep 2013 13:19:57 +0000 (23:19 +1000)]
replaygain_synthesis.c : Replace float literal with double literal.

The variable its multipled by is double so there is no sense in
having the literal as a float.

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

6 years agoRemove union data from FLAC__CPUInfo.
Erik de Castro Lopo [Wed, 25 Sep 2013 13:07:42 +0000 (23:07 +1000)]
Remove union data from FLAC__CPUInfo.

Before this patch it was possible to set or get data.ia32.sse3 value
from x86-64 code, etc which is a potential source of errors.

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

6 years agoAdd SSE4.1/SSE4.2 detection.
Erik de Castro Lopo [Wed, 25 Sep 2013 13:05:13 +0000 (23:05 +1000)]
Add SSE4.1/SSE4.2 detection.

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

6 years agoFix minor Makefile.am issues arising from 943384d7c33.
Erik de Castro Lopo [Tue, 17 Sep 2013 20:29:31 +0000 (06:29 +1000)]
Fix minor Makefile.am issues arising from 943384d7c33.

Commit 943384d7c33 removed two directories in the doc/ tree and
those directories had to be removed from the Makefile.ams one
level up.

6 years agoClean up source documentation
Martijn van Beurden [Tue, 17 Sep 2013 17:18:28 +0000 (19:18 +0200)]
Clean up source documentation

This patch removes all content that is better viewed online (i.e.
downloads, links etc.) and not necessary for development.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
6 years agoConvert logo to SVG
Martijn van Beurden [Mon, 16 Sep 2013 18:06:17 +0000 (20:06 +0200)]
Convert logo to SVG

While developing FLAC Frontend, there where several occasions where
I felt little restrained because the FLAC logo is available only in
gif. I made an SVG version and rendered a new GIF version from it.

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