Commit Graph

506 Commits

Author SHA1 Message Date
Erik de Castro Lopo
46d3a4c6f1 Couple of minor tweaks
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-30 05:10:58 +11:00
Erik de Castro Lopo
e4399a02ae Whitespace only
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-25 09:39:34 +11:00
Thomas Zander
7189069e5e Explicitly use base class virtual methods; silence unnecessary warning
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-12-25 07:32:17 +11:00
Erik de Castro Lopo
a51b27c0ed Remove (defined _MSC_VER) from cpp workaround
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-10 06:12:19 +11:00
Erik de Castro Lopo
d9ae5e9128 libFLAC: Add function safe_realloc_()
The new function wraps, realloc() and if the realloc() fails, it
free()s the old pointer.

This is an improvement on the potential realloc() memory leak that
was fixed in 15a9062609.

Still needs fuzzing to validate it.
2015-08-22 19:39:37 +10:00
Erik de Castro Lopo
1123087821 Compat: Fix for MSVC deprecated functions
According to MSDN, stricmp and strnicmp functions are deprecated
since MSVC 2005 and _stricmp/_strnicmp should be used instead.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-08-09 08:42:41 +10:00
Erik de Castro Lopo
7c3cd3d908 Update grabbag tests to work out-of-tree. 2015-02-15 20:37:40 +11:00
Erik de Castro Lopo
eb753ae5b4 Remove traiing whitespace (mostly .c and .h files).
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-12-05 05:52:30 +11:00
Zoë Blade
7b757e46f2 Fix some minor word duplication
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-12-03 21:43:03 +11:00
Erik de Castro Lopo
39d9791b03 More date fixes. 2014-11-25 20:02:22 +11:00
Erik de Castro Lopo
1437391577 Update copyright years to include 2014. 2014-11-25 13:04:30 +11:00
Erik de Castro Lopo
b7d13c0716 include/share/endswap.h : Fix usage of HAVE_BSWAP16.
The code was incorrectly using #ifndef on a value that was always defined
to a value of either 0 or 1.
2014-11-12 07:06:20 -08:00
Martijn van Beurden
3af2f2b39c Update documentation for new compression presets
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-11 06:20:43 -08:00
Ralph Giles
7a671e7c41 Use a configure check for bswap16 instead of gcc version #ifdefs.
Fixes a build problem on apple clang.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-04 21:18:48 -08:00
Erik de Castro Lopo
1c7e3f100f Windows specific vsnprintf fixes.
* Changes flac_snprintf (in src/share/grabbag/snprintf.c) and its copy
  local_snprintf (src/libFLAC/metadata_iterators.c) to be almost sane.

* Adds flac_vsnprintf (src/share/grabbag/snprintf.c) and its copy
  local_vsnprintf (src/share/win_utf8_io/win_utf8_io.c).

* Changes stats_print_info in src/flac/utils.c so it uses flac_vsnprintf
  instead of vsnprintf. This makes return value checking unnecessary.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-22 18:29:36 +10:00
Martijn van Beurden
29a28338c3 Add partial_tukey and punchout_tukey apodization functions
Adds two new apodization functions that seem to perform better than
the apodization functions currently in the codebase and fixes three
existing windows as well.

Its important to note that this patch only affects the encoder stage
that evaluates various possible predictors. Audio encoded with these
new windows will still decode with existing legacy decoders.

= Theory =
These functions are used to window the  audio data at the predictor
stage. These news functions enable the use of only part of the signal
to generate a predictor. This helps  because short transients can
introduce noise into the predictor. The  predictor becomes very good
at prediciting one part of the  signal, instead of mediocre for the
whole block.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-09-22 18:03:24 +10:00
Erik de Castro Lopo
b373c8ecb4 Minor clean up of win_utf8_io.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 08:06:48 +10:00
Erik de Castro Lopo
7c66452886 include/share/endswap.h : Improvements to fallthrough ENDSWAP_*.
According to patch author GCC can optimize expressions like
"(a<<8)|(a>>8)", but has problems with "(a<<8)+(a>>8)".

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-08-09 12:49:38 +10:00
Erik de Castro Lopo
b08c520d33 include/share/endswap.h : Fix default ENDSWAP_16.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-07-13 20:37:00 +10:00
Ralph Giles
22d4893d28 Fix bswap16 issue on Debian 6.
Versions of GCC prior to 4.8 didn't provide an implementation
of __builtin_bswap16 on x86_64. Detect those versions and
supply a fallback implementation. A cleaner fix would be
to detect bswap16 independently of bswap32 in configure
and handle them separately.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-07-03 18:59:49 +10:00
Erik de Castro Lopo
0d1cb19525 include/share/endswap.h : Fix fallback ENDSWAP_16 macro. 2014-06-30 09:20:09 +10:00
Erik de Castro Lopo
699e7c457a include/share/endswap.h : Add endswapping of 16 bit values.
Also add macros H2LE_16 and H2LE_32, which do host to little-endian
swapping of 16 and 32 bit values respectively.
2014-06-29 20:20:06 +10:00
Erik de Castro Lopo
db1619d4f3 Underscore fixes.
* Replace _declspec with __declspec.
* Replace __wgetmainargs_ with __wgetmainargs_t and __wgetmainargs
  with wgetmainargs because identifiers with leading underscores are
  reserved for the compiler.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-06-28 09:17:32 +10:00
Erik de Castro Lopo
46bedb58d3 Update URLs as nedeed.
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>
2014-06-28 09:12:45 +10:00
Erik de Castro Lopo
731655ad23 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.
2014-06-24 21:01:02 +10:00
Erik de Castro Lopo
b4f7528e9a replaygain_analysis : Switch to standard C sized integer types. 2014-06-16 07:24:43 +10:00
Erik de Castro Lopo
b1b6caf8e1 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>
2014-05-11 03:24:32 -07:00
Erik de Castro Lopo
ce3e09e718 share/compat.h : Remove duplicate flac_stat definition.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-04-11 06:14:40 +10:00
Erik de Castro Lopo
3f5208c300 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.
2014-04-09 18:09:03 +10:00
Erik de Castro Lopo
006b8356d5 Fix all instances of '#if HAVE_CONFIG_H'.
Should be '#ifdef HAVE_CONFIG_H'.

Closes: https://sourceforge.net/p/flac/bugs/410/
2014-03-24 12:06:49 +11:00
Erik de Castro Lopo
4bc1220b32 Move FLAC__STRCASECMP definition to compat.h.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-03-14 15:33:11 +11:00
Erik de Castro Lopo
f5902a474c Fix pragma warning.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-03-14 15:33:11 +11:00
Erik de Castro Lopo
d40e986a1e 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>
2014-01-30 21:49:55 +11:00
Erik de Castro Lopo
b84f07248e compat.h : Simplify definition of FLAC__U64L.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-01-07 21:26:45 +11:00
Erik de Castro Lopo
cf28c0144b 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>
2013-10-10 18:24:19 +11:00
Erik de Castro Lopo
ecd0acba75 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>
2013-10-04 01:41:48 +10:00
Erik de Castro Lopo
31a79d7e9a Move M_PI definition to include/share/compat.h.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2013-09-27 03:05:06 +10:00
Erik de Castro Lopo
95552e11ba Fix numerous warnings arising from addition of -Weffc++. 2013-09-15 18:10:55 +10:00
Erik de Castro Lopo
ce6832bb62 Move defintion of M_LN2 to include/share/compat.h. 2013-09-07 22:00:23 +10:00
Erik de Castro Lopo
3ece67d71f include/share/compat.h : Remove deinition of restrict.
Wasn't being used anywhere in the code and clashes with a symbol in
MSVC.

Suggested-by: lvqcl <lvqcl.mail@gmail.com>
2013-09-01 10:32:52 +10:00
Ulrich Klauer
cd4ddabe0f Language fix: "difference licenses"
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 18:08:57 +10:00
Erik de Castro Lopo
b1982fbc5f Set version to 1.3.0 and update coyprights throughout. 2013-05-26 19:17:53 +10:00
Martijn van Beurden
d4b68b2ba5 Replace dead anchor
This fixes a wrong link (dead anchor) in the Doxygen api documentation

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-25 16:56:35 +10:00
Erik de Castro Lopo
52fab8ba7e Win utf8 treatment for CreateFile.
Patch from Janne Hyvärinen <cse@sci.fi>.
2013-04-21 17:53:07 +10:00
Erik de Castro Lopo
0b736a5605 Fix compiler warnings related to win utf8 stuff. 2013-04-21 17:24:59 +10:00
Erik de Castro Lopo
d35b21e7b9 include/share/compat.h : Include cleanup.
Patch from Janne Hyvärinen <cse@sci.fi>.
2013-04-07 18:41:24 +10:00
Erik de Castro Lopo
e8d7b7f5f9 Fix Windows SIZE_T_MAX definition.
Problem reported by Ulrich Klauer <ulrich@chirlu.de>.
Patch from Janne Hyvärinen <cse@sci.fi>.
2013-04-07 18:12:35 +10:00
Erik de Castro Lopo
b9574fe589 Fix a bunch of compiler warnings (mainly MinGW). 2013-04-07 13:44:45 +10:00
Erik de Castro Lopo
f44c353e59 Two small patches for utf8 I/O.
Thanks to LRN <lrn1986@gmail.com>.
2013-04-02 06:27:12 +11:00
Erik de Castro Lopo
c7603948de include/share/Makefile.am : Add win_utf8_io.h. 2013-04-02 06:05:47 +11:00