Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ditherer.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2021 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4/*
5 * This file incorporates work covered by the following copyright and
6 * permission notice:
7 *
8 * ---
9 *
10 * ,--. ,--. ,--. ,--.
11 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2018
12 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
13 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
14 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
15 *
16 * Tracktion Engine is published under a dual [GPL3 (or later)](https://www.gnu.org/licenses/gpl-3.0.en.html)/[Commercial license](https://www.tracktion.com/develop/tracktion-engine).
17 *
18 * ---
19 */
20// clang-format on
21
28#ifndef __AUDIO_DITHER_H__
29#define __AUDIO_DITHER_H__
30
31#include "utils/types.h"
32
42typedef struct Ditherer
43{
44 int random1;
45 int random2;
46 float amp;
47 float offset;
48 float s1;
49 float s2;
50} Ditherer;
51
52void
53ditherer_reset (Ditherer * self, int num_bits);
54
64void
66 Ditherer * self,
67 float * frames,
68 size_t n_frames,
69 channels_t channels);
70
75#endif
void ditherer_process(Ditherer *self, float *frames, size_t n_frames, channels_t channels)
Dither given audio.
unsigned int channels_t
Number of channels.
Definition types.h:44
Ditherer.
Definition ditherer.h:43
Custom types.