[FFmpeg-devel] [PATCH 1/2] libmodplug: support options (noise reduction, reverb, bass boost, ...)

Michael Niedermayer michaelni at gmx.at
Thu Oct 6 00:13:43 CEST 2011


On Wed, Oct 05, 2011 at 10:49:43PM +0200, Clément Bœsch wrote:
> ---
>  libavformat/libmodplug.c |   56 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 55 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/libmodplug.c b/libavformat/libmodplug.c
> index b4978b9..2f7c4fa 100644
> --- a/libavformat/libmodplug.c
> +++ b/libavformat/libmodplug.c
> @@ -19,18 +19,48 @@
>  /**
>  * @file
>  * ModPlug demuxer
> -* @todo ModPlug options (noise reduction, reverb, bass boost, ...)
>  * @todo metadata
>  */
>  
>  #include <libmodplug/modplug.h>
> +#include "libavutil/opt.h"
>  #include "avformat.h"
>  
>  typedef struct ModPlugContext {
> +    const AVClass *class;
>      ModPlugFile *f;
>      uint8_t buf[5 * 1<<20]; ///< input file content, 5M max
> +
> +    /* options */
> +    int noise_reduction;
> +    int reverb_depth;
> +    int reverb_delay;
> +    int bass_amount;
> +    int bass_range;
> +    int surround_depth;
> +    int surround_delay;
>  } ModPlugContext;
>  
> +#define OFFSET(x) offsetof(ModPlugContext, x)
> +#define D AV_OPT_FLAG_DECODING_PARAM
> +static const AVOption options[] = {
> +    {"noise_reduction", "Enable noise reduction 0(off)-1(on)",  OFFSET(noise_reduction), FF_OPT_TYPE_INT, {.i64 = 0}, 0,       1, D},

 FF_OPT_TYPE_INT uses dbl not i64

otherwise LGTM


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111006/2eff94f6/attachment.asc>


More information about the ffmpeg-devel mailing list