Mercurial > libavcodec.hg
comparison avcodec.h @ 8806:cbeaa8c0fe4f libavcodec
extend resampling API, add S16 internal conversion
| author | bcoudurier |
|---|---|
| date | Wed, 11 Feb 2009 22:57:10 +0000 |
| parents | 062adf954a56 |
| children | 2184b34803e5 |
comparison
equal
deleted
inserted
replaced
| 8805:eda229beb608 | 8806:cbeaa8c0fe4f |
|---|---|
| 28 | 28 |
| 29 #include <errno.h> | 29 #include <errno.h> |
| 30 #include "libavutil/avutil.h" | 30 #include "libavutil/avutil.h" |
| 31 | 31 |
| 32 #define LIBAVCODEC_VERSION_MAJOR 52 | 32 #define LIBAVCODEC_VERSION_MAJOR 52 |
| 33 #define LIBAVCODEC_VERSION_MINOR 14 | 33 #define LIBAVCODEC_VERSION_MINOR 15 |
| 34 #define LIBAVCODEC_VERSION_MICRO 0 | 34 #define LIBAVCODEC_VERSION_MICRO 0 |
| 35 | 35 |
| 36 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 36 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 37 LIBAVCODEC_VERSION_MINOR, \ | 37 LIBAVCODEC_VERSION_MINOR, \ |
| 38 LIBAVCODEC_VERSION_MICRO) | 38 LIBAVCODEC_VERSION_MICRO) |
| 2441 struct ReSampleContext; | 2441 struct ReSampleContext; |
| 2442 struct AVResampleContext; | 2442 struct AVResampleContext; |
| 2443 | 2443 |
| 2444 typedef struct ReSampleContext ReSampleContext; | 2444 typedef struct ReSampleContext ReSampleContext; |
| 2445 | 2445 |
| 2446 ReSampleContext *audio_resample_init(int output_channels, int input_channels, | 2446 #if LIBAVCODEC_VERSION_MAJOR < 53 |
| 2447 int output_rate, int input_rate); | 2447 /** |
| 2448 * @deprecated Use av_audio_resample_init() instead. | |
| 2449 */ | |
| 2450 attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels, | |
| 2451 int output_rate, int input_rate); | |
| 2452 #endif | |
| 2453 /** | |
| 2454 * Initializes audio resampling context | |
| 2455 * | |
| 2456 * @param output_channels number of output channels | |
| 2457 * @param input_channels number of input channels | |
| 2458 * @param output_rate output sample rate | |
| 2459 * @param input_rate input sample rate | |
| 2460 * @param sample_fmt_out requested output sample format | |
| 2461 * @param sample_fmt_in input sample format | |
| 2462 * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq | |
| 2463 * @param log2_phase_count log2 of the number of entries in the polyphase filterbank | |
| 2464 * @param linear If 1 then the used FIR filter will be linearly interpolated | |
| 2465 between the 2 closest, if 0 the closest will be used | |
| 2466 * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate | |
| 2467 * @return allocated ReSampleContext, NULL if error occured | |
| 2468 */ | |
| 2469 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, | |
| 2470 int output_rate, int input_rate, | |
| 2471 enum SampleFormat sample_fmt_out, | |
| 2472 enum SampleFormat sample_fmt_in, | |
| 2473 int filter_length, int log2_phase_count, | |
| 2474 int linear, double cutoff); | |
| 2475 | |
| 2448 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); | 2476 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); |
| 2449 void audio_resample_close(ReSampleContext *s); | 2477 void audio_resample_close(ReSampleContext *s); |
| 2450 | 2478 |
| 2451 | 2479 |
| 2452 /** | 2480 /** |
