[FFmpeg-devel] [PATCH] new av_audio_resample

aviad rozenhek aviadr1
Sat Oct 3 13:19:31 CEST 2009


>
> maybe ...
>
> i really have no strong oppinon on this it just feels all a little like
> random hacking with no clear view of the goal.
>
> Maybe we should sit down and think of a ideal (fast&simple) audio resample
> and convert API (like swscale or imgconvert) and then implement that with
> the pieces we have already but keep these pieces private
>
> we also could keep things seperated from a users point of view, like
> channel number changing/mixing, sample type convertion, resampling
> but this would be harder to use for the user as she would have to deal
> with buffering and all the stuff between ...
>
>
being a rabid user of libav* i'm waiting for this functionality to be
realized for some time now.
especially being able to downsample 5.1 audio to stereo.

fortunately it seems that most of the code is already written and just needs
reorganization, refactoring and cleanup.
if so I believe myself capable of providing the necessary patches. something
in the lines of the current
av_resample_init/av_audio_resample<http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/avcodec_8h.html#e32b903dc605d61472a65e0dd230df02>
 API:

AVAudioResampleCtx*
av_audio_resample_init<http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/avcodec_8h.html#e32b903dc605d61472a65e0dd230df02>2
(int
output_channels, int input_channels, int output_rate, int input_rate, enum
SampleFormat<http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/avcodec_8h.html#e39c36a097f22514400136509407dad2>
sample_fmt_out,
enum SampleFormat<http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/avcodec_8h.html#e39c36a097f22514400136509407dad2>
 sample_fmt_in);
int av_audio_resample2(AVAudioResampleCtx* context, uint8_t* dst, uint8_t*
src, int *consumed, int src_size, int dst_size);
void av_audio_resample_close2(AVAudioResampleCtx* context);

I didnt include the parameters filter_length, log2_phase_count, linear,
cutoff because they are "advanced" and in most cases the defaults should be
used anyway.
hopefully this  API will be able to remix channels, change sample format and
change rates in one swoop.
I might need just a little hand-holding at first as I'm not familiar with
all the gritty details of audio manipulation.



More information about the ffmpeg-devel mailing list