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

Rostislav Pehlivanov atomnuker at gmail.com
Fri Jun 26 22:16:35 CEST 2015


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



More information about the ffmpeg-devel mailing list