mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-30 21:37:53 -04:00
audioconvert: add dither noise even on empty input
When we are asked to add noise bits, don't call the clear function. Make the passthrough and clear-on-empty flags available with a new flag field to make it more extensible. Fixes #5260
This commit is contained in:
parent
1d5391712f
commit
3563728e03
3 changed files with 17 additions and 11 deletions
|
|
@ -221,7 +221,9 @@ struct convert {
|
|||
uint32_t cpu_flags;
|
||||
const char *func_name;
|
||||
|
||||
unsigned int is_passthrough:1;
|
||||
#define CONVERT_FLAG_PASSTHROUGH (1u<<0)
|
||||
#define CONVERT_FLAG_CLEAR_ON_EMPTY (1u<<1)
|
||||
uint32_t flags;
|
||||
|
||||
float scale;
|
||||
uint32_t *random;
|
||||
|
|
@ -282,6 +284,9 @@ static inline uint32_t dither_method_from_label(const char *label)
|
|||
#define convert_clear(conv,...) (conv)->clear(conv, __VA_ARGS__)
|
||||
#define convert_free(conv) (conv)->free(conv)
|
||||
|
||||
#define convert_is_passthrough(conv) SPA_FLAG_IS_SET((conv)->flags, CONVERT_FLAG_PASSTHROUGH)
|
||||
#define convert_is_clear_on_empty(conv) SPA_FLAG_IS_SET((conv)->flags, CONVERT_FLAG_CLEAR_ON_EMPTY)
|
||||
|
||||
#define DEFINE_NOISE_FUNCTION(name,arch) \
|
||||
void conv_noise_##name##_##arch(struct convert *conv, float *noise, \
|
||||
uint32_t n_samples)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue