[FFmpeg-devel] [PATCH 06/11] aacpsy: Add energy spread for each band
Claudio Freire
klaussfreire at gmail.com
Tue Jun 30 04:11:53 CEST 2015
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