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

2015-06-29 Thread Rostislav Pehlivanov
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  wrote:

> On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov
>  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.
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-06-29 Thread Claudio Freire
On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov
 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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-06-28 Thread Michael Niedermayer
On Sat, Jun 27, 2015 at 10:12:18PM -0300, Claudio Freire wrote:
> LGTM

applied

thanks


> 
> On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov
>  wrote:
> > -float distortion;
> > -float perceptual_weight;
> 
> Those are in fact in disuse. Thought I'd clarify.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-06-27 Thread Claudio Freire
LGTM

On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov
 wrote:
> -float distortion;
> -float perceptual_weight;

Those are in fact in disuse. Thought I'd clarify.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-06-26 Thread Rostislav Pehlivanov
This commit adds the energy spread to the struct for each band and removes 2 
unused fields. distortion and perceptual_weight were not referenced in any file 
nor were they set to any value, so it was safe to remove them. The energy 
spread is currently only used in the aac psy model. It's defined as being 
proportional to the tonality of each band.
---
 libavcodec/aacpsy.c   | 1 +
 libavcodec/psymodel.h | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 49ff3fe..3f4a332 100644
--- a/libavcodec/aacpsy.c
+++ 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];
 }
 }
 
diff --git a/libavcodec/psymodel.h b/libavcodec/psymodel.h
index 75261ba..2e3ab91 100644
--- a/libavcodec/psymodel.h
+++ b/libavcodec/psymodel.h
@@ -38,8 +38,7 @@ typedef struct FFPsyBand {
 int   bits;
 float energy;
 float threshold;
-float distortion;
-float perceptual_weight;
+float spread;/* Energy spread over the band */
 } FFPsyBand;
 
 /**
-- 
2.1.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel