avresample.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVRESAMPLE_AVRESAMPLE_H
22 #define AVRESAMPLE_AVRESAMPLE_H
23 
96 #include "libavutil/avutil.h"
98 #include "libavutil/dict.h"
99 #include "libavutil/log.h"
100 
101 #include "libavresample/version.h"
102 
103 #define AVRESAMPLE_MAX_CHANNELS 32
104 
106 
113 };
114 
120 };
121 
129 };
130 
134 unsigned avresample_version(void);
135 
140 const char *avresample_configuration(void);
141 
145 const char *avresample_license(void);
146 
157 const AVClass *avresample_get_class(void);
158 
165 
173 
188 
197 
220 int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
221  double center_mix_level, double surround_mix_level,
222  double lfe_mix_level, int normalize, double *matrix,
224 
237 int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
238  int stride);
239 
258 int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
259  int stride);
260 
289  const int *channel_map);
290 
304 int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
305  int compensation_distance);
306 
351  int out_plane_size, int out_samples, uint8_t **input,
352  int in_plane_size, int in_samples);
353 
368 
385 
403 int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
404 
409 #endif /* AVRESAMPLE_AVRESAMPLE_H */
Kaiser Windowed Sinc.
Definition: avresample.h:119
Do not use dithering.
Definition: avresample.h:123
int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples)
Read samples from the output FIFO.
external API header
int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta, int compensation_distance)
Set compensation for resampling.
32-bit 17.15 fixed-point
Definition: avresample.h:111
int avresample_set_channel_mapping(AVAudioResampleContext *avr, const int *channel_map)
Set a customized input channel mapping.
int stride
Definition: mace.c:144
void avresample_free(AVAudioResampleContext **avr)
Free AVAudioResampleContext and associated AVOption values.
Triangular Dither with Noise Shaping.
Definition: avresample.h:127
double surround_mix_level
surround mix level
const AVClass * avresample_get_class(void)
Get the AVClass for AVAudioResampleContext.
Rectangular Dither.
Definition: avresample.h:124
Triangular Dither with High Pass.
Definition: avresample.h:126
Public dictionary API.
uint8_t
const char * avresample_license(void)
Return the libavresample license.
int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, int normalize, double *matrix, int stride, enum AVMatrixEncoding matrix_encoding)
Generate a channel mixing matrix.
void avresample_close(AVAudioResampleContext *avr)
Close AVAudioResampleContext.
double center_mix_level
center mix level
AVResampleFilterType
Resampling Filter Types.
Definition: avresample.h:116
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an input
audio channel layout utility functions
int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix, int stride)
Set channel mixing matrix.
Triangular Dither.
Definition: avresample.h:125
int avresample_get_delay(AVAudioResampleContext *avr)
Return the number of samples currently in the resampling delay buffer.
int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix, int stride)
Get the current channel mixing matrix.
int avresample_available(AVAudioResampleContext *avr)
Return the number of available samples in the output FIFO.
floating-point
Definition: avresample.h:112
const char * avresample_configuration(void)
Return the libavresample build-time configuration.
Describe the class of an AVClass context structure.
Definition: log.h:50
Blackman Nuttall Windowed Sinc.
Definition: avresample.h:118
int avresample_convert(AVAudioResampleContext *avr, uint8_t **output, int out_plane_size, int out_samples, uint8_t **input, int in_plane_size, int in_samples)
Convert input samples and write them to the output FIFO.
Number of dither types.
Definition: avresample.h:128
AVAudioResampleContext * avresample_alloc_context(void)
Allocate AVAudioResampleContext and set options.
enum AVMatrixEncoding matrix_encoding
matrixed stereo encoding
16-bit 8.8 fixed-point
Definition: avresample.h:110
these buffered frames must be flushed immediately if a new input produces new output(Example:frame rate-doubling filter:filter_frame must(1) flush the second copy of the previous frame, if it is still there,(2) push the first copy of the incoming frame,(3) keep the second copy for later.) If the input frame is not enough to produce output
AVMixCoeffType
Mixing Coefficient Types.
Definition: avresample.h:108
unsigned avresample_version(void)
Return the LIBAVRESAMPLE_VERSION_INT constant.
AVMatrixEncoding
double lfe_mix_level
lfe mix level
AVResampleDitherMethod
Definition: avresample.h:122
int avresample_open(AVAudioResampleContext *avr)
Initialize AVAudioResampleContext.