diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-05 00:16:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-05 00:16:53 +0200 |
commit | 37af48717067a2080d7f8cf186011251b17c9529 (patch) | |
tree | eade62871f28b809cd165f543ac6c65877becf72 /libavfilter | |
parent | 490d53e335dc5954d1308172af374e9bf9d031eb (diff) | |
parent | a49aa440c939e221194f8d95bf98673f8cf38a06 (diff) | |
download | ffmpeg-streaming-37af48717067a2080d7f8cf186011251b17c9529.zip ffmpeg-streaming-37af48717067a2080d7f8cf186011251b17c9529.tar.gz |
Merge commit 'a49aa440c939e221194f8d95bf98673f8cf38a06'
* commit 'a49aa440c939e221194f8d95bf98673f8cf38a06':
af_volume: implement replaygain pre-amplification
Conflicts:
doc/filters.texi
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_volume.c | 4 | ||||
-rw-r--r-- | libavfilter/af_volume.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 5dfec06..6fded4f 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -79,6 +79,8 @@ static const AVOption volume_options[] = { { "ignore", "replaygain side data is ignored", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_IGNORE }, 0, 0, A, "replaygain" }, { "track", "track gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_TRACK }, 0, 0, A, "replaygain" }, { "album", "album gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_ALBUM }, 0, 0, A, "replaygain" }, + { "replaygain_preamp", "Apply replaygain pre-amplification", + OFFSET(replaygain_preamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, -15.0, 15.0, A }, { NULL }, }; @@ -358,7 +360,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) av_log(inlink->dst, AV_LOG_VERBOSE, "Using gain %f dB from replaygain side data.\n", g); - vol->volume = pow(10, g / 20); + vol->volume = pow(10, (g + vol->replaygain_preamp) / 20); vol->volume_i = (int)(vol->volume * 256 + 0.5); volume_init(vol); diff --git a/libavfilter/af_volume.h b/libavfilter/af_volume.h index 9f81790..18226b1 100644 --- a/libavfilter/af_volume.h +++ b/libavfilter/af_volume.h @@ -75,6 +75,7 @@ typedef struct VolumeContext { double var_values[VAR_VARS_NB]; enum ReplayGainType replaygain; + double replaygain_preamp; double volume; int volume_i; int channels; |