Skip to content

Commit 274b0b4

Browse files
committed
Release 1.0.25
* Several updates of the dspu::LoudnessMeter module. * Bugfixes and improvements in shared memory catalog and clients. * Added dspu::Bypass::process_drywet method. * Updated build scripts. * Updated module versions in dependencies.
2 parents fcad152 + 295deb8 commit 274b0b4

File tree

20 files changed

+684
-233
lines changed

20 files changed

+684
-233
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.25 ===
6+
* Several updates of the dspu::LoudnessMeter module.
7+
* Bugfixes and improvements in shared memory catalog and clients.
8+
* Added dspu::Bypass::process_drywet method.
9+
* Updated build scripts.
10+
* Updated module versions in dependencies.
11+
512
=== 1.0.24 ===
613
* Updated build scripts.
714
* Updated module versions in dependencies.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/make -f
22
#
3-
# Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
4-
# (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
3+
# Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
4+
# (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
55
#
66
# This file is part of lsp-dsp-units
77
#

include/lsp-plug.in/dsp-units/const.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@
4343
#define GAIN_AMP_P_24_DB 15.84893 /* +24 dB */
4444
#define GAIN_AMP_P_18_DB 7.943282 /* +18 dB */
4545
#define GAIN_AMP_P_12_DB 3.98107 /* +12 dB */
46+
#define GAIN_AMP_P_11_DB 3.54813 /* +11 dB */
47+
#define GAIN_AMP_P_9_DB 2.81838 /* +9 dB */
48+
#define GAIN_AMP_P_7_DB 2.23872 /* +7 dB */
4649
#define GAIN_AMP_P_6_DB 1.99526 /* +6 dB */
47-
#define GAIN_AMP_P_3_DB 1.412536 /* +3 dB */
50+
#define GAIN_AMP_P_5_DB 1.77828 /* +5 dB */
51+
#define GAIN_AMP_P_3_DB 1.41254 /* +3 dB */
4852
#define GAIN_AMP_0_DB 1.0 /* 0 dB */
4953
#define GAIN_AMP_M_3_DB 0.707946 /* -3 dB */
5054
#define GAIN_AMP_M_6_DB 0.50118 /* -6 dB */

include/lsp-plug.in/dsp-units/ctl/Bypass.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-dsp-units
66
* Created on: 07 дек. 2015 г.
@@ -80,7 +80,7 @@ namespace lsp
8080
* output.
8181
*
8282
* @param dst output buffer
83-
* @param dry dry signal buffer
83+
* @param dry dry signal buffer, optional, can be NULL
8484
* @param wet wet signal buffer
8585
* @param count number of samples to process
8686
*/
@@ -93,13 +93,28 @@ namespace lsp
9393
* output.
9494
*
9595
* @param dst output buffer
96-
* @param dry dry signal buffer
96+
* @param dry dry signal buffer, optional, can be NULL
9797
* @param wet wet signal buffer
9898
* @param wet_gain additional gain to apply to wet signal
9999
* @param count number of samples to process
100100
*/
101101
void process_wet(float *dst, const float *dry, const float *wet, float wet_gain, size_t count);
102102

103+
/**
104+
* Process the signal and apply gain to wet signal. If Bypass is on, then dry signal is passed to output.
105+
* If bypass is off, then wet signal is passed.
106+
* When bypass is in active state, the mix of dry and wet signal is passed to
107+
* output.
108+
*
109+
* @param dst output buffer
110+
* @param dry dry signal buffer, optional, can be NULL
111+
* @param wet wet signal buffer
112+
* @param dry_gain additional gain to apply to dry signal if it is used
113+
* @param wet_gain additional gain to apply to wet signal
114+
* @param count number of samples to process
115+
*/
116+
void process_drywet(float *dst, const float *dry, const float *wet, float dry_gain, float wet_gain, size_t count);
117+
103118
/**
104119
* Enable/disable bypass
105120
* @param bypass bypass value

include/lsp-plug.in/dsp-units/meters/LoudnessMeter.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-dsp-units
66
* Created on: 20 сент. 2023 г.
@@ -39,7 +39,13 @@ namespace lsp
3939
* loudness according to the BS.1770-4 standard specification.
4040
* The meter does not output LKFS (LUFS) values nor LU (Loudness Unit) values.
4141
* Instead, it provides the regular RMS value which then can be converted into
42-
* DBFS, LKFS/LUFS or LU values by applying logarithmic function.
42+
* DBFS, LKFS/LUFS or LU values by applying corresponding logarithmic function.
43+
*
44+
* By default, it uses the standardized K-weighted filter over 400 ms measurement
45+
* window as described by the BS.1770-4 specification.
46+
* If number of channels in the configuration is 1 or 2, then the meter automatically
47+
* sets designation value for inputs to CENTER for mono configuration or LEFT/RIGHT
48+
* for stereo configuration.
4349
*/
4450
class LSP_DSP_UNITS_PUBLIC LoudnessMeter
4551
{
@@ -125,7 +131,7 @@ namespace lsp
125131
* @param max_period maximum measurement period in milliseconds
126132
* @return status of operation
127133
*/
128-
status_t init(size_t channels, float max_period);
134+
status_t init(size_t channels, float max_period = dspu::bs::LUFS_MEASURE_PERIOD_MS);
129135

130136
public:
131137
/**

include/lsp-plug.in/dsp-units/misc/broadcast.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-dsp-units
66
* Created on: 19 сент. 2023 г.
@@ -107,6 +107,11 @@ namespace lsp
107107
constexpr float DB_TO_LU_SHIFT_GAIN = 13.0451777184f;
108108
constexpr float LU_TO_DB_SHIFT_GAIN = 0.0766566789345f;
109109

110+
/**
111+
* According to the standard, the default measuring period is 400 ms.
112+
*/
113+
constexpr float LUFS_MEASURE_PERIOD_MS = 400.0f;
114+
110115
/**
111116
* Return the channel weighting coefficient accoding to BS.1770-4 recommendation
112117
* @param designation channel designation

include/lsp-plug.in/dsp-units/shared/Catalog.h

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace lsp
6767
uint32_t nMagic; // Record type
6868
uint32_t nHash; // Name hash
6969
uint32_t nVersion; // Version of the record
70-
uint32_t nReserved; // Reserved data
70+
uint32_t nKeepAlive; // Keep-alive counter
7171
char sName[NAME_BYTES]; // Unique name of the record
7272
char sId[ID_BYTES]; // The identifier of associated shared segment
7373
} sh_record_t;
@@ -209,6 +209,23 @@ namespace lsp
209209
*/
210210
status_t get(Record *record, const LSPString *name) const;
211211

212+
/**
213+
* Read record from catalog by unique name, create new record if it does not exist
214+
* @param record ponter to store result
215+
* @param name unique name of the record (UTF-8 encoded string)
216+
* @param magic record magic number to create unexisting record
217+
* @return status of operation
218+
*/
219+
status_t get_or_reserve(Record *record, const char *name, uint32_t magic);
220+
221+
/**
222+
* Read record from catalog by unique name, create new record if it does not exist
223+
* @param record ponter to store result
224+
* @param name unique name of the record
225+
* @return status of operation
226+
*/
227+
status_t get_or_reserve(Record *record, const LSPString *name, uint32_t magic);
228+
212229
/**
213230
* Erase record with specified index and version
214231
* @param index index of the record
@@ -225,6 +242,26 @@ namespace lsp
225242
*/
226243
status_t enumerate(lltl::parray<Record> *result, uint32_t magic = 0);
227244

245+
/**
246+
* Mark record as alive
247+
* @param name name of the record to mark keep-alive
248+
* @return status of operation
249+
*/
250+
status_t keep_alive(const LSPString *name);
251+
252+
/**
253+
* Mark record as alive
254+
* @param name name of the record to mark keep-alive
255+
* @return status of operation
256+
*/
257+
status_t keep_alive(const char *name);
258+
259+
/**
260+
* Perform garbage collection: increment keep-alive counter for each used record
261+
* @return status of operation
262+
*/
263+
status_t gc();
264+
228265
public:
229266
/**
230267
* Cleanup the result returned by the enumerate() calls

include/lsp-plug.in/dsp-units/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Define version of headers
2626
#define LSP_DSP_UNITS_MAJOR 1
2727
#define LSP_DSP_UNITS_MINOR 0
28-
#define LSP_DSP_UNITS_MICRO 24
28+
#define LSP_DSP_UNITS_MICRO 25
2929

3030
#if defined(LSP_DSP_UNITS_PUBLISHER)
3131
#define LSP_DSP_UNITS_PUBLIC LSP_EXPORT_MODIFIER

make/configure.mk

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
# (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
# Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
# (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
44
#
55
# This file is part of lsp-dsp-units
66
#
@@ -49,7 +49,7 @@ MERGED_DEPENDENCIES := \
4949
$(TEST_DEPENDENCIES)
5050
UNIQ_MERGED_DEPENDENCIES := $(call uniq, $(MERGED_DEPENDENCIES))
5151
DEPENDENCIES = $(UNIQ_MERGED_DEPENDENCIES)
52-
FEATURES := $(call uniq, $(call subtraction,$(SUB_FEATURES),$(DEFAULT_FEATURES) $(ADD_FEATURES)))
52+
FEATURES := $(sort $(call subtraction,$(SUB_FEATURES),$(DEFAULT_FEATURES) $(ADD_FEATURES)))
5353

5454
# Determine versions
5555
ifeq ($(findstring -devel,$(ARTIFACT_VERSION)),-devel)
@@ -123,6 +123,10 @@ define _modconfig =
123123
$(if $($(name)_OBJ_TEST),, $(eval $(name)_OBJ_TEST := "$($(name)_BIN)/$($(name)_NAME)-test.o"))
124124
$(if $($(name)_MFLAGS),, $(eval $(name)_MFLAGS := $(if $(publisher),,"-D$(name)_BUILTIN -fvisibility=hidden")))
125125

126+
$(if $(HOST_$(name)_NAME),, $(eval HOST_$(name)_NAME := $($(name)_NAME)))
127+
$(if $(HOST_$(name)_DESC),, $(eval HOST_$(name)_DESC := $($(name)_DESC)))
128+
$(if $(HOST_$(name)_URL),, $(eval HOST_$(name)_URL := $($(name)_URL$(X_URL_SUFFIX))))
129+
126130
$(if $(HOST_$(name)_PATH),, $(eval HOST_$(name)_PATH := $(MODULES)/$($(name)_NAME)))
127131
$(if $(HOST_$(name)_INC),, $(eval HOST_$(name)_INC := $(HOST_$(name)_PATH)/include))
128132
$(if $(HOST_$(name)_SRC),, $(eval HOST_$(name)_SRC := $(HOST_$(name)_PATH)/src))
@@ -160,6 +164,10 @@ define hdrconfig =
160164
$(if $($(name)_TESTING),, $(eval $(name)_TESTING := 0))
161165
$(if $($(name)_CFLAGS),, $(eval $(name)_CFLAGS := "$(if $($(name)_INC_OPT),$($(name)_INC_OPT) ,-I )\"$($(name)_INC)\""$(if $(publisher), "-D$(name)_PUBLISHER")))
162166
$(if $($(name)_MFLAGS),, $(eval $(name)_MFLAGS := "-D$(name)_BUILTIN -fvisibility=hidden"))
167+
168+
$(if $(HOST_$(name)_NAME),, $(eval HOST_$(name)_NAME := $($(name)_NAME)))
169+
$(if $(HOST_$(name)_DESC),, $(eval HOST_$(name)_DESC := $($(name)_DESC)))
170+
$(if $(HOST_$(name)_URL),, $(eval HOST_$(name)_URL := $($(name)_URL$(X_URL_SUFFIX))))
163171

164172
$(if $(HOST_$(name)_PATH),, $(eval HOST_$(name)_PATH := $(MODULES)/$($(name)_NAME)))
165173
$(if $(HOST_$(name)_INC),, $(eval HOST_$(name)_INC := $(HOST_$(name)_PATH)/include))
@@ -233,6 +241,8 @@ CONFIG_VARS = \
233241
$(name)_OBJ \
234242
$(name)_OBJ_TEST \
235243
\
244+
HOST_$(name)_NAME \
245+
HOST_$(name)_DESC \
236246
HOST_$(name)_PATH \
237247
HOST_$(name)_INC \
238248
HOST_$(name)_SRC \
@@ -258,8 +268,9 @@ $(CONFIG_VARS): prepare
258268
echo "$(@)=$($(@))" >> "$(CONFIG)"
259269

260270
config: $(CONFIG_VARS)
261-
echo "Architecture: $(ARCHITECTURE_FAMILY)/$(ARCHITECTURE) ($(ARCHITECTURE_CFLAGS))"
262-
echo "Features: $(FEATURES)"
271+
echo "Host architecture: $(HOST_ARCHITECTURE_FAMILY)/$(HOST_ARCHITECTURE) ($(HOST_ARCHITECTURE_CFLAGS))"
272+
echo "Architecture: $(ARCHITECTURE_FAMILY)/$(ARCHITECTURE) ($(ARCHITECTURE_CFLAGS))"
273+
echo "Features: $(FEATURES)"
263274
echo "Configured OK"
264275

265276
help: | pathvars toolvars sysvars

make/functions.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
# (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
# Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
# (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
44
#
55
# This file is part of lsp-dsp-units
66
#

0 commit comments

Comments
 (0)