[FFmpeg-devel] [PATCH 06/11] aacpsy: Add energy spread for each band

Rostislav Pehlivanov atomnuker at gmail.com
Tue Jun 30 06:16:49 CEST 2015


Thanks for the suggestions. I did some tests and using active_lines seems
to be a better measure of noise (the old spread_en[] used to increase
linearly with every band and behaved more like a smooth low-pass filter for
PNS values). I did some adjustments to it so the spectrums look fine and
the next version of the PNS patch (the one which adds search_for_pns) will
use this value for the spread.

On 30 June 2015 at 03:11, Claudio Freire <klaussfreire at gmail.com> wrote:

> On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov
> <atomnuker at gmail.com> wrote:
> > +++ b/libavcodec/aacpsy.c
> > @@ -781,6 +781,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext
> *ctx, int channel,
> >
> >              psy_band->threshold = band->thr;
> >              psy_band->energy    = band->energy;
> > +            psy_band->spread    = spread_en[w+g];
> >          }
> >      }
> >
>
>
> Sorry, but I just noticed while reviewing the other patches.
>
> spread_en isn't as good a proxy for band tonality as we'd hoped, but
> band->active_lines works (adjusting the rest of the patch set).
>
> So it should read like:
>
> > +++ b/libavcodec/aacpsy.c
> > @@ -781,6 +781,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext
> *ctx, int channel,
> >
> >              psy_band->threshold = band->thr;
> >              psy_band->energy    = band->energy;
> > +            psy_band->spread    = band->active_lines;
> >          }
> >      }
> >
>
> The following patch over head (well, git diff) does that:
>
> diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
> index 78232d4..ca21664 100644
> --- a/libavcodec/aacpsy.c
> +++ b/libavcodec/aacpsy.c
> @@ -787,7 +787,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext
> *ctx, int channel,
>
>              psy_band->threshold = band->thr;
>              psy_band->energy    = band->energy;
> -            psy_band->spread    = spread_en[w+g];
> +            psy_band->spread    = band->active_lines * 2.0f /
> band_sizes[g];
>          }
>      }
>
> The rest of the patch set will need to adapt to this other spread
> measure, I'll comment on the relevant patches.
>


More information about the ffmpeg-devel mailing list