#include "libavutil/common.h"
#include "libavutil/libm.h"
#include "libavutil/log.h"
#include "internal.h"
#include "audio_data.h"
#include "resample_template.c"
Go to the source code of this file.
Data Structures | |
struct | ResampleContext |
Defines | |
#define | CONFIG_RESAMPLE_DBL |
#define | CONFIG_RESAMPLE_FLT |
#define | CONFIG_RESAMPLE_S32 |
Functions | |
static double | bessel (double x) |
static int | build_filter (ResampleContext *c) |
ResampleContext * | ff_audio_resample_init (AVAudioResampleContext *avr) |
Allocate and initialize a ResampleContext. | |
void | ff_audio_resample_free (ResampleContext **c) |
Free a ResampleContext. | |
int | avresample_set_compensation (AVAudioResampleContext *avr, int sample_delta, int compensation_distance) |
Set compensation for resampling. | |
static int | resample (ResampleContext *c, void *dst, const void *src, int *consumed, int src_size, int dst_size, int update_ctx) |
int | ff_audio_resample (ResampleContext *c, AudioData *dst, AudioData *src, int *consumed) |
Resample audio data. | |
int | avresample_get_delay (AVAudioResampleContext *avr) |
Return the number of samples currently in the resampling delay buffer. |
#define CONFIG_RESAMPLE_DBL |
Definition at line 53 of file resample.c.
#define CONFIG_RESAMPLE_FLT |
Definition at line 58 of file resample.c.
#define CONFIG_RESAMPLE_S32 |
Definition at line 63 of file resample.c.
int avresample_get_delay | ( | AVAudioResampleContext * | avr | ) |
Return the number of samples currently in the resampling delay buffer.
When resampling, there may be a delay between the input and output. Any unconverted samples in each call are stored internally in a delay buffer. This function allows the user to determine the current number of samples in the delay buffer, which can be useful for synchronization.
avr | audio resample context |
Definition at line 452 of file resample.c.
Referenced by filter_samples(), get_delay(), main(), and request_frame().
int avresample_set_compensation | ( | AVAudioResampleContext * | avr, | |
int | sample_delta, | |||
int | compensation_distance | |||
) |
Set compensation for resampling.
This can be called anytime after avresample_open(). If resampling was not being done previously, the AVAudioResampleContext is closed and reopened with resampling enabled. In this case, any samples remaining in the output FIFO and the current channel mixing matrix will be restored after reopening the context.
avr | audio resample context | |
sample_delta | compensation delta, in samples | |
compensation_distance | compensation distance, in samples |
Definition at line 246 of file resample.c.
Referenced by filter_samples().
static double bessel | ( | double | x | ) | [static] |
Definition at line 72 of file resample.c.
static int build_filter | ( | ResampleContext * | c | ) | [static] |
Definition at line 89 of file resample.c.
int ff_audio_resample | ( | ResampleContext * | c, | |
AudioData * | dst, | |||
AudioData * | src, | |||
int * | consumed | |||
) |
Resample audio data.
Changes the sample rate.
c | ResampleContext | |
dst | destination audio data | |
src | source audio data | |
consumed | number of samples consumed from the source |
Definition at line 397 of file resample.c.
Referenced by avresample_convert().
void ff_audio_resample_free | ( | ResampleContext ** | c | ) |
Free a ResampleContext.
c | ResampleContext |
Definition at line 237 of file resample.c.
Referenced by avresample_close().
ResampleContext* ff_audio_resample_init | ( | AVAudioResampleContext * | avr | ) |
Allocate and initialize a ResampleContext.
The parameters in the AVAudioResampleContext are used to initialize the ResampleContext.
avr | AVAudioResampleContext |
Definition at line 145 of file resample.c.
Referenced by avresample_open().
static int resample | ( | ResampleContext * | c, | |
void * | dst, | |||
const void * | src, | |||
int * | consumed, | |||
int | src_size, | |||
int | dst_size, | |||
int | update_ctx | |||
) | [static] |
Definition at line 320 of file resample.c.
Referenced by avfilter_register_all(), ff_audio_resample(), and swr_convert_internal().