summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* metadata_object.c : Fix handling of zero length vorbis comment string.Erik de Castro Lopo2014-03-231-1/+1
| | | | | | | | 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/
* Revert "Attempt to fix differences between x86 FPU and SSE calculations."Erik de Castro Lopo2014-03-231-9/+5
| | | | | | | | 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.
* Attempt to fix differences between x86 FPU and SSE calculations.Erik de Castro Lopo2014-03-211-5/+9
| | | | | | | | | | | | | | 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/
* Fix build issue on OSX with GCC 4.2/Xcode.Erik de Castro Lopo2014-03-211-3/+3
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Add a test to validate that FLAC__MD5Final clears the MD5Context.Erik de Castro Lopo2014-03-154-3/+94
| | | | Closes: https://sourceforge.net/p/flac/bugs/407/
* Slight improvements to application metadata tests.Erik de Castro Lopo2014-03-152-3/+9
|
* libFLAC/cpu.c : Detect SSE correctly on Windows when compiling with MinGW.Erik de Castro Lopo2014-03-141-0/+66
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* stream_encoder/decoder : Comment fixes.Erik de Castro Lopo2014-03-142-3/+5
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* libFLAC/format.c : Remove MSVC6 specific hack.Erik de Castro Lopo2014-03-141-5/+0
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* lpc_asm.nasm : Whitespace.Erik de Castro Lopo2014-03-141-15/+15
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Whitespace.Erik de Castro Lopo2014-03-142-4/+0
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Remove _MSC_VER specific FLAC__I64L definition.Erik de Castro Lopo2014-03-141-5/+0
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* src/test_seeking : Remove un-needed local__strtoull.Erik de Castro Lopo2014-03-141-21/+0
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Move FLAC__STRCASECMP definition to compat.h.Erik de Castro Lopo2014-03-142-11/+0
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Fix pragma warning.Erik de Castro Lopo2014-03-141-0/+5
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Using uintptr_t to simplify pointer handling a little bitFengwei Yin2014-03-141-19/+4
| | | | Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* src/libFLAC/ : CPU feature detection improvements.Erik de Castro Lopo2014-03-022-4/+48
| | | | | | | 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>
* stream_encoder.c : ifdef cleanup.Erik de Castro Lopo2014-02-251-6/+6
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Fix typos in comments.Erik de Castro Lopo2014-02-242-4/+4
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Don't use intrinsics when they are slower.Erik de Castro Lopo2014-02-243-10/+7
| | | | | | | | | | | 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>
* src/share/utf8/charset.c : Fix typo in conditional.Erik de Castro Lopo2014-02-031-1/+1
| | | | | | | | | | | | | 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>
* bitmath.h : Fixes for FLAC__bitmath_ilog2_wide().Erik de Castro Lopo2014-02-021-22/+23
| | | | | | | | | | | | 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>
* src/flac/encode.c : Improve perf of format_input() when compiled with MSVC.Erik de Castro Lopo2014-02-021-7/+11
| | | | | | | | | | | | | | | 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>
* Add sse2 intrinscics code for lpc_restore_signal_...()Erik de Castro Lopo2014-02-023-0/+1250
| | | | | | | 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>
* libFLAC/stream_encoder.c : Fall back to intrinsics if NASM is not available.Erik de Castro Lopo2014-02-011-0/+12
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* src/flac/main.c : Change the default beahviour when compression fails.Erik de Castro Lopo2014-02-012-3/+8
| | | | | | | | | | | 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.
* src/flac/encode.c : Improve message when compression fails.Erik de Castro Lopo2014-02-011-1/+7
| | | | | | 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.
* src/flac/main.c : Add --no-error-on-compression-fail to --help output.Erik de Castro Lopo2014-02-011-0/+1
|
* stream_encoder : Remove un-needed conversion from __m128i to FLAC__uint64.Erik de Castro Lopo2014-01-312-68/+52
| | | | | | Encoding speed slightly increased (1...2% for FLAC -8). Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Add a fast shift for int64 values.Erik de Castro Lopo2014-01-312-24/+37
| | | | | | | | | | | 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>
* lpc_intrin_sse2.c : Add RESIDUAL16_RESULT macro.Erik de Castro Lopo2014-01-301-73/+41
| | | | | | | RESIDUAL16_RESULT is analogous to the existing RESIDUAL_RESULT macro and simplifies the code a little. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Remove redundant inline macro def.Erik de Castro Lopo2014-01-301-6/+0
| | | | | | The inline macro already exists in include/share/compat.h. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Add __INTEL_COMPILER to _MSC_VER #ifdefs.Erik de Castro Lopo2014-01-303-5/+5
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Add FLAC__SSE_SUPPORTED and FLAC__SSE2_SUPPORTED flags.Erik de Castro Lopo2014-01-3010-18/+87
| | | | | | | * Allow compiling using GCC GCC w/o SSE support. * Allow SSE4.1 intrinsic functions to be enabled. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* lpc_asm.nasm : More 'mov cl' -> 'mov ecx' fixes.Erik de Castro Lopo2014-01-181-8/+10
| | | | | | | | | 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>
* libFLAC : Add asm versions for two _wide() functions.Erik de Castro Lopo2014-01-074-1/+568
| | | | | | | | | 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>
* libFLAC/ia32/lpc_asm.nasm : Match calls and returns.Erik de Castro Lopo2014-01-071-8/+16
| | | | | | | | | | | 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>
* Add FLAC__ prefix to precompute_partition_info_sums....Erik de Castro Lopo2014-01-075-13/+12
| | | | | | | 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>
* Fix Makefile.am altivec logicGustavo Zacarias2013-12-201-2/+1
| | | | | | | | | 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>
* libFLAC/stream_encoder.c : Fix MSVS profiler hot spot.Erik de Castro Lopo2013-10-101-0/+27
| | | | Patch-from: vqcl <lvqcl.mail@gmail.com>
* win_utf8_io_static.vcproj : LF -> CRLF conversion.Erik de Castro Lopo2013-10-101-174/+174
|
* Adds use of restrict keyword to improve encoding speed.Erik de Castro Lopo2013-10-102-8/+4
| | | | | | | | | | | | | | 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>
* Vcproj file updates.Erik de Castro Lopo2013-10-0425-137/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve x86 instrinsic implementation.Erik de Castro Lopo2013-10-0415-576/+3178
| | | | | | | | | | | | | | * 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>
* Add FLAC__HAS_X86INTRIN to vcproj files.Erik de Castro Lopo2013-09-272-4/+4
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Move M_PI definition to include/share/compat.h.Erik de Castro Lopo2013-09-272-10/+1
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* replaygain_synthesis.c : Replace float literal with double literal.Erik de Castro Lopo2013-09-251-1/+1
| | | | | | | 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>
* Remove union data from FLAC__CPUInfo.Erik de Castro Lopo2013-09-254-84/+88
| | | | | | | 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>
* Add SSE4.1/SSE4.2 detection.Erik de Castro Lopo2013-09-252-28/+40
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Fix/re-enable SSE/SSE2 lpc optimisations.Erik de Castro Lopo2013-09-174-11/+7
|