summaryrefslogtreecommitdiff
path: root/src/libFLAC/include/private
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Prepend compiler flags, fix Clang compiler warningsMartijn van Beurden2022-09-171-1/+1
| | | | | | | | | Because of issue https://github.com/xiph/flac/issues/437 compiler flags are prepended instead of appended, so the user can override them without altering the CMakeLists.txt. Also, Clang doesn't support per-function optimize options, so in CMake the fma file gets that option per-file. This is not supported by automake.
* Introduce subdivide_tukey apodizationMartijn van Beurden2022-08-191-0/+2
| | | | | | | | | | | | | | | 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-2621-21/+21
|
* Add FMA intrinsics for autocorrelation calculationMartijn van Beurden2022-07-252-0/+12
| | | See https://github.com/xiph/flac/pull/387 for details
* Revert "Enable encoder to use INT32_MIN as residual value" (#389)Martijn van Beurden2022-07-131-3/+9
| | | | | | | 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-9/+3
| | | | | | 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-124-1/+11
|
* Add 32-bit decoding capabilityMartijn van Beurden2022-06-123-3/+7
| | | | | | 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
* Improve compute_residual_from_qlp_coefficients datapath selectionMartijn van Beurden2022-05-281-0/+3
| | | | | This bases the selection of the datapath on the actual predictor coefficients instead of on the predictor coefficient precision
* Remove all assembler and intrinsics from decoderMartijn van Beurden2022-05-261-16/+0
| | | | | | | This commit drops all use of assembler and intrinsics from the libFLAC decoder. This is because they are only for 32-bit x86, hard to debug, maintain and fuzz properly, and because the decoder has much greater security risks than the encoder.
* Add ARM64 NEON intrinsics lpc_compute_autocorrelation routinesMartijn van Beurden2022-04-291-0/+5
|
* Adding ARM64 support and optimized Neon implementation (#270)RonenGvili2022-04-291-0/+6
| | | | Add NEON intrinsics routines for lpc_compute_residual_from_qlp_coefficients and lpc_compute_residual_from_qlp_coefficients_wide
* Rework error handling (#283)Martijn van Beurden2022-04-271-0/+2
| | | | | | This commit reworks the code decoding a frame, to add silence when frames are missing and output silence when something other than the frame header seems corrupted. Tests are added to the test suite for this functionality. Also, decoded values are checked to be within bps
* [CMake] Honor WITH_AVXMartijn van Beurden2022-04-261-28/+36
| | | | Fixes https://github.com/xiph/flac/issues/286
* Add checks in parsing metadata blocksMartijn van Beurden2022-04-201-0/+4
| | | | | | | | | | | | | | | | | In parsing certain types of metadata blocks, it was not checked whether certain length fields were at all possible. A small file of 64 byte was enough to let the decoder allocate 4GiB of memory by simply stating a field was 4GiB in length, while metadata blocks in FLAC cannot be larger than 16MiB. This commit adds a mechanism to the bitreader to set a length limit upon reading. This limit is checked at each read, at each memory allocation and after reading the block. In case anything is deemed wrong, parsing metadata is aborted, as 'resyncing' is only possible on audio frames, not on metadata blocks. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37865
* Deduplicate VSX and SSE2 autocorelation calculation codeMartijn van Beurden2022-04-191-2/+2
|
* Switch to autoc[] as doubleMartijn van Beurden2022-04-191-28/+12
| | | | | | | | | | | 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.
* cpu.h: detect AVX/FMA intrinsics availability on clangtmkk2021-07-241-0/+6
| | | | | | | | Previously the FLAC__AVX2_SUPPORTED macro is defined, but actually AVX2 functions are not used when built with clang because flac only uses them when FLAC__AVX_SUPPORTED macro is set. Signed-off-by: NotTsunami
* Do not assume that sys/param.h defines MIN and MAXsezero2019-08-051-0/+2
| | | | One such example is sys/param.h from MinGW.
* Add VSX optimised versions of autocorrelation loopsAnton Blanchard2018-08-201-0/+14
| | | | | | | | 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>
* Add runtime detection of POWER8 and POWER9Anton Blanchard2018-08-201-0/+6
| | | | | | | 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>
* Improve SIMD detection with Visual Studioevpobr2018-06-131-15/+15
| | | | | | 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>
* Update CRC16 for larger data blocks when decoding.Robert Kausch2018-05-211-0/+2
|
* Implement slicing-by-8 CRC16 algorithm.Robert Kausch2018-05-211-4/+4
|
* Remove unused CRC8 functions.Robert Kausch2018-05-201-5/+1
|
* Revert "Add Clang support for FLAC__SSE_TARGET"Erik de Castro Lopo2017-07-191-2/+1
| | | | | | This reverts commit b52fa0ec6dc83ec0f430ff7bd7c80485c45728b0. See: https://github.com/xiph/flac/commit/b52fa0ec6dc83ec0f430ff7bd7c80485c45728b0
* Add Clang support for FLAC__SSE_TARGETC.W. Betts2017-07-151-1/+2
| | | | Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* libFLAC: Fix default flac_max/minErik de Castro Lopo2017-04-191-4/+4
| | | | | There were a number of specialized versions, but the default case defined `MAX` and `MIN` instead of `flac_max` and `flac_min`.
* cpu.c: Merge ia32 and x86_64 CPU info functionsErik de Castro Lopo2017-02-271-16/+1
| | | | | | | | 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>
* SIMD: remove outdated SSE2 codeErik de Castro Lopo2017-02-211-3/+0
| | | | | | | | | 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>
* SIMD: Accelerate decoding of 16 bit FLACErik de Castro Lopo2017-02-191-0/+2
| | | | | | | | | | | | 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>
* cpu.h: Another CPP fixupErik de Castro Lopo2017-02-191-45/+46
| | | | | CPP is minefield. We should simplify CPP wherever possible and work to minimise nesting.
* cpu.h: Fix compiler detectionErik de Castro Lopo2017-02-151-2/+2
| | | | | | 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.
* cpu.h: Add #defines so Clang compiles AVX2Erik de Castro Lopo2017-02-121-4/+21
| | | | Patch-from: <lvqcl.mail@gmail.com>
* bitmath.h: MSVS unsigned fixErik de Castro Lopo2017-01-151-4/+4
| | | | | | | The orignal code had `unsigned long` inside `#ifdef MSVC`. It was then changed to `uint64_t` which was incorrect because on Windows `sizze long == 4`. Change it now to `uint32_t` which is always correct regardless of OS, compiler or architecture.
* bitmath.h: More unsigned fixesErik de Castro Lopo2017-01-151-4/+4
|
* Yet more purging of `unsigned` typeErik de Castro Lopo2017-01-152-3/+3
|
* Purge usage of `unsigned` typeErik de Castro Lopo2017-01-1415-121/+121
| | | | | | | 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>.
* Another bulk update of copyright datesErik de Castro Lopo2016-12-051-1/+1
|
* Bulk update copyright datesErik de Castro Lopo2016-12-0516-16/+16
|
* libFLAC/cpu.c: More cleanup and refactoringErik de Castro Lopo2016-06-261-6/+2
| | | | | | | | | | | | * Split `FLAC__cpu_info` into CPU specific functions. We now have `ia32_cpi_info` and `x86_64_cpu_info` and a simple obvious way to add support for other CPUs. * Improve handling of Android OS. * Remove more #ifdefs where possible. * Compile (syntax and type check) DEBUG output code even when debugging is disabled. * Remove build support for ancient NetBSD version 1.5 (version 1.6 was released in 2002).
* libFLAC/cpu.[ch]: More pre-processor cleanupsErik de Castro Lopo2016-06-261-6/+7
|
* libFLAC/cpu.c: More refactoring and cleanupsErik de Castro Lopo2016-06-261-2/+0
| | | | | | | | * Make `FLAC__cpu_xgetbv_x86` private to cpu.c (and rename it to `cpu_xgetbv_x86` (it wasn't being used anywhere else). * Remove `FLAC__cpu_have_cpuid_x86` altogether as it wasn't actually being used but that was difficult to tell because of all the #ifdef nonsense.
* Fix use of FLAC__HAS_X86INTRIN configure variableErik de Castro Lopo2016-06-203-6/+6
|
* libFLAC: infer cpu type from compiler macrosTim Blechmann2016-05-121-0/+17
| | | | Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Retire FLAC__float and FLAC__double typesThomas Zander2016-02-093-21/+18
| | | | | | | | | | | | 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
* Make AVX and AVX2 instructions a configure optionDave Yeo2016-02-081-0/+2
| | | | | | | | Handy for toolchains or operating systems that don't support AVX or AVX2 like OS/2. Signed-off-by: Dave Yeo <dave.r.yeo@gmail.com> Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Cleanup FLAC__bitmath_silog2()Thomas Zander2016-01-041-7/+2
| | | | | | | | | | | - 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: Support 64bit brword/bwwordErik de Castro Lopo2016-01-041-1/+32
| | | | | | | This patch allows FLAC__BYTES_PER_WORD to be set to 8, but is disabled by default. Patch-from: lvqcl <lvqcl.mail@gmail.com>
* bitmath.h: CleanupsErik de Castro Lopo2015-12-301-14/+12
| | | | | | | | | * Drop support from MSVC earlier than 2005. * Make types of FLAC__clz_uint32() and FLAC__clz_soft_uint32() the same. * Remove un-needed parens. * Cleanup FLAC__bitmath_ilog2_wide(). Patch-from: lvqcl <lvqcl.mail@gmail.com>