On Sat, Feb 08, 2014 at 08:59:33PM -0500, Andrew Kelley wrote:
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -467,6 +467,80 @@ To fix a 5.1 WAV improperly encoded in AAC's native 
> channel order
> +
> +@item attacks
> +@item decays
> +Set list of times in seconds for each channel over which the instantaneous 
> level
> +of the input signal is averaged to determine its volume. @var{attacks} 
> refers to

What is an "instantaneous level"?  A "current level"?

> +@item points
> +Set list of points for transfer function, specified in dB relative to maximum
> +possible signal amplitude. Each key points list need to be defined using the
> +following syntax: @code{x0/y0 x1/y1 x2/y2 ....}

needS

> +@item soft-knee
> +Set amount for which the points at where adjacent line segments on the 
> transfer
> +function meet will be rounded. Defaults is 0.01.

This sentence is highly confusing.  I have trouble extracting a valid
interpretation from it.

> +@item gain
> +Set additional gain in dB to be applied at all points on the transfer 
> function
> +and allows easy adjustment of the overall gain. Default is 0.

allow_

> +@item delay
> +Set delay in seconds. Default is 0. The input audio is analysed immediately,

AnalyZed, let's stick to American English.

> +@item
> +Noise-gate for when the noise is at a lower level than the signal:
> +
> +@item
> +Here is another noise-gate, this time for when the noise is at a higher level

noise gate

> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -37,6 +37,7 @@ OBJS-$(CONFIG_CHANNELSPLIT_FILTER)           += 
> af_channelsplit.o
>  OBJS-$(CONFIG_JOIN_FILTER)                   += af_join.o
>  OBJS-$(CONFIG_RESAMPLE_FILTER)               += af_resample.o
>  OBJS-$(CONFIG_VOLUME_FILTER)                 += af_volume.o
> +OBJS-$(CONFIG_COMPAND_FILTER)                += af_compand.o

order

> --- /dev/null
> +++ b/libavfilter/af_compand.c
> @@ -0,0 +1,595 @@
> +
> +#include "libavutil/mem.h"
> +#include "libavutil/avassert.h"
> +#include "libavutil/mathematics.h"
> +#include "libavutil/channel_layout.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/common.h"
> +#include "audio.h"
> +#include "avfilter.h"
> +#include "formats.h"
> +#include "internal.h"

We order includes nowadays.

> +    layouts = ff_all_channel_layouts();
> +    if (!layouts)
> +        return AVERROR(ENOMEM);
> +    ff_set_common_channel_layouts(ctx, layouts);
> +
> +    formats = ff_make_format_list(sample_fmts);
> +    if (!formats)
> +        return AVERROR(ENOMEM);
> +    ff_set_common_formats(ctx, formats);
> +
> +    formats = ff_all_samplerates();
> +    if (!formats)
> +        return AVERROR(ENOMEM);
> +    ff_set_common_samplerates(ctx, formats);

This looks like you leak memory if the second or third allocation fails
and you return early.

> +/**
> + * Clip a double value into the amin-amax range.
> + * @param a value to clip
> + * @param amin minimum value of the clip range
> + * @param amax maximum value of the clip range

Vertically aligning the parameter descriptions would make this more
readable.

> +static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
> +{
> +    CompandContext *s = ctx->priv;
> +    AVFilterLink *inlink = ctx->inputs[0];
> +    const int channels = 
> av_get_channel_layout_nb_channels(inlink->channel_layout);
> +    const int nb_samples = frame->nb_samples;
> +    int chan, i, av_uninit(dindex), oindex, av_uninit(count);

The av_uninit look fishy.  Why are they necessary?

> +static char *av_strtok(char *s, const char *delim, char **saveptr)

What's the problem with just using strtok()?

> +static int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int 
> *linesize, int nb_channels,
> +                                       int nb_samples, enum AVSampleFormat 
> sample_fmt, int align)

indentation, long lines

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to