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.
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>
* 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>
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>
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>
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>
* 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>
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.
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>
* 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>