flac.git
2 months agodoc: Use empty-element <hr/> tag.
Ralph Giles [Tue, 30 Jul 2019 21:41:23 +0000 (14:41 -0700)]
doc: Use empty-element <hr/> tag.

Improve the conformance of the xhtml generated by doxygen by
using the self-closing <hr/> tag in the custom footer.

Without this, xmllint complains about </body> and </html> end
tags inside the still-only <hr>. That syntax is allowed in
html but not xml.

2 months ago.travis.yml: Generate and validate html documentation.
Ralph Giles [Tue, 30 Jul 2019 17:30:21 +0000 (10:30 -0700)]
.travis.yml: Generate and validate html documentation.

Install Doxygen when running on the linux environment to test
generation of the API documentation.

Run the included static html documentation as well as the
generated API documentation through xmllint to verify
it conforms to the declared DTD. Since this this will be very
slow or fail relying on network resources, also install
the w3c-sgml library so the xhtml1 DTDs are available locally.

We're checking the source files, not build results in the
particular environment, so it's fine to run this check
on only a subset of builds.

Don't validate on CMake builds since they're not currently
generating API documentation even when Doxygen is available.

2 months agoAdd -lrt for all operating systems for clock_gettime
Dagobert Michelsen [Tue, 16 Jul 2019 11:36:12 +0000 (13:36 +0200)]
Add -lrt for all operating systems for clock_gettime

2 months agoUpdate Visual Studio 2005 files
Erik de Castro Lopo [Mon, 15 Jul 2019 21:53:34 +0000 (07:53 +1000)]
Update Visual Studio 2005 files

Patch-from: Janne Hyvärinen

3 months agoFix CppCheck warnings
Erik de Castro Lopo [Sun, 14 Jul 2019 00:02:07 +0000 (10:02 +1000)]
Fix CppCheck warnings

3 months agotest: Ignore varying length in metadata
Erik de Castro Lopo [Sat, 13 Jul 2019 08:29:34 +0000 (18:29 +1000)]
test: Ignore varying length in metadata

The metadata test checked for specific lengths which change from 5 bytes for
something like "1.3.2" to 9 bytes for something like "1.3.3pre1".

4 months agoFix CMake configure warning
evpobr [Fri, 31 May 2019 14:08:18 +0000 (19:08 +0500)]
Fix CMake configure warning

Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when
 unquoted.

4 months agoFixed #107: CMake error without enabling BUILD_CXXLIBS
Vitaliy Kirsanov [Fri, 31 May 2019 06:25:21 +0000 (09:25 +0300)]
Fixed #107: CMake error without enabling BUILD_CXXLIBS

4 months agoCMake: fixed windows_unicode_filenames linking errors
Виталий Кирсанов [Mon, 27 May 2019 18:05:12 +0000 (21:05 +0300)]
CMake: fixed windows_unicode_filenames linking errors

5 months agoFix Visual Studio solution generation with CMake
evpobr [Sat, 11 May 2019 08:55:33 +0000 (13:55 +0500)]
Fix Visual Studio solution generation with CMake

Rename flac application target to flacapp to avoid name collision with FLAC library target.

Closes #101.

5 months agoAdded README description for CMake
Vitaliy Kirsanov [Tue, 30 Apr 2019 22:07:09 +0000 (01:07 +0300)]
Added README description for CMake

5 months agoCMAKE_BUILD_TYPE set to Release by default: improved
Vitaliy Kirsanov [Tue, 30 Apr 2019 11:46:12 +0000 (14:46 +0300)]
CMAKE_BUILD_TYPE set to Release by default: improved

5 months agoEnable components search in package config mode
evpobr [Tue, 30 Apr 2019 10:35:17 +0000 (15:35 +0500)]
Enable components search in package config mode

5 months agoCMAKE_BUILD_TYPE set to Release by default
Vitaliy Kirsanov [Tue, 30 Apr 2019 10:20:23 +0000 (13:20 +0300)]
CMAKE_BUILD_TYPE set to Release by default

5 months agoAdded ECHO_C to CMake tests
Vitaliy Kirsanov [Tue, 30 Apr 2019 09:44:15 +0000 (12:44 +0300)]
Added ECHO_C to CMake tests

5 months agoOgg::Ogg renamed to Ogg::ogg
Vitaliy Kirsanov [Mon, 29 Apr 2019 10:28:55 +0000 (13:28 +0300)]
Ogg::Ogg renamed to Ogg::ogg

5 months agoUse of BUILD_SHARED_LIBS added
Vitaliy Kirsanov [Mon, 29 Apr 2019 09:48:24 +0000 (12:48 +0300)]
Use of BUILD_SHARED_LIBS added

5 months agoFixed dependencies on win_utf8_io
Виталий Кирсанов [Fri, 26 Apr 2019 20:38:10 +0000 (23:38 +0300)]
Fixed dependencies on win_utf8_io

5 months agoFixed dependency between grabbag and utf8
Vitaliy Kirsanov [Thu, 25 Apr 2019 14:27:09 +0000 (17:27 +0300)]
Fixed dependency between grabbag and utf8

5 months agoCMake minimum required lowered to 3.1
Vitaly Kirsanov [Thu, 25 Apr 2019 14:14:28 +0000 (14:14 +0000)]
CMake minimum required lowered to 3.1

5 months agoAdd missing fseeko check
evpobr [Thu, 25 Apr 2019 07:28:56 +0000 (12:28 +0500)]
Add missing fseeko check

5 months agoIntegrate CMake to Travis CI tests
evpobr [Thu, 25 Apr 2019 04:48:15 +0000 (09:48 +0500)]
Integrate CMake to Travis CI tests

* Add CMake builds with ENABLE_64_BIT_WORDS enabled\disabled
* Run tests in parallel jobs
* Use Xenial Travis image to support CMake >= 3.12
* Install libtool-bin package missing in Xenial image

5 months agoFLAC now depends on win_utf8_io
Vitaliy Kirsanov [Sun, 14 Apr 2019 08:17:08 +0000 (11:17 +0300)]
FLAC now depends on win_utf8_io

Accidently found this missing dependency

5 months agoAdded /arch:SSE2 flag
Vitaly Kirsanov [Fri, 12 Apr 2019 20:11:06 +0000 (23:11 +0300)]
Added /arch:SSE2 flag

5 months agoVersions for shared libs specified
Vitaly Kirsanov [Fri, 12 Apr 2019 19:16:45 +0000 (22:16 +0300)]
Versions for shared libs specified

5 months agoCosmetic change: using $<COMPILE_LANGUAGE:>
Vitaliy Kirsanov [Tue, 9 Apr 2019 10:21:07 +0000 (13:21 +0300)]
Cosmetic change: using $<COMPILE_LANGUAGE:>

5 months ago/test/*.sh enabled for CTest in UNIX
Vitaliy Kirsanov [Mon, 8 Apr 2019 04:36:05 +0000 (07:36 +0300)]
/test/*.sh enabled for CTest in UNIX

5 months agoFindOGG.cmake module added
Vitaliy Kirsanov [Sun, 7 Apr 2019 09:37:56 +0000 (12:37 +0300)]
FindOGG.cmake module added

5 months agoCMake support added
Vitaliy Kirsanov [Sun, 31 Mar 2019 20:04:45 +0000 (23:04 +0300)]
CMake support added

7 months agoUse MMX ASM fucntions instead of SSE4.1 if available
lvqcl [Sat, 2 Mar 2019 20:56:03 +0000 (23:56 +0300)]
Use MMX ASM fucntions instead of SSE4.1 if available

These SSE4.1 functions are not always faster than their MMX ASM counterparts,
so let's use ASM functions if they're available.

7 months agoSpeed up FLAC__bitwriter_write_byte_block (metadata writing)
Robert Kausch [Sat, 2 Mar 2019 17:06:46 +0000 (18:06 +0100)]
Speed up FLAC__bitwriter_write_byte_block (metadata writing)

8 months agoSuppress compression failure message if it is not an error
Karthik Periagaram [Fri, 1 Feb 2019 04:51:30 +0000 (20:51 -0800)]
Suppress compression failure message if it is not an error

If the user specifies `--no-error-on-compression-fail`, there is no need
to treat compression failure as an error. Hence, the failure message
should be suppressed along with the non-zero exit code (which already
is suppressed).

12 months agoReplace hadd with shuffle + add
lvqcl [Wed, 19 Sep 2018 17:03:37 +0000 (20:03 +0300)]
Replace hadd with shuffle + add

13 months agoCosmetic changes in lpc_asm.nasm and utf8.c
lvqcl [Fri, 31 Aug 2018 19:45:38 +0000 (22:45 +0300)]
Cosmetic changes in lpc_asm.nasm and utf8.c

13 months agoUpdate MinGW build files
lvqcl [Sat, 25 Aug 2018 13:59:21 +0000 (16:59 +0300)]
Update MinGW build files

13 months agoMove CreateFile_utf8 function to a more logical place
lvqcl [Sat, 25 Aug 2018 07:23:39 +0000 (10:23 +0300)]
Move CreateFile_utf8 function to a more logical place

13 months agoAdd VSX optimised versions of autocorrelation loops
Anton Blanchard [Sat, 7 Jul 2018 04:21:46 +0000 (14:21 +1000)]
Add VSX optimised versions of autocorrelation loops

Add a POWER8 and POWER9 version of the autocorrelation functions.

flac --best is about 3.3x faster on POWER9 with this patch.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
13 months agoAdd runtime detection of POWER8 and POWER9
Anton Blanchard [Sat, 7 Jul 2018 00:49:59 +0000 (10:49 +1000)]
Add runtime detection of POWER8 and POWER9

Use getauxval() to determine if we are on POWER8 or POWER9 or newer.
POWER8 is represented by version 2.07 and POWER9 by version 3.00.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
13 months agoCheck if compiler supports target attribute on ppc64
Amitay Isaacs [Mon, 9 Jul 2018 02:38:47 +0000 (12:38 +1000)]
Check if compiler supports target attribute on ppc64

Check if the compiler supports __attribute__((target("cpu=power8")))
and __attribute__((target("cpu=power9")))

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
13 months agoAdd m4 macro to check for C __attribute__ features
Amitay Isaacs [Tue, 10 Jul 2018 04:38:50 +0000 (14:38 +1000)]
Add m4 macro to check for C __attribute__ features

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
13 months agoconfigure.ac: Fix FLAC__CPU_PPC on little endian, and add FLAC__CPU_PPC64
Anton Blanchard [Sun, 8 Jul 2018 04:56:31 +0000 (14:56 +1000)]
configure.ac: Fix FLAC__CPU_PPC on little endian, and add FLAC__CPU_PPC64

FLAC__CPU_PPC wasn't catching powerpcle or powerpc64le. Fix that and
add a new define for FLAC__CPU_PPC64.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
13 months agoconfigure.ac: Add VSX enable/disable
Anton Blanchard [Sun, 8 Jul 2018 04:55:03 +0000 (14:55 +1000)]
configure.ac: Add VSX enable/disable

We want to create functions with PowerPC VSX instructions, so add
a configure check.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
13 months agoconfigure.ac: Remove SPE detection code
Anton Blanchard [Sat, 7 Jul 2018 00:16:04 +0000 (10:16 +1000)]
configure.ac: Remove SPE detection code

We don't have any SPE code, so there's no need to detect it
at configure time.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
13 months agomove CreateFile function outside of libFLAC
lvqcl [Sat, 18 Aug 2018 10:59:51 +0000 (13:59 +0300)]
move CreateFile function outside of libFLAC

13 months agowindows_unicode_filenames.c: Fix a missing return statement
Erik de Castro Lopo [Fri, 17 Aug 2018 23:44:24 +0000 (09:44 +1000)]
windows_unicode_filenames.c: Fix a missing return statement

16 months agoImprove SIMD detection with Visual Studio
evpobr [Thu, 10 May 2018 16:25:14 +0000 (21:25 +0500)]
Improve SIMD detection with Visual Studio

Visual Studio can use GCC (for Android) and Clang (supported toolset) so they must be checked before native compiler.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
16 months agoAdd output-prefix tests
orbea [Tue, 5 Jun 2018 04:00:06 +0000 (21:00 -0700)]
Add output-prefix tests

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
16 months agoFix --output-prefix with input-files in sub-directories
orbea [Tue, 29 May 2018 18:58:51 +0000 (11:58 -0700)]
Fix --output-prefix with input-files in sub-directories

And make sure to reserve the whole file path when not using --output-prefix.

Fixes https://sourceforge.net/p/flac/bugs/463/
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
16 months agoFix miscellaneous typos.
luz.paz [Tue, 22 May 2018 14:17:53 +0000 (10:17 -0400)]
Fix miscellaneous typos.

Found via `codespell -q 3`

16 months ago.travis.yml: Simplify file structure and add libogg dependency.
Robert Kausch [Sun, 20 May 2018 10:00:16 +0000 (12:00 +0200)]
.travis.yml: Simplify file structure and add libogg dependency.

16 months agoAdd unit tests for word-wise CRC16 functions
Robert Kausch [Sun, 20 May 2018 08:56:15 +0000 (10:56 +0200)]
Add unit tests for word-wise CRC16 functions

Update FLAC__BitReader structure in unit test.

16 months agoFix CRC calculation for small blocks.
Robert Kausch [Mon, 30 Apr 2018 16:09:51 +0000 (18:09 +0200)]
Fix CRC calculation for small blocks.

16 months agoUpdate CRC16 for larger data blocks when decoding.
Robert Kausch [Mon, 30 Apr 2018 10:13:46 +0000 (12:13 +0200)]
Update CRC16 for larger data blocks when decoding.

16 months agoImplement slicing-by-8 CRC16 algorithm.
Robert Kausch [Mon, 30 Apr 2018 09:54:39 +0000 (11:54 +0200)]
Implement slicing-by-8 CRC16 algorithm.

16 months ago.travis.yml: Run --enable-64-bit-words test in separate job.
Robert Kausch [Sat, 19 May 2018 09:32:54 +0000 (11:32 +0200)]
.travis.yml: Run --enable-64-bit-words test in separate job.

16 months agoAdd bitreader unit test.
Robert Kausch [Sat, 19 May 2018 00:26:43 +0000 (02:26 +0200)]
Add bitreader unit test.

16 months agoMinor fixes for bitwriter unit test.
Robert Kausch [Sat, 19 May 2018 00:26:25 +0000 (02:26 +0200)]
Minor fixes for bitwriter unit test.

16 months agoAdd unit tests for CRC calculation.
Robert Kausch [Fri, 18 May 2018 23:35:18 +0000 (01:35 +0200)]
Add unit tests for CRC calculation.

16 months agoRemove unused CRC8 functions.
Robert Kausch [Mon, 30 Apr 2018 09:39:28 +0000 (11:39 +0200)]
Remove unused CRC8 functions.

17 months agoFix more GCC warnings about case fall-through
Erik de Castro Lopo [Sun, 6 May 2018 05:40:03 +0000 (15:40 +1000)]
Fix more GCC warnings about case fall-through

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

17 months agoMore generic version of MSVC bug workaround
Erik de Castro Lopo [Sun, 6 May 2018 05:25:11 +0000 (15:25 +1000)]
More generic version of MSVC bug workaround

This is an updtate to the fix for an MSVC 2015 bug in 94a61241b0.

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

17 months ago.travis.yml: Test --enable-64-bit-words as well topic/travis
Erik de Castro Lopo [Mon, 30 Apr 2018 19:58:25 +0000 (05:58 +1000)]
.travis.yml: Test --enable-64-bit-words as well

18 months agoreplaygain_synthesis.c: Fix compile issue in MSVS
Jeffrey Espiritu [Sun, 8 Apr 2018 20:21:19 +0000 (16:21 -0400)]
replaygain_synthesis.c: Fix compile issue in MSVS

The `inline` keyword is only available in C++ so include `share/compat.h`.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
20 months agoFix for missing WINAPI_FAMILY_PARTITION
Erik de Castro Lopo [Sat, 10 Feb 2018 02:37:52 +0000 (13:37 +1100)]
Fix for missing WINAPI_FAMILY_PARTITION

This is macro identifier is not defined, define it to `0`.

21 months agolibFLAC : new function returns client_data from decoder
Christophe DUMONT [Mon, 4 Dec 2017 10:38:37 +0000 (11:38 +0100)]
libFLAC : new function returns client_data from decoder

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
21 months agoUWP build fix
Alberto Fustinoni [Fri, 5 Jan 2018 06:39:04 +0000 (15:39 +0900)]
UWP build fix

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoreplaygain_synthesis.c: Fix a cppcheck warning
Erik de Castro Lopo [Thu, 20 Jul 2017 09:41:55 +0000 (19:41 +1000)]
replaygain_synthesis.c: Fix a cppcheck warning

Cppcheck was incorrectly warning that `doubletmp` was being used
un-initialized. This was due to the fact that it was being used
and initialized in a pre-processor macro. Chaning the macro to
an inline function stops cppcheck from raising a warning.

2 years agoRevert "Add Clang support for FLAC__SSE_TARGET"
Erik de Castro Lopo [Wed, 19 Jul 2017 09:28:30 +0000 (19:28 +1000)]
Revert "Add Clang support for FLAC__SSE_TARGET"

This reverts commit b52fa0ec6dc83ec0f430ff7bd7c80485c45728b0.

See: https://github.com/xiph/flac/commit/b52fa0ec6dc83ec0f430ff7bd7c80485c45728b0

2 years agoAdd Clang support for FLAC__SSE_TARGET
C.W. Betts [Fri, 14 Jul 2017 17:20:19 +0000 (11:20 -0600)]
Add Clang support for FLAC__SSE_TARGET

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoCorrect flattop window coefficients
Thomas Zander [Thu, 29 Jun 2017 18:43:33 +0000 (20:43 +0200)]
Correct flattop window coefficients

The window amplitude is now  normalised to 1.0.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoFix GCC 7 case fall through warnings
Erik de Castro Lopo [Mon, 26 Jun 2017 09:22:28 +0000 (19:22 +1000)]
Fix GCC 7 case fall through warnings

GCC 7 warns about `case` statements which are not separated by a
`break` statement. This warning can be fixed by adding a comment.

2 years agoUpdate lpc_intrin_sse.c
Shark64 [Thu, 22 Jun 2017 14:48:44 +0000 (16:48 +0200)]
Update lpc_intrin_sse.c

Remove redundant assignment before broadcasting into xmm registers.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoFLAC++: Add missing prototype for construct_block
Thomas Zander [Thu, 22 Jun 2017 18:10:09 +0000 (20:10 +0200)]
FLAC++: Add missing prototype for construct_block

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoSilence -finline-functions warning
Thomas Zander [Thu, 22 Jun 2017 17:12:25 +0000 (19:12 +0200)]
Silence -finline-functions warning

This warning flag is gcc-specfic.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agodoc: Add notes about subframe sample size
Ruud van Asseldonk [Sun, 11 Jun 2017 11:16:27 +0000 (13:16 +0200)]
doc: Add notes about subframe sample size

2 years agoflac: Use WAVEFORMATEXTENSIBLE when bps != (8|16)
Erik de Castro Lopo [Sat, 27 May 2017 06:07:35 +0000 (16:07 +1000)]
flac: Use WAVEFORMATEXTENSIBLE when bps != (8|16)

When decoding to WAV, the legacy wFormatTag of WAVE_FORMAT_PCM should
only be used if the bitwidth is 8 or 16. For all other bitwidths,
use WAVEFORMATEXTENSIBLE.

Two of the test programs/scripts also needed updating.

2 years agoFix missing SIZE_MAX definition on Android
Erik de Castro Lopo [Wed, 3 May 2017 08:37:12 +0000 (18:37 +1000)]
Fix missing SIZE_MAX definition on Android

2 years agolibFLAC: Fix default flac_max/min
Erik de Castro Lopo [Wed, 19 Apr 2017 08:14:26 +0000 (18:14 +1000)]
libFLAC: Fix default flac_max/min

There were a number of specialized versions, but the default case
defined `MAX` and `MIN` instead of `flac_max` and `flac_min`.

2 years agoflac: Fix usage message
Erik de Castro Lopo [Sun, 16 Apr 2017 21:31:10 +0000 (07:31 +1000)]
flac: Fix usage message

Patch-from: "Michael W. Bombardieri" <mb@ii.net>

2 years agometaflac: Fix a memory leak
Erik de Castro Lopo [Sun, 9 Apr 2017 05:17:06 +0000 (15:17 +1000)]
metaflac: Fix a memory leak

2 years agostream_decoder.c: Fix a memory leak
Erik de Castro Lopo [Sat, 8 Apr 2017 08:34:49 +0000 (18:34 +1000)]
stream_decoder.c: Fix a memory leak

Leak reported by Secunia Research.

2 years agoFix typos in header files
Erik de Castro Lopo [Mon, 20 Mar 2017 18:39:26 +0000 (05:39 +1100)]
Fix typos in header files

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

2 years agostream_decoder.h: Fix Reference to Non-Existent Functions
Keegan Drake H.P [Wed, 15 Mar 2017 23:20:14 +0000 (18:20 -0500)]
stream_decoder.h: Fix Reference to Non-Existent Functions

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/xiph/flac/pull/31

2 years agostream_decoder.h: Fix References to ``stdout''
Keegan Drake H.P [Wed, 15 Mar 2017 23:15:07 +0000 (18:15 -0500)]
stream_decoder.h: Fix References to ``stdout''

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agocpu.c: Fix LLVM compile
Erik de Castro Lopo [Wed, 1 Mar 2017 19:40:25 +0000 (06:40 +1100)]
cpu.c: Fix LLVM compile

Switch from `asm` to `__asm__` which is better supported.

Patch-from: Olivier Tristan <o.tristan@uvi.net>

2 years agocpu.c: Merge ia32 and x86_64 CPU info functions
Erik de Castro Lopo [Mon, 27 Feb 2017 09:35:21 +0000 (20:35 +1100)]
cpu.c: Merge ia32 and x86_64 CPU info functions

After the removal of the OS SSE detection stuff ia32_cpu_info()
and x86_64_cpu_info() became very similar. Merging them makes
sense.

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

2 years agocpu.c: Fix debug Windows w32 build issue
Erik de Castro Lopo [Thu, 23 Feb 2017 07:58:44 +0000 (18:58 +1100)]
cpu.c: Fix debug Windows w32 build issue

Was failing to build without NASM.

Patch-from: Olivier Tristan <o.tristan@uvi.net>

2 years agostream_decoder.c: Comments
Erik de Castro Lopo [Tue, 21 Feb 2017 19:16:38 +0000 (06:16 +1100)]
stream_decoder.c: Comments

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

2 years agoSIMD: remove outdated SSE2 code
Erik de Castro Lopo [Tue, 21 Feb 2017 09:27:05 +0000 (20:27 +1100)]
SIMD: remove outdated SSE2 code

Removes FLAC__lpc_restore_signal_16_intrin_sse2() which was faster
than than C code, but not faster than MMX-accelerated ASM functions.
It's also slower than the new SSE4.1 functions that were added by
the previous patch.

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

2 years agoSIMD: Accelerate decoding of 16 bit FLAC
Erik de Castro Lopo [Sun, 19 Feb 2017 11:19:38 +0000 (22:19 +1100)]
SIMD: Accelerate decoding of 16 bit FLAC

This patch removes FLAC__lpc_restore_signal_16_intrin_sse2().

It's faster than C code, but not faster than MMX-accelerated
ASM functions. It's also slower than the new SSE4.1 functions
that were added by the previous patch.
So this function wasn't very useful before, and now it's
even less useful. I don't see a reason to keep it.

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

2 years agoSIMD: Improve decoding of some 24 bit files
Erik de Castro Lopo [Sun, 19 Feb 2017 08:47:58 +0000 (19:47 +1100)]
SIMD: Improve decoding of some 24 bit files

Accelerates decoding of non-Subset 24-bit FLAC files (where lpc_order
> 12).

The improved function is FLAC__lpc_restore_signal_wide_intrin_sse41().
It requires SSE4.1 and it's used only by 32-bit libFLAC.

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

2 years agoSIMD: Add const qualifier where appropriate
Erik de Castro Lopo [Sun, 19 Feb 2017 08:45:54 +0000 (19:45 +1100)]
SIMD: Add const qualifier where appropriate

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

2 years agocpu.h: Another CPP fixup
Erik de Castro Lopo [Thu, 16 Feb 2017 07:15:11 +0000 (18:15 +1100)]
cpu.h: Another CPP fixup

CPP is minefield. We should simplify CPP wherever possible and work
to minimise nesting.

2 years agocpu.h: Fix compiler detection
Erik de Castro Lopo [Wed, 15 Feb 2017 07:22:23 +0000 (18:22 +1100)]
cpu.h: Fix compiler detection

GCC version 4.6 was throwing an error on `__has_attribute` which
seems to be Clang specific. Solution was to un-nest the CPP code
so that Clang is confirmed before the `__has_attribute` is hit.

2 years agoflac/encode.c: Fix an integer overflow
Erik de Castro Lopo [Tue, 14 Feb 2017 10:21:54 +0000 (21:21 +1100)]
flac/encode.c: Fix an integer overflow

When encoding a 24 bit multichannel W64 file on a 32 bit system, a
calculation could overflow resulting in a "got partial sample"
error and early termination of the encoding process.

The fix was to replace the cast to `size_t` (which is only 32 bits
on a 32 bit system) with a cast to `uin64_t`.

Thanks to Janne Hyvärinen for helping to track down the problem.

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

2 years agostream encoder: fix documentation inconsistencies
Christian Stadelmann [Mon, 30 Jan 2017 16:43:31 +0000 (17:43 +0100)]
stream encoder: fix documentation inconsistencies

Fixes https://sourceforge.net/p/flac/bugs/452/

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agocpu.h: Add #defines so Clang compiles AVX2
Erik de Castro Lopo [Sun, 12 Feb 2017 11:38:11 +0000 (22:38 +1100)]
cpu.h: Add #defines so Clang compiles AVX2

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

2 years agoFix compile with cygwin
Rosen Penev [Thu, 9 Feb 2017 03:42:42 +0000 (19:42 -0800)]
Fix compile with cygwin

The underscores are wrong. The comment is also correct.

Also remove the configure.ac option. Otherwise it tries to compile the
windows unicode stuff which POSIX(cygwin) does not understand.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2 years agoconfigure.ac: Clean up CFLAGS code
Erik de Castro Lopo [Mon, 6 Feb 2017 08:54:13 +0000 (19:54 +1100)]
configure.ac: Clean up CFLAGS code

Also moves _FORTIFY_SOURCE detection to an M4 macro.

Patchfrom: David Seifert <soap@gentoo.org>

2 years agolibFLAC/lpc_intrin_sse41.c: Change usage of _mm_alignr_epi8
Erik de Castro Lopo [Tue, 31 Jan 2017 09:37:48 +0000 (20:37 +1100)]
libFLAC/lpc_intrin_sse41.c: Change usage of _mm_alignr_epi8

Replace
     a = _mm_alignr_epi8(b, a, n);
with
     a = _mm_alignr_epi8(a, b, n);

The resulting code is very slightly faster and the binaries slightly
smaller.

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