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 |
Typedefs | |
typedef struct DitherState | DitherState |
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] |
Detailed Description
Dithered Audio Sample Quantization.
Converts from dbl, flt, or s32 to s16 using dithering.
Definition in file libavresample/dither.c.
Macro Definition Documentation
#define LFG_SCALE (1.0f / (2.0f * INT32_MAX)) |
Definition at line 84 of file libavresample/dither.c.
Referenced by dither_int_to_float_rectangular_c(), and dither_int_to_float_triangular_c().
#define MUTE_THRESHOLD_SEC 0.000333 |
Definition at line 77 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
#define S16_SCALE 32753.0f |
Definition at line 81 of file libavresample/dither.c.
Referenced by quantize_c(), and quantize_triangular_ns().
#define SQRT_1_6 0.40824829046386301723f |
Definition at line 130 of file libavresample/dither.c.
Referenced by dither_highpass_filter().
Typedef Documentation
typedef struct DitherState DitherState |
Function Documentation
|
static |
Definition at line 210 of file libavresample/dither.c.
Referenced by ff_convert_dither().
|
static |
Definition at line 132 of file libavresample/dither.c.
Referenced by generate_dither_noise().
|
static |
Definition at line 328 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 104 of file libavresample/dither.c.
Referenced by dither_init().
|
static |
Definition at line 111 of file libavresample/dither.c.
Referenced by dither_init().
int ff_convert_dither | ( | DitherContext * | c, |
AudioData * | dst, | ||
AudioData * | src | ||
) |
Convert audio sample format with dithering.
- Parameters
-
c DitherContext dst destination audio data src source audio data
- Returns
- 0 if ok, negative AVERROR code on failure
Definition at line 241 of file libavresample/dither.c.
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.
- Parameters
-
avr AVAudioResampleContext
- Returns
- newly-allocated DitherContext
Definition at line 344 of file libavresample/dither.c.
void ff_dither_free | ( | DitherContext ** | c | ) |
Free a DitherContext.
- Parameters
-
c DitherContext
Definition at line 311 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 141 of file libavresample/dither.c.
Referenced by convert_samples(), and ff_dither_alloc().
|
static |
Definition at line 123 of file libavresample/dither.c.
Referenced by dither_init(), and ff_convert_dither().
|
static |
Definition at line 171 of file libavresample/dither.c.
Referenced by convert_samples().
Variable Documentation
|
static |
Definition at line 100 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 96 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 92 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
|
static |
Definition at line 88 of file libavresample/dither.c.
Referenced by ff_dither_alloc().
Generated on Mon Nov 18 2024 06:52:05 for FFmpeg by 1.8.11