From 2c378c71a4d9b1df382db9aa787b646628b4e3f9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 9 Mar 2013 09:30:26 +0100 Subject: [PATCH] audio: add af_lavrresample, remove old resampling filters Remove `af_resample` and `af_lavcresample`. The former is a mess while the latter uses an API that was long deprecated in libavcodec and is now removed. Add new filter af_lavrresample which uses libavresample. `af_lavrresample` has roughly the same features and structure as `af_lavcresample` had. Libavresample is now a mandatory dependency. Change configure script accordingly and remove #ifdefs in other code. --- DOCS/man/en/af.rst | 55 ++---- DOCS/man/en/options.rst | 6 +- Makefile | 3 +- configure | 22 +-- etc/example.conf | 4 +- libaf/af.c | 20 +-- libaf/af.h | 6 +- libaf/af_lavcac3enc.c | 23 +-- libaf/af_lavcresample.c | 213 ----------------------- libaf/af_lavrresample.c | 254 ++++++++++++++++++++++++++++ libaf/af_resample.c | 394 ------------------------------------------- libaf/af_resample_template.c | 171 ------------------- libmpcodecs/ad_ffmpeg.c | 28 +-- 13 files changed, 283 insertions(+), 916 deletions(-) delete mode 100644 libaf/af_lavcresample.c create mode 100644 libaf/af_lavrresample.c delete mode 100644 libaf/af_resample.c delete mode 100644 libaf/af_resample_template.c diff --git a/DOCS/man/en/af.rst b/DOCS/man/en/af.rst index 1822a446a4..f4891e7def 100644 --- a/DOCS/man/en/af.rst +++ b/DOCS/man/en/af.rst @@ -27,55 +27,26 @@ filter list. Available filters are: -resample[=srate[:sloppy[:type]]] - Changes the sample rate of the audio stream. Can be used if you have a - fixed frequency sound card or if you are stuck with an old sound card that - is only capable of max 44.1kHz. This filter is automatically enabled if - necessary. It only supports 16-bit integer and float in native-endian - format as input. - - - output sample frequency in Hz. The valid range for this parameter is - 8000 to 192000. If the input and output sample frequency are the same - or if this parameter is omitted the filter is automatically unloaded. - A high sample frequency normally improves the audio quality, - especially when used in combination with other filters. - - Allow (1) or disallow (0) the output frequency to differ slightly from - the frequency given by (default: 1). Can be used if the - startup of the playback is extremely slow. - - Select which resampling method to use. - - :0: linear interpolation (fast, poor quality especially when - upsampling) - :1: polyphase filterbank and integer processing - :2: polyphase filterbank and floating point processing - (slow, best quality) - - *EXAMPLE*: - - ``mplayer --af=resample=44100:0:0`` - would set the output frequency of the resample filter to 44100Hz using - exact output frequency scaling and linear interpolation. - -lavcresample[=srate[:length[:linear[:count[:cutoff]]]]] +lavrresample[=option1:option2:...] Changes the sample rate of the audio stream to an integer in Hz. - It only supports the 16-bit native-endian format. - - the output sample rate - + This filter is automatically inserted if the audio output device does not + support the sample rate of the file played. It only supports the + 16-bit integer native-endian format. + + srate= + the output sample rate (defaut: 44100) + length= length of the filter with respect to the lower sampling rate (default: 16) - - if 1 then filters will be linearly interpolated between polyphase - entries - + phase_shift= log2 of the number of polyphase entries (..., 10->1024, 11->2048, 12->4096, ...) (default: 10->1024) - + cutoff= cutoff frequency (0.0-1.0), default set depending upon filter length + linear + if set then filters will be linearly interpolated between polyphase + entries (default: no) lavcac3enc[=tospdif[:bitrate[:minchn]]] Encode multi-channel audio to AC-3 at runtime using libavcodec. Supports diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index a6f5d0d4cd..0689a39bb5 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -1828,9 +1828,9 @@ --srate= Select the output sample rate to be used (of course sound cards have limits on this). If the sample frequency selected is different from that - of the current media, the resample or lavcresample audio filter will be - inserted into the audio filter layer to compensate for the difference. The - type of resampling can be controlled by the ``--af-adv`` option. + of the current media, the lavrresample audio filter will be inserted into + the audio filter layer to compensate for the difference. The type of + resampling can be controlled by the ``--af-adv`` option. --ss=