FFmpeg
|
Dithered Audio Sample Quantization. More...
#include <math.h>
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/lfg.h"
#include "libavutil/mem.h"
#include "libavutil/samplefmt.h"
#include "audio_convert.h"
#include "dither.h"
#include "internal.h"
Go to the source code of this file.
Data Structures | |
struct | DitherState |
struct | DitherContext |
Macros | |
#define | MUTE_THRESHOLD_SEC 0.000333 |
#define | S16_SCALE 32753.0f |
#define | LFG_SCALE (1.0f / (2.0f * INT32_MAX)) |
#define | SQRT_1_6 0.40824829046386301723f |
Variables | |
static const float | ns_48_coef_b [4] |
static const float | ns_48_coef_a [4] |
static const float | ns_44_coef_b [4] |
static const float | ns_44_coef_a [4] |
Dithered Audio Sample Quantization.
Converts from dbl, flt, or s32 to s16 using dithering.
Definition in file dither.c.
#define MUTE_THRESHOLD_SEC 0.000333 |
Definition at line 77 of file dither.c.
Referenced by ff_dither_alloc().
#define S16_SCALE 32753.0f |
Definition at line 81 of file dither.c.
Referenced by quantize_c(), and quantize_triangular_ns().
#define LFG_SCALE (1.0f / (2.0f * INT32_MAX)) |
Definition at line 84 of file dither.c.
Referenced by dither_int_to_float_rectangular_c(), and dither_int_to_float_triangular_c().
#define SQRT_1_6 0.40824829046386301723f |
Definition at line 130 of file dither.c.
Referenced by dither_highpass_filter().
|
static |
Definition at line 104 of file dither.c.
Referenced by dither_init().
|
static |
Definition at line 111 of file dither.c.
Referenced by dither_init().
|
static |
Definition at line 123 of file dither.c.
Referenced by dither_init(), and ff_convert_dither().
|
static |
Definition at line 132 of file dither.c.
Referenced by generate_dither_noise().
|
static |
Definition at line 141 of file dither.c.
Referenced by convert_samples(), and ff_dither_alloc().
|
static |
Definition at line 171 of file dither.c.
Referenced by convert_samples().
|
static |
Definition at line 210 of file dither.c.
Referenced by ff_convert_dither().
int ff_convert_dither | ( | DitherContext * | c, |
AudioData * | dst, | ||
AudioData * | src | ||
) |
Convert audio sample format with dithering.
c | DitherContext |
dst | destination audio data |
src | source audio data |
void ff_dither_free | ( | DitherContext ** | c | ) |
Free a DitherContext.
c | DitherContext |
Definition at line 311 of file dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 328 of file dither.c.
Referenced by ff_dither_alloc().
DitherContext* ff_dither_alloc | ( | AVAudioResampleContext * | avr, |
enum AVSampleFormat | out_fmt, | ||
enum AVSampleFormat | in_fmt, | ||
int | channels, | ||
int | sample_rate, | ||
int | apply_map | ||
) |
Allocate and initialize a DitherContext.
The parameters in the AVAudioResampleContext are used to initialize the DitherContext.
avr | AVAudioResampleContext |
|
static |
Definition at line 88 of file dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 92 of file dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 96 of file dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 100 of file dither.c.
Referenced by ff_dither_alloc().