summaryrefslogtreecommitdiff
path: root/src/libFLAC/lpc.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce subdivide_tukey apodizationMartijn van Beurden2022-08-191-0/+29
| | | | | | | | | | | | | | | Subdivide_tukey is intended to replace partial_tukey and punchout_tukey. It works in rougly the same way, but uses a more efficient algorithm, recyling more data. subdivide_tukey has 2 arguments, of which 1 is optional. The first states the maximum number of parts the signal has to be split up in, the second is the tukey parameter, divided by the max num of parts. subdivide_tukey(3) analyses audio with an unsplit block, with the block split in 2 and split in 3. Here the default p of 0.5 applies to the smallest parts, so the unsplit block effectively has a p of 0.5/3. subdivide_tukey(3/2e-1) does the same but with p of 0.2.
* Bulk update copyright dates to 2022Martijn van Beurden2022-07-261-1/+1
|
* Fix rolled up version of lpc_restore_signal_wideMartijn van Beurden2022-07-171-1/+1
| | | | This fixes https://github.com/xiph/flac/issues/393
* Revert "Enable encoder to use INT32_MIN as residual value" (#389)Martijn van Beurden2022-07-131-2/+4
| | | | | | | This reverts commit 7e0a0e572305e9004a6fa9bba3dd6be936553b03, following the change to the FLAC format proposed here: https://github.com/ietf-wg-cellar/flac-specification/pull/148 It turns out supporting use of INT32_MIN is quite a hassle.
* Enable encoder to use INT32_MIN as residual valueMartijn van Beurden2022-07-011-4/+2
| | | | | | As abs(INT32_MIN) is undefined, it took some extra work to enable the encoder to do this. While expected gains are zero, this is done to ensure full spec coverage in this regard
* Add 32-bit encoding, including limiting of residual to 32-bit intMartijn van Beurden2022-06-121-17/+128
|
* Add 32-bit decoding capabilityMartijn van Beurden2022-06-121-29/+108
| | | | | | Decoding for 32-bit files is added, including the ability to decode a 33-bit side subframe. However, residuals are assumed to be limited to a 32-bit signed int, the encoder must make sure of this
* Only locally disable signed integer sanitizing on decoder fuzzersMartijn van Beurden2022-05-281-1/+2
| | | | See https://github.com/google/oss-fuzz/pull/7687
* Improve compute_residual_from_qlp_coefficients datapath selectionMartijn van Beurden2022-05-281-0/+26
| | | | | This bases the selection of the datapath on the actual predictor coefficients instead of on the predictor coefficient precision
* Silence oss-fuzz integer overflow warnings in audio data pathMartijn van Beurden2022-04-301-1/+9
| | | | | | | | | | Because fuzzing feeds bogus predictors and residual samples to the decoder, having overflows in certain functions is unavoidable. Also, because the calculated values are audio path only, there is little potential for security problems Should 'fix' the following reports https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44824 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46964
* Switch to autoc[] as doubleMartijn van Beurden2022-04-191-5/+5
| | | | | | | | | | | This changes the calculation of autocorrelation from single precision float to double precision. With this, compression improves on average by about 0.5% with compression level 4, with some tracks (espcially material with high samplerates) seeing improvements of 10% or more. This commit removes SSE intrinsics and MMX assembler routins, adds SSE2 and changes VSX autoc[] routines and changes the regular C code.
* libFLAC/lpc.c: Fix signed integer overflowErik de Castro Lopo2019-09-161-12/+12
| | | | | | | | Do the addition as 64 bits before truncating to 32 bits. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16459 Testcase: fuzzer_decoder-5728784602365952
* Fix GCC 7 case fall through warningsErik de Castro Lopo2017-06-261-76/+76
| | | | | GCC 7 warns about `case` statements which are not separated by a `break` statement. This warning can be fixed by adding a comment.
* Do not override CFLAGS, as CFLAGS is a user flag.David Seifert2017-01-191-2/+2
| | | | | | | | | * Furthermore, use NDEBUG globally to detect the presence of building with more debug output information. AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays Gnome has also switched to it from its own custom solution. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Purge usage of `unsigned` typeErik de Castro Lopo2017-01-141-22/+22
| | | | | | | As pointed out by Ozkan Sezer, on some platforms `int32_t` is actually a typedef for `long` so `unsigned` cannot be used interchangably with `FLAC__uint32`. Fix is to switch from `unsigned` to explicit sized ISO C types defined in <stdint.h>.
* Retire FLAC__float and FLAC__double typesThomas Zander2016-02-091-16/+16
| | | | | | | | | | | | Usage of internal aliases for float and double do not provide substantial value. For integer-only libs, the macro FLAC__INTEGER_ONLY_LIBRARY is used in the appropriate places already. Also, adapt copyright messages to include 2016. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Closes: https://github.com/xiph/flac/pull/10
* libFLAC/lpc.c: Fix commentsErik de Castro Lopo2016-01-241-2/+2
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Cleanup FLAC__bitmath_silog2()Thomas Zander2016-01-041-5/+5
| | | | | | | | | | | - Retire 32bit variant of silog2(), since only the _wide variant is used - Rename FLAC__bitmath_silog2_wide() to FLAC__bitmath_silog2() - Replace existing implementation by shorter, clearer implementation using optimised routines from bitmath.h - Update Copyright string to 2016 in changed files Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Closes: https://github.com/xiph/flac/pull/6
* libFLAC: Tweak MSVC supportErik de Castro Lopo2016-01-041-7/+6
| | | | | | Visual Studio 2013 and newer has better support for C99. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Whitespace onlyErik de Castro Lopo2015-12-251-1/+1
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* src/libFLAC/lpc.c : Restore missing conditional.Erik de Castro Lopo2015-03-311-0/+1
| | | | | | Git commit 9c2290ade5 in-correctly removed a conditional around an fprintf. Thanks to mark4o on #xiph (freenode) for reporting this.
* Improve LPC order guessMartijn van Beurden2014-12-051-2/+2
| | | | | | | | | | | | The recent compression preset retuning improved upon most material but it the few tracks that show regression are usually classical music. This patch improves compression by improving the LPC order guess, of which classical music benefits most. Improvement is 0.007% on average but up to 0.1%. I haven't seen regressions for any of my test samples. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Update copyright years to include 2014.Erik de Castro Lopo2014-11-251-1/+1
|
* Update URLs as nedeed.Erik de Castro Lopo2014-06-281-1/+1
| | | | | | | 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>
* Correections for comments.Erik de Castro Lopo2014-06-281-1/+1
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Suppress MSVS warnings when compiling for x86-64.Erik de Castro Lopo2014-04-111-0/+9
| | | | Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Fix all instances of '#if HAVE_CONFIG_H'.Erik de Castro Lopo2014-03-241-1/+1
| | | | | | Should be '#ifdef HAVE_CONFIG_H'. Closes: https://sourceforge.net/p/flac/bugs/410/
* 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/
* Adds use of restrict keyword to improve encoding speed.Erik de Castro Lopo2013-10-101-4/+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>
* src/libFLAC/lpc.c : Fix compiler warning.Erik de Castro Lopo2013-09-151-1/+1
|
* Move defintion of M_LN2 to include/share/compat.h.Erik de Castro Lopo2013-09-071-4/+0
|
* MSVS : Define _USE_MATH_DEFINES.Erik de Castro Lopo2013-09-071-1/+0
| | | | | | | MSVS does defined the M_LN2 constant in <math.h> but only makes it visible if _USE_MATH_DEFINES is defined. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* Set version to 1.3.0 and update coyprights throughout.Erik de Castro Lopo2013-05-261-1/+2
|
* Rename all parameters and locals from 'index' to 'indx'.Erik de Castro Lopo2013-04-051-5/+5
|
* Large patch from Ben Allison fixing the MSVC build.Erik de Castro Lopo2013-03-061-1/+2
| | | | Patch tweaked a little to fix Linux build and clean up minor problems.
* Revert parts of 96d081c1 that touched source code or autotools files.Erik de Castro Lopo2013-01-031-1/+1
|
* Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build systemHendricks2662013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | This is a patch to allow building of the project using MSYS, MinGW, and MinGW-w64 with the following invocation: make -f Makefile.lite libFLAC libFLAC++ flac metaflac test_libs_common test_libFLAC test_libFLAC++ test_grabbag test_seeking test_streams utils examples This patch addresses eight points: 1. `uname -p` in MSYS returns "unknown" so we must use `gcc -dumpmachine` to gain information about the target, 32-bit or 64-bit. 2. MinGW-w64 does not ship with a working iconv.h, so we must disable it under this specific compiler. 3. The code requires <inttypes.h> in a handful of C files, but config.mk did not contain -DHAVE_INTTYPES_H, which under the full build process (I assume) is added by autoconf. 4. The compiler complained when lround() in lpc.c was static, so it is no longer static. 5. Additional scattered linking directives (and reordering) (particularly FLAC, grabbag, and replaygain_analysis) were necessary to build some of the components. 6. The Makefile.lite build system benefited from some cleanup, particularly by rigorously defining all entries, factoring redundancy, and establishing dependencies. (Some typos were fixed too.) 7. Shared objects on Windows use .dll, not .so. (Added *.dll, *.dylib, and *.exe to .gitignore.) 8. To allow more freedom using Makefile.lite without configure, I added the variables USE_OGG and USE_ICONV which can toggle these two components in the build process. ex: make -f Makefile.lite examples USE_OGG=0 USE_ICONV=0 These improvements make use of some use-time Makefile variable expansion. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Fix a regression that severely impacted compression levels.Erik de Castro Lopo2012-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | Regression was introducted in commit 8bbbf56403808ff75126cd0840a936aedbc4113b (Feb 1 19:58:09 2012) when fixing compiler warnings. In src/libFLAC/lpc.c the line: ref[i] = (r/=err); was erroniously removed because the left hand side, ref[i] was never used. Obviously, the correct thing to do was to replace that line with: r /= err; This code has not been officially released. The only people who would have been affected are people who compiled FLAC from git between February and now. The only adverse affect of this error was that compression ratio would have been severely compromised. No audio is lost, and if anyone has a file that compressed with a bad version of FLAC can decompress it to WAV and then re-compress with a fixed version.
* src/libFLAC/lpc.c : Include <inttypes.h> so compiling debug version works.Erik de Castro Lopo2012-05-081-0/+1
|
* Update and improve autotools buildCristian Rodríguez2012-04-081-14/+14
| | | | | | | | | | | - INCLUDES is deprecated, and CPPFLAGS is an user-defined variable, use the proper AM_CPPFLAGS instead - Remove FLAC__INLINE definition, providing proper replacement for MSVC compilers. - Detect if we have C99 's lround and provide a replacement for windows...
* Fix more printf formatting issues and remove un-necessary casts.Erik de Castro Lopo2012-02-011-33/+6
|
* Fix compiler warnings.Erik de Castro Lopo2012-02-011-2/+1
|
* add 2009 copyrightJosh Coalson2009-01-071-1/+1
|
* Allow MM:SS:FF and MM:SS.SS time formats in non-CD-DA cuesheets (SF#1947353, ↵Josh Coalson2009-01-071-3/+3
| | | | SF#2182432: https://sourceforge.net/tracker2/?func=detail&aid=1947353&group_id=13478&atid=363478 https://sourceforge.net/tracker2/index.php?func=detail&aid=2182432&group_id=13478&atid=113478)
* update copyright for 2008Josh Coalson2008-02-281-1/+1
|
* 64-bit fixes (SF#1790872: ↵Josh Coalson2007-09-081-28/+28
| | | | https://sourceforge.net/tracker/index.php?func=detail&aid=1790872&group_id=13478&atid=113478)
* add #define FLAC__LPC_UNROLLED_FILTER_LOOPS for easier selection of filter ↵Josh Coalson2007-07-111-4/+8
| | | | implementation
* fix bug with negative indexingJosh Coalson2007-06-141-28/+28
|
* window the integer_signal instead of real_signal, remove unused real_signal ↵Josh Coalson2007-04-041-1/+1
| | | | from datapath