Mercurial > libavcodec.hg
comparison avcodec.h @ 8778:bdb11e2330d1 libavcodec
Move doxy for public resample2 functions to the public header.
author | michael |
---|---|
date | Mon, 09 Feb 2009 15:31:08 +0000 |
parents | 2a43b46067c4 |
children | 062adf954a56 |
comparison
equal
deleted
inserted
replaced
8777:3c30dd66baea | 8778:bdb11e2330d1 |
---|---|
2446 ReSampleContext *audio_resample_init(int output_channels, int input_channels, | 2446 ReSampleContext *audio_resample_init(int output_channels, int input_channels, |
2447 int output_rate, int input_rate); | 2447 int output_rate, int input_rate); |
2448 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); | 2448 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); |
2449 void audio_resample_close(ReSampleContext *s); | 2449 void audio_resample_close(ReSampleContext *s); |
2450 | 2450 |
2451 | |
2452 /** | |
2453 * Initializes an audio resampler. | |
2454 * Note, if either rate is not an integer then simply scale both rates up so they are. | |
2455 */ | |
2451 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); | 2456 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); |
2457 | |
2458 /** | |
2459 * resamples. | |
2460 * @param src an array of unconsumed samples | |
2461 * @param consumed the number of samples of src which have been consumed are returned here | |
2462 * @param src_size the number of unconsumed samples available | |
2463 * @param dst_size the amount of space in samples available in dst | |
2464 * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. | |
2465 * @return the number of samples written in dst or -1 if an error occurred | |
2466 */ | |
2452 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); | 2467 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); |
2468 | |
2469 | |
2470 /** | |
2471 * Compensates samplerate/timestamp drift. The compensation is done by changing | |
2472 * the resampler parameters, so no audible clicks or similar distortions occur | |
2473 * @param compensation_distance distance in output samples over which the compensation should be performed | |
2474 * @param sample_delta number of output samples which should be output less | |
2475 * | |
2476 * example: av_resample_compensate(c, 10, 500) | |
2477 * here instead of 510 samples only 500 samples would be output | |
2478 * | |
2479 * note, due to rounding the actual compensation might be slightly different, | |
2480 * especially if the compensation_distance is large and the in_rate used during init is small | |
2481 */ | |
2453 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); | 2482 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); |
2454 void av_resample_close(struct AVResampleContext *c); | 2483 void av_resample_close(struct AVResampleContext *c); |
2455 | 2484 |
2456 /** | 2485 /** |
2457 * Allocate memory for a picture. Call avpicture_free to free it. | 2486 * Allocate memory for a picture. Call avpicture_free to free it. |