John Regan
a482c798ad
pcm: declare IsSilentSample as const
...
GNU libstdc++ declares cmath functions as constexpr, but libc++ does
not. The C++ standards state the standard library functions should not
be declared constexpr unless explicitly required.
2023-05-24 15:05:19 -04:00
Max Kellermann
bc51bc2933
pcm/Normalizer: add method Reset()
2023-03-13 13:54:12 +01:00
Max Kellermann
f547a56b1d
pcm/Normalizer: use Traits::long_type
2023-03-13 13:51:27 +01:00
Max Kellermann
1f6637d49a
pcm/Normalizer: add constant SHIFT
2023-03-13 13:49:25 +01:00
Max Kellermann
de155a740c
pcm/Normalizer: convert peakPos to std::size_t
2023-03-13 13:47:04 +01:00
Max Kellermann
f323fc48d7
pcm/Normalizer: eliminate the local variable slot
2023-03-13 13:45:28 +01:00
Max Kellermann
2ea634c302
pcm/Normalizer: replace the gain
array with a simple prev_gain
variable
2023-03-13 13:44:45 +01:00
Max Kellermann
c0d38d941a
pcm/Normalizer: split the normalization loop
...
Performance improvement because the ramp code is now moved out of the
hot code path, allowing the compiler to vectorize.
2023-03-13 13:38:19 +01:00
Max Kellermann
d7f2d90fd3
pcm/Normalizer: no in-place editing, separate src/dest parameters
...
This eliminates the memcpy() call from NormalizeFilter::FilterPCM().
2023-03-13 13:37:49 +01:00
Max Kellermann
8ea9b89321
pcm/Normalizer: use std::span
2023-03-13 13:16:44 +01:00
Max Kellermann
738254b2fc
pcm/Normalizer: use SampleTraits
2023-03-13 12:42:37 +01:00
Max Kellermann
fcc9a98cad
pcm/Normalizer: use PcmClamp()
2023-03-13 12:42:36 +01:00
Max Kellermann
dcf0a3e475
pcm/Normalizer: remove clipped
(only written to, never read)
2023-03-13 12:42:34 +01:00
Max Kellermann
e990d6eecc
pcm/Normalizer: make variables more local
2023-03-13 12:42:31 +01:00
Max Kellermann
941636b87b
pcm/Normalizer: eliminate local variable ap
2023-03-13 12:31:16 +01:00
Max Kellermann
1298a82f4f
pcm/Normalizer: use std::size_t
2023-03-13 12:31:16 +01:00
Max Kellermann
e6fedcbd10
pcm/Normalizer: expose the class, convert functions to methods
2023-03-13 12:25:09 +01:00
Max Kellermann
48c8c7daf5
pcm/Normalizer: move code to ctor/dtor
2023-03-13 12:25:09 +01:00
Max Kellermann
6e5d9d4490
pcm/Normalizer: hard-code the preferences
2023-03-13 12:25:09 +01:00
Max Kellermann
d2f2dde2e1
pcm/Normalizer: eliminate struct CompressorConfig
2023-03-13 12:25:09 +01:00
Max Kellermann
d0dd035075
pcm/Normalizer: use new/delete instead of malloc()/free()
2023-03-13 12:25:09 +01:00
Max Kellermann
7702643e1b
pcm/Normalizer: remove Compressor_setHistory(), no resize possible
...
This feature was never used.
2023-03-13 12:25:09 +01:00
Max Kellermann
984c9c317a
pcm/Normalizer: add noexcept
2023-03-13 12:25:09 +01:00
Max Kellermann
2d7068a09d
pcm/AudioCompress: convert to C++
2023-03-13 12:25:01 +01:00
Max Kellermann
d712c3b408
pcm/AudioCompress: fold config.h into compress.c
2023-03-13 11:55:44 +01:00
Max Kellermann
0a623122dc
pcm/AudioCompress: add SPDX header
2023-03-13 11:40:46 +01:00
Max Kellermann
27ba8c181f
pcm/SoxrResampler: require libsoxr 0.1.2 or later
2023-03-10 12:49:57 +01:00
Max Kellermann
941f2ca60d
pcm/{Traits,Dsd*}: use std::byte
2023-03-06 18:44:20 +01:00
Max Kellermann
7a1b996da9
pcm/Dsd2Pcm: use SampleTraits<SampleFormat::DSD>::SILENCE
2023-03-06 18:30:16 +01:00
Max Kellermann
302a571367
pcm/Buffer: use std::byte
2023-03-06 18:22:12 +01:00
Max Kellermann
ec195acf4f
pcm/Interleave: use std::byte
2023-03-06 18:22:10 +01:00
Max Kellermann
e602bcf41e
pcm/ReplayGainAnalyzer: remove GCC version checks, assume proper C++17 support
2023-03-06 16:37:45 +01:00
Max Kellermann
42f6a0441c
use [[gnu::...]] attributes
2023-03-06 16:14:15 +01:00
Max Kellermann
148aca23be
use SPDX IDs, replacing the long copyright headers
2023-03-06 14:59:48 +01:00
Max Kellermann
fa58db798b
lib/fmt/RuntimeError: new library
...
Replacing FormatRuntimeError().
2022-11-29 14:10:34 +01:00
Max Kellermann
cc0def15c4
Copyright year 2022
2022-07-14 17:59:35 +02:00
Max Kellermann
4ce1dae673
pcm/*: use std::span instead of ConstBuffer
2022-07-04 18:11:21 +02:00
Max Kellermann
f66315d2de
MusicChunk: use std::span
2022-05-20 11:15:45 +02:00
Max Kellermann
84e5da4bf0
pcm/Silence: use std::span
2022-05-20 11:15:45 +02:00
Max Kellermann
fc6c274c97
pcm/{Dop,Dsd*}: explicitly capture "this"
...
Implicit capturing is deprecated in C++20.
2022-05-19 13:25:02 +02:00
Max Kellermann
35c11afd54
player/Thread: add option "mixramp_analyzer"
2021-12-06 23:06:08 +01:00
Max Kellermann
b6ba17a865
Merge branch 'v0.23.x'
2021-12-06 21:32:48 +01:00
Max Kellermann
713c7585b5
pcm/MixRampAnalyzer: a MixRamp implementation
2021-12-06 21:09:28 +01:00
Max Kellermann
f12c25b7ae
pcm/ReplayGainAnalyzer: new library
2021-12-06 21:06:19 +01:00
Rosen Penev
4e276256c0
more braced init list conversion
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-12-06 09:16:04 +01:00
Max Kellermann
9262b24504
AudioCompress: move to pcm/
2021-12-03 16:04:59 +01:00
Rosen Penev
9bcd425a85
array conversions
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 01:38:10 -08:00
Max Kellermann
b22d7218aa
command/player, ...: use decimal notation
...
During the libfmt migration, I converted "%1.3f" to just "{:1.3}"
without the "f" suffix, but libfmt defaults to scientific notation,
which can break some MPD clients.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1291
2021-10-18 16:54:53 +02:00
Max Kellermann
72f6e018e7
Log: remove the obsolete printf-style functions
2021-10-13 17:41:19 +02:00
Max Kellermann
f510564d9d
more [[gnu::...]] attributes
2021-10-13 12:07:05 +02:00