[FFmpeg-cvslog] libavcodec/opusenc: use correct format specifiers
ffmpeg | branch: master | Kyle Swanson | Sun Mar 26 13:48:28 2017 -0500| [b12693facf991f343cdf310690f59f69143b256f] | committer: Carl Eugen Hoyos libavcodec/opusenc: use correct format specifiers Squelches the following compiler warnings: libavcodec/opusenc.c:1051:16: warning: format specifies type 'long' but the argument has type 'long long' [-Wformat] avctx->bit_rate/1000, clipped_rate/1000); ^~~~ libavcodec/opusenc.c:1051:38: warning: format specifies type 'long' but the argument has type 'long long' [-Wformat] avctx->bit_rate/1000, clipped_rate/1000); ^ > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b12693facf991f343cdf310690f59f69143b256f --- libavcodec/opusenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 56368db..cecc8f2 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -1047,7 +1047,7 @@ static av_cold int opus_encode_init(AVCodecContext *avctx) avctx->bit_rate = coupled*(96000) + (s->channels - coupled*2)*(48000); } else if (avctx->bit_rate < 6000 || avctx->bit_rate > 255000 * s->channels) { int64_t clipped_rate = av_clip(avctx->bit_rate, 6000, 255000 * s->channels); -av_log(avctx, AV_LOG_ERROR, "Unsupported bitrate %li kbps, clipping to %li kbps\n", +av_log(avctx, AV_LOG_ERROR, "Unsupported bitrate %"PRId64" kbps, clipping to %"PRId64" kbps\n", avctx->bit_rate/1000, clipped_rate/1000); avctx->bit_rate = clipped_rate; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_loudnorm: do not upsample during second-pass linear normalization
ffmpeg | branch: master | Kyle Swanson | Wed Apr 5 11:43:12 2017 -0500| [f3d8e0d369456113d1223cdf77072b52fc79eceb] | committer: Kyle Swanson avfilter/af_loudnorm: do not upsample during second-pass linear normalization Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3d8e0d369456113d1223cdf77072b52fc79eceb --- libavfilter/af_loudnorm.c | 58 +++ libavfilter/version.h | 2 +- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c index 9d91c76..e3e815e 100644 --- a/libavfilter/af_loudnorm.c +++ b/libavfilter/af_loudnorm.c @@ -682,6 +682,7 @@ static int request_frame(AVFilterLink *outlink) static int query_formats(AVFilterContext *ctx) { +LoudNormContext *s = ctx->priv; AVFilterFormats *formats; AVFilterChannelLayouts *layouts; AVFilterLink *inlink = ctx->inputs[0]; @@ -707,15 +708,17 @@ static int query_formats(AVFilterContext *ctx) if (ret < 0) return ret; -formats = ff_make_format_list(input_srate); -if (!formats) -return AVERROR(ENOMEM); -ret = ff_formats_ref(formats, &inlink->out_samplerates); -if (ret < 0) -return ret; -ret = ff_formats_ref(formats, &outlink->in_samplerates); -if (ret < 0) -return ret; +if (s->frame_type != LINEAR_MODE) { +formats = ff_make_format_list(input_srate); +if (!formats) +return AVERROR(ENOMEM); +ret = ff_formats_ref(formats, &inlink->out_samplerates); +if (ret < 0) +return ret; +ret = ff_formats_ref(formats, &outlink->in_samplerates); +if (ret < 0) +return ret; +} return 0; } @@ -754,21 +757,6 @@ static int config_input(AVFilterLink *inlink) init_gaussian_filter(s); -s->frame_type = FIRST_FRAME; - -if (s->linear) { -double offset, offset_tp; -offset= s->target_i - s->measured_i; -offset_tp = s->measured_tp + offset; - -if (s->measured_tp != 99 && s->measured_thresh != -70 && s->measured_lra != 0 && s->measured_i != 0) { -if ((offset_tp <= s->target_tp) && (s->measured_lra <= s->target_lra)) { -s->frame_type = LINEAR_MODE; -s->offset = offset; -} -} -} - if (s->frame_type != LINEAR_MODE) { inlink->min_samples = inlink->max_samples = @@ -790,6 +778,27 @@ static int config_input(AVFilterLink *inlink) return 0; } +static av_cold int init(AVFilterContext *ctx) +{ +LoudNormContext *s = ctx->priv; +s->frame_type = FIRST_FRAME; + +if (s->linear) { +double offset, offset_tp; +offset= s->target_i - s->measured_i; +offset_tp = s->measured_tp + offset; + +if (s->measured_tp != 99 && s->measured_thresh != -70 && s->measured_lra != 0 && s->measured_i != 0) { +if ((offset_tp <= s->target_tp) && (s->measured_lra <= s->target_lra)) { +s->frame_type = LINEAR_MODE; +s->offset = offset; +} +} +} + +return 0; +} + static av_cold void uninit(AVFilterContext *ctx) { LoudNormContext *s = ctx->priv; @@ -914,6 +923,7 @@ AVFilter ff_af_loudnorm = { .priv_size = sizeof(LoudNormContext), .priv_class= &loudnorm_class, .query_formats = query_formats, +.init = init, .uninit= uninit, .inputs= avfilter_af_loudnorm_inputs, .outputs = avfilter_af_loudnorm_outputs, diff --git a/libavfilter/version.h b/libavfilter/version.h index 9a4d1c7..6f33acb 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFILTER_VERSION_MAJOR 6 -#define LIBAVFILTER_VERSION_MINOR 83 +#define LIBAVFILTER_VERSION_MINOR 84 #define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/g722enc: force mono channel layout
ffmpeg | branch: master | Kyle Swanson | Fri Jun 23 16:33:07 2017 -0500| [c11ca6105e69750a233eb8a42462b27580da1ee5] | committer: Kyle Swanson avcodec/g722enc: force mono channel layout Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c11ca6105e69750a233eb8a42462b27580da1ee5 --- libavcodec/g722enc.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index 01a3db26fd..25b61df19e 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -61,11 +61,6 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) G722Context *c = avctx->priv_data; int ret; -if (avctx->channels != 1) { -av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n"); -return AVERROR_INVALIDDATA; -} - c->band[0].scale_factor = 8; c->band[1].scale_factor = 2; c->prev_samples_pos = 22; @@ -381,15 +376,15 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } AVCodec ff_adpcm_g722_encoder = { -.name = "g722", -.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), -.type = AVMEDIA_TYPE_AUDIO, -.id = AV_CODEC_ID_ADPCM_G722, -.priv_data_size = sizeof(G722Context), -.init = g722_encode_init, -.close = g722_encode_close, -.encode2= g722_encode_frame, -.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, -.sample_fmts= (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, - AV_SAMPLE_FMT_NONE }, +.name= "g722", +.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), +.type= AVMEDIA_TYPE_AUDIO, +.id = AV_CODEC_ID_ADPCM_G722, +.priv_data_size = sizeof(G722Context), +.init= g722_encode_init, +.close = g722_encode_close, +.encode2 = g722_encode_frame, +.capabilities= AV_CODEC_CAP_SMALL_LAST_FRAME, +.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, +.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] filters.texi: clarify audio upsampling in loudnorm
ffmpeg | branch: master | Kyle Swanson | Thu Aug 17 14:01:42 2017 -0700| [2955cd44828239747ef646a80e9908d5b962bfc1] | committer: Kyle Swanson filters.texi: clarify audio upsampling in loudnorm Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2955cd44828239747ef646a80e9908d5b962bfc1 --- doc/filters.texi | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index ef0b2ca899..ba29a75274 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3068,11 +3068,9 @@ If the specified value is not valid, it is ignored and prior one is kept. EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. Support for both single pass (livestreams, files) and double pass (files) modes. -This algorithm can target IL, LRA, and maximum true peak. - -To accurately detect true peaks, the audio stream will be upsampled to 192 kHz. -Use the @code{-ar} option or @code{aresample} filter to set a different output -sample rate. +This algorithm can target IL, LRA, and maximum true peak. To accurately detect true peaks, +the audio stream will be upsampled to 192 kHz unless the normalization mode is linear. +Use the @code{-ar} option or @code{aresample} filter to explicitly set an output sample rate. The filter accepts the following options: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/filters: correct typo in psnr filter docs
ffmpeg | branch: master | Kyle Swanson | Mon Jan 8 16:35:23 2018 -0800| [42a5fe340fb30042fa9b2212459de7cbbda15b73] | committer: Kyle Swanson doc/filters: correct typo in psnr filter docs Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42a5fe340fb30042fa9b2212459de7cbbda15b73 --- doc/filters.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index a13aef2196..217a2af42b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12785,7 +12785,7 @@ sequential number of the input frame, starting from 1 Mean Square Error pixel-by-pixel average difference of the compared frames, averaged over all the image components. -@item mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a +@item mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a Mean Square Error pixel-by-pixel average difference of the compared frames for the component specified by the suffix. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavfi/vf_libvmaf: update to use libvmaf v1.3.9
ffmpeg | branch: master | Kyle Swanson | Tue Aug 7 15:05:16 2018 -0700| [87cc7e8d4ef8fa643d8d4822525b9c95cc9e7307] | committer: Kyle Swanson lavfi/vf_libvmaf: update to use libvmaf v1.3.9 Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87cc7e8d4ef8fa643d8d4822525b9c95cc9e7307 --- configure| 2 +- doc/filters.texi | 11 ++- libavfilter/vf_libvmaf.c | 9 - 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 15a58935de..e718c1531c 100755 --- a/configure +++ b/configure @@ -6089,7 +6089,7 @@ enabled libtwolame&& require libtwolame twolame.h twolame_init -ltwolame die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit -enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 0.6.2" libvmaf.h compute_vmaf +enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init diff --git a/doc/filters.texi b/doc/filters.texi index 792edfd2e1..d6c15837f2 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -10868,7 +10868,7 @@ The obtained VMAF score is printed through the logging system. It requires Netflix's vmaf library (libvmaf) as a pre-requisite. After installing the library it can be enabled using: -@code{./configure --enable-libvmaf}. +@code{./configure --enable-libvmaf --enable-version3}. If no model path is specified it uses the default model: @code{vmaf_v0.6.1.pkl}. The filter has following options: @@ -10902,6 +10902,15 @@ Enables computing ms_ssim along with vmaf. @item pool Set the pool method (mean, min or harmonic mean) to be used for computing vmaf. + +@item n_threads +Set number of threads to be used when computing vmaf. + +@item n_subsample +Set interval for frame subsampling used when computing vmaf. + +@item enable_conf_interval +Enables confidence interval. @end table This filter also supports the @ref{framesync} options. diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 5d47a74375..249e50c720 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -62,6 +62,9 @@ typedef struct LIBVMAFContext { int ssim; int ms_ssim; char *pool; +int n_threads; +int n_subsample; +int enable_conf_interval; int error; } LIBVMAFContext; @@ -78,6 +81,9 @@ static const AVOption libvmaf_options[] = { {"ssim", "Enables computing ssim along with vmaf.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, {"ms_ssim", "Enables computing ms-ssim along with vmaf.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, {"pool", "Set the pool method to be used for computing vmaf.", OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, +{"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, +{"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, +{"enable_conf_interval", "Enables confidence interval.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, { NULL } }; @@ -166,7 +172,8 @@ static void compute_vmaf_score(LIBVMAFContext *s) read_frame, s, s->model_path, s->log_path, s->log_fmt, 0, 0, s->enable_transform, s->phone_model, s->psnr, s->ssim, -s->ms_ssim, s->pool); +s->ms_ssim, s->pool, +s->n_threads, s->n_subsample, s->enable_conf_interval); } static void *call_vmaf(void *ctx) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavfi/ebur128: use ff_ prefix
ffmpeg | branch: master | Kyle Swanson | Sun Nov 13 19:11:07 2016 -0600| [83b6b434fffc2749b3012fa3608d90939faddbb8] | committer: Kyle Swanson lavfi/ebur128: use ff_ prefix Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=83b6b434fffc2749b3012fa3608d90939faddbb8 --- libavfilter/ebur128.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavfilter/ebur128.h b/libavfilter/ebur128.h index c39c80d..b94cd24 100644 --- a/libavfilter/ebur128.h +++ b/libavfilter/ebur128.h @@ -81,15 +81,15 @@ enum channel { * modes that suit your needs, as performance will be better. */ enum mode { - /** can call ebur128_loudness_momentary */ + /** can call ff_ebur128_loudness_momentary */ FF_EBUR128_MODE_M = (1 << 0), - /** can call ebur128_loudness_shortterm */ + /** can call ff_ebur128_loudness_shortterm */ FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M, - /** can call ebur128_loudness_global_* and ebur128_relative_threshold */ + /** can call ff_ebur128_loudness_global_* and ff_ebur128_relative_threshold */ FF_EBUR128_MODE_I = (1 << 2) | FF_EBUR128_MODE_M, - /** can call ebur128_loudness_range */ + /** can call ff_ebur128_loudness_range */ FF_EBUR128_MODE_LRA = (1 << 3) | FF_EBUR128_MODE_S, - /** can call ebur128_sample_peak */ + /** can call ff_ebur128_sample_peak */ FF_EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | FF_EBUR128_MODE_M, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter: add tremolo filter
ffmpeg | branch: master | Kyle Swanson | Mon Sep 21 10:16:43 2015 -0500| [a9509ad3f0e148a2af2efa2eaa43f859a59af0ce] | committer: Paul B Mahol avfilter: add tremolo filter Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9509ad3f0e148a2af2efa2eaa43f859a59af0ce --- Changelog|1 + doc/filters.texi | 19 + libavfilter/Makefile |1 + libavfilter/af_tremolo.c | 173 ++ libavfilter/allfilters.c |1 + libavfilter/version.h|2 +- 6 files changed, 196 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index c2fd10f..12fe77c 100644 --- a/Changelog +++ b/Changelog @@ -9,6 +9,7 @@ version : - stereowiden filter - stereotools filter - rubberband filter +- tremolo filter version 2.8: diff --git a/doc/filters.texi b/doc/filters.texi index 88cb3ce..5bbbaf0 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2568,6 +2568,25 @@ slope Determine how steep is the filter's shelf transition. @end table +@section tremolo + +Sinusoidal amplitude modulation. + +The filter accepts the following options: + +@table @option +@item f +Modulation frequency in Hertz. Modulation frequencies in the subharmonic range +(20 Hz or lower) will result in a tremolo effect. +This filter may also be used as a ring modulator by specifying +a modulation frequency higher than 20 Hz. +Range is 0.1 - 2.0. Default value is 5.0 Hz. + +@item d +Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +@end table + @section volume Adjust the input audio volume. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 4bbe972..8db5da9 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -84,6 +84,7 @@ OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o OBJS-$(CONFIG_STEREOTOOLS_FILTER)+= af_stereotools.o OBJS-$(CONFIG_STEREOWIDEN_FILTER)+= af_stereowiden.o OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o +OBJS-$(CONFIG_TREMOLO_FILTER)+= af_tremolo.o generate_wave_table.o OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c new file mode 100644 index 000..6335401 --- /dev/null +++ b/libavfilter/af_tremolo.c @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2015 Kyle Swanson . + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "avfilter.h" +#include "internal.h" +#include "audio.h" +#include "generate_wave_table.h" + +typedef struct TremoloContext { +const AVClass *class; +double freq; +double depth; +double *wave_table; +int wave_table_index; +int sample_rate; +} TremoloContext; + +#define OFFSET(x) offsetof(TremoloContext, x) +#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM + +static const AVOption tremolo_options[] = { +{ "f", "set frequency in hertz",OFFSET(freq),AV_OPT_TYPE_DOUBLE, {.dbl = 5.0}, 0.1, 2.0, FLAGS }, +{ "d", "set depth as percentage", OFFSET(depth), AV_OPT_TYPE_DOUBLE, {.dbl = 0.5}, 0.0, 1.0, FLAGS }, +{ NULL } +}; + +AVFILTER_DEFINE_CLASS(tremolo); + +static double trem_env(AVFilterContext *ctx) +{ +TremoloContext *s = ctx->priv; +double env = s->wave_table[s->wave_table_index]; +s->wave_table_index++; +if (s->wave_table_index >= s->sample_rate / s->freq) +s->wave_table_index = 0; +return 1.0 - (s->depth * env); +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ +AVFilterContext *ctx = inlink->dst; +AVFilterLink *outlink = ctx->outputs[0]; +const double *src = (const double *)in->data[0]; +const int channels = inlink->channels; +const int nb_samples = in->nb_samples; +AVFrame *out; +double *dst; +int n, c; + +if (av_frame_is_writable(in)) { +out = in; +} else { +out = ff_get_audio_buffer(inlink, in->nb_samples); +if (!out) {
[FFmpeg-cvslog] avfilter/generate_wave_table: clean up extra newlines
ffmpeg | branch: master | Kyle Swanson | Thu Sep 24 09:34:42 2015 -0500| [435d000eb59ab974520bcfb3e77ddfa2473331f8] | committer: Paul B Mahol avfilter/generate_wave_table: clean up extra newlines Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=435d000eb59ab974520bcfb3e77ddfa2473331f8 --- libavfilter/generate_wave_table.c |2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/generate_wave_table.c b/libavfilter/generate_wave_table.c index bee9c00..6cd8022 100644 --- a/libavfilter/generate_wave_table.c +++ b/libavfilter/generate_wave_table.c @@ -80,5 +80,3 @@ void ff_generate_wave_table(enum WaveType wave_type, } } } - - ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/ebur128: add dualmono measurement option
ffmpeg | branch: master | Kyle Swanson | Wed Sep 30 10:35:08 2015 -0500| [4f721bfd46120aa2a7c7cdcbdd7c8db3b767dd1d] | committer: Clément Bœsch avfilter/ebur128: add dualmono measurement option > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f721bfd46120aa2a7c7cdcbdd7c8db3b767dd1d --- doc/filters.texi|9 + libavfilter/f_ebur128.c | 22 ++ 2 files changed, 31 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 04b2d22..71f1456 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12685,6 +12685,15 @@ stream for better peak accuracy. It logs a message for true-peak. This mode requires a build with @code{libswresample}. @end table +@item dualmono +Treat mono input files as "dual mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to @code{true}, this option will compensate for this effect. +Multi-channel input files are not effected by this option. + +@item panlaw +Set a specific pan law to be used for the measurement of dual mono files. +This parameter is optional, and has a default value of -3.01dB. @end table @subsection Examples diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 1d5c8fd..c63356f 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -139,6 +139,8 @@ typedef struct { /* misc */ int loglevel; ///< log level for frame logging int metadata; ///< whether or not to inject loudness results in frames +int dual_mono; ///< whether or not to treat single channel input files as dual-mono +double pan_law; ///< pan law value used to calulate dual-mono measurements } EBUR128Context; enum { @@ -163,6 +165,8 @@ static const AVOption ebur128_options[] = { { "none", "disable any peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_NONE}, INT_MIN, INT_MAX, A|F, "mode" }, { "sample", "enable peak-sample mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_SAMPLES_PEAKS}, INT_MIN, INT_MAX, A|F, "mode" }, { "true", "enable true-peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_TRUE_PEAKS},INT_MIN, INT_MAX, A|F, "mode" }, +{ "dualmono", "treat mono input files as dual-mono", OFFSET(dual_mono), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, A|F }, +{ "panlaw", "set a specific pan law for dual-mono files", OFFSET(pan_law), AV_OPT_TYPE_DOUBLE, {.dbl = -3.01029995663978}, -10.0, 0.0, A|F }, { NULL }, }; @@ -661,6 +665,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) } if (nb_integrated) ebur128->integrated_loudness = LOUDNESS(integrated_sum / nb_integrated); +/* dual-mono correction */ +if (nb_channels == 1 && ebur128->dual_mono) { +ebur128->integrated_loudness -= ebur128->pan_law; +} } /* LRA */ @@ -707,6 +715,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) } } +/* dual-mono correction */ +if (nb_channels == 1 && ebur128->dual_mono) { +loudness_400 -= ebur128->pan_law; +loudness_3000 -= ebur128->pan_law; +} + #define LOG_FMT "M:%6.1f S:%6.1f I:%6.1f LUFS LRA:%6.1f LU" /* push one video frame */ @@ -855,6 +869,14 @@ static av_cold void uninit(AVFilterContext *ctx) int i; EBUR128Context *ebur128 = ctx->priv; +/* dual-mono correction */ +if (ebur128->nb_channels == 1 && ebur128->dual_mono) { +ebur128->i400.rel_threshold -= ebur128->pan_law; +ebur128->i3000.rel_threshold -= ebur128->pan_law; +ebur128->lra_low -= ebur128->pan_law; +ebur128->lra_high -= ebur128->pan_law; +} + av_log(ctx, AV_LOG_INFO, "Summary:\n\n" " Integrated loudness:\n" "I: %5.1f LUFS\n" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_tremolo: clean up extra newlines
ffmpeg | branch: master | Kyle Swanson | Wed Oct 14 09:56:48 2015 -0500| [0131636f22b49d1aa67b76d7f1acad6e57eda577] | committer: Michael Niedermayer avfilter/af_tremolo: clean up extra newlines Signed-off-by: Kyle Swanson Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0131636f22b49d1aa67b76d7f1acad6e57eda577 --- libavfilter/af_tremolo.c |2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c index 0ae7a7c..50df2e4 100644 --- a/libavfilter/af_tremolo.c +++ b/libavfilter/af_tremolo.c @@ -131,9 +131,7 @@ static int config_input(AVFilterLink *inlink) for (i = 0; i < inlink->sample_rate; i++) { double env = s->freq * i / inlink->sample_rate; - env = sin(2 * M_PI * fmod(env + 0.25, 1.0)); - s->table[i] = env * (1 - fabs(offset)) + offset; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_flanger: free frame on ENOMEM
ffmpeg | branch: master | Kyle Swanson | Thu Oct 15 10:08:36 2015 -0500| [32403d1fabb602d71358fcb186fbbc6896db86a4] | committer: Michael Niedermayer avfilter/af_flanger: free frame on ENOMEM Signed-off-by: Kyle Swanson Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32403d1fabb602d71358fcb186fbbc6896db86a4 --- libavfilter/af_flanger.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_flanger.c b/libavfilter/af_flanger.c index 39d4e7b..f8ec830 100644 --- a/libavfilter/af_flanger.c +++ b/libavfilter/af_flanger.c @@ -149,8 +149,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) out_frame = frame; } else { out_frame = ff_get_audio_buffer(inlink, frame->nb_samples); -if (!out_frame) +if (!out_frame) { +av_frame_free(&frame); return AVERROR(ENOMEM); +} av_frame_copy_props(out_frame, frame); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter: add vibrato filter
ffmpeg | branch: master | Kyle Swanson | Sat Oct 24 00:08:19 2015 -0500| [dcb95ef48255ac2462dbbb8abb3d054013fc4721] | committer: Paul B Mahol avfilter: add vibrato filter Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcb95ef48255ac2462dbbb8abb3d054013fc4721 --- Changelog|1 + doc/filters.texi | 16 libavfilter/Makefile |1 + libavfilter/af_vibrato.c | 210 ++ libavfilter/allfilters.c |1 + libavfilter/version.h|2 +- 6 files changed, 230 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 6081bf6..0ab541e 100644 --- a/Changelog +++ b/Changelog @@ -26,6 +26,7 @@ version : - zero-copy Intel QSV transcoding in ffmpeg - shuffleframes filter - SDX2 DPCM decoder +- vibrato filter version 2.8: diff --git a/doc/filters.texi b/doc/filters.texi index 5a35bde..1de6a2f 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2719,6 +2719,22 @@ Depth of modulation as a percentage. Range is 0.0 - 1.0. Default value is 0.5. @end table +@section vibrato + +Sinusoidal phase modulation. + +The filter accepts the following options: + +@table @option +@item f +Modulation frequency in Hertz. +Range is 0.1 - 2.0. Default value is 5.0 Hz. + +@item d +Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +@end table + @section volume Adjust the input audio volume. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 8e776c1..d229af4 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -86,6 +86,7 @@ OBJS-$(CONFIG_STEREOTOOLS_FILTER)+= af_stereotools.o OBJS-$(CONFIG_STEREOWIDEN_FILTER)+= af_stereowiden.o OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o OBJS-$(CONFIG_TREMOLO_FILTER)+= af_tremolo.o +OBJS-$(CONFIG_VIBRATO_FILTER)+= af_vibrato.o generate_wave_table.o OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o diff --git a/libavfilter/af_vibrato.c b/libavfilter/af_vibrato.c new file mode 100644 index 000..c7691f2 --- /dev/null +++ b/libavfilter/af_vibrato.c @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2015 Kyle Swanson . + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "avfilter.h" +#include "internal.h" +#include "audio.h" +#include "generate_wave_table.h" + +typedef struct VibratoContext { +const AVClass *class; +double freq; +double depth; +int channels; + +double **buf; +int buf_index; +int buf_size; + +double *wave_table; +int wave_table_index; +int wave_table_size; +} VibratoContext; + +#define OFFSET(x) offsetof(VibratoContext, x) +#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM + +static const AVOption vibrato_options[] = { +{ "f", "set frequency in hertz",OFFSET(freq),AV_OPT_TYPE_DOUBLE, {.dbl = 5.0}, 0.1, 2.0, FLAGS }, +{ "d", "set depth as percentage", OFFSET(depth), AV_OPT_TYPE_DOUBLE, {.dbl = 0.5}, 0.00, 1.0, FLAGS }, +{ NULL } +}; + +AVFILTER_DEFINE_CLASS(vibrato); + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ +AVFilterContext *ctx = inlink->dst; +VibratoContext *s = ctx->priv; +AVFilterLink *outlink = ctx->outputs[0]; +AVFrame *out; +int n, c; +const double *src; +double *dst; + +if (av_frame_is_writable(in)) { +out = in; +} else { +out = ff_get_audio_buffer(inlink, in->nb_samples); +if (!out) { +av_frame_free(&in); +return AVERROR(ENOMEM); +} +av_frame_copy_props(out, in); +} + + +for (n = 0; n < in->nb_samples; n++) { +double integer, decimal; +decimal = modf(s->depth * s->wave_table[s->wave_table_index], &integer); + +s->wave_table_index++; +if (s->wave_table_index >= s->wave_table_size) +s->wave_table_index -= s->wave_table_size; + +for (c = 0; c
[FFmpeg-cvslog] doc/filters.texi: ebur128 grammar fix
ffmpeg | branch: master | Kyle Swanson | Mon Oct 26 17:44:33 2015 -0500| [15d8b6512552b0831656e7ed3d45d6a4093a83b8] | committer: Michael Niedermayer doc/filters.texi: ebur128 grammar fix Reviewed-by: Lou Logan Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15d8b6512552b0831656e7ed3d45d6a4093a83b8 --- doc/filters.texi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index 1de6a2f..2914e40 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12958,7 +12958,7 @@ This mode requires a build with @code{libswresample}. Treat mono input files as "dual mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set to @code{true}, this option will compensate for this effect. -Multi-channel input files are not effected by this option. +Multi-channel input files are not affected by this option. @item panlaw Set a specific pan law to be used for the measurement of dual mono files. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/asrc_sine: fix options typos
ffmpeg | branch: master | Kyle Swanson | Wed Oct 28 13:03:43 2015 -0500| [e5451f25d3c2728943d31da2cf7975f33f5c9831] | committer: Michael Niedermayer avfilter/asrc_sine: fix options typos Signed-off-by: Kyle Swanson Reviewed-by: Nicolas George Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5451f25d3c2728943d31da2cf7975f33f5c9831 --- libavfilter/asrc_sine.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index f361faa..2a2f3c3 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -69,8 +69,8 @@ typedef struct { static const AVOption sine_options[] = { OPT_DBL("frequency", frequency,440, 0, DBL_MAX, "set the sine frequency",), OPT_DBL("f", frequency,440, 0, DBL_MAX, "set the sine frequency",), -OPT_DBL("beep_factor", beep_factor,0, 0, DBL_MAX, "set the beep fequency factor",), -OPT_DBL("b", beep_factor,0, 0, DBL_MAX, "set the beep fequency factor",), +OPT_DBL("beep_factor", beep_factor,0, 0, DBL_MAX, "set the beep frequency factor",), +OPT_DBL("b", beep_factor,0, 0, DBL_MAX, "set the beep frequency factor",), OPT_INT("sample_rate", sample_rate,44100, 1, INT_MAX, "set the sample rate",), OPT_INT("r", sample_rate,44100, 1, INT_MAX, "set the sample rate",), OPT_DUR("duration", duration, 0, 0, INT64_MAX, "set the audio duration",), ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/tremolo: fix wavetable buffer size
ffmpeg | branch: master | Kyle Swanson | Wed Oct 28 21:29:59 2015 -0500| [3b1939bb6679e4e2e91eb41e7f09830ac418de16] | committer: Michael Niedermayer avfilter/tremolo: fix wavetable buffer size Signed-off-by: Kyle Swanson Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b1939bb6679e4e2e91eb41e7f09830ac418de16 --- libavfilter/af_tremolo.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c index 50df2e4..572e9e3 100644 --- a/libavfilter/af_tremolo.c +++ b/libavfilter/af_tremolo.c @@ -72,7 +72,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dst += channels; src += channels; s->index++; -if (s->index >= inlink->sample_rate) +if (s->index >= inlink->sample_rate / s->freq) s->index = 0; } @@ -125,11 +125,11 @@ static int config_input(AVFilterLink *inlink) const double offset = 1. - s->depth / 2.; int i; -s->table = av_malloc_array(inlink->sample_rate, sizeof(*s->table)); +s->table = av_malloc_array(inlink->sample_rate / s->freq, sizeof(*s->table)); if (!s->table) return AVERROR(ENOMEM); -for (i = 0; i < inlink->sample_rate; i++) { +for (i = 0; i < inlink->sample_rate / s->freq; i++) { double env = s->freq * i / inlink->sample_rate; env = sin(2 * M_PI * fmod(env + 0.25, 1.0)); s->table[i] = env * (1 - fabs(offset)) + offset; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter: add anoisesrc
ffmpeg | branch: master | Kyle Swanson | Sun Nov 8 12:39:37 2015 +0100| [6a11c7f1605d6f751fd9adb86f24f6c37bed5ddf] | committer: Paul B Mahol avfilter: add anoisesrc Signed-off-by: Kyle Swanson Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a11c7f1605d6f751fd9adb86f24f6c37bed5ddf --- Changelog|1 + doc/filters.texi | 40 libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/asrc_anoisesrc.c | 207 ++ libavfilter/version.h|4 +- 6 files changed, 252 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 44009f0..f60ade0 100644 --- a/Changelog +++ b/Changelog @@ -32,6 +32,7 @@ version : - Interplay ACM demuxer and audio decoder - XMA1 & XMA2 decoder - realtime filter +- anoisesrc audio filter source version 2.8: diff --git a/doc/filters.texi b/doc/filters.texi index f0b0ef3..471ec3f 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3157,6 +3157,46 @@ ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.' For more information about libflite, check: @url{http://www.speech.cs.cmu.edu/flite/} +@section anoisesrc + +Generate a noise audio signal. + +The filter accepts the following options: + +@table @option +@item sample_rate, r +Specify the sample rate. Default value is 48000 Hz. + +@item amplitude, a +Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value +is 1.0. + +@item duration, d +Specify the duration of the generated audio stream. Not specifying this option +results in noise with an infinite length. + +@item color, colour, c +Specify the color of noise. Available noise colors are white, pink, and brown. +Default color is white. + +@item seed, s +Specify a value used to seed the PRNG. + +@item nb_samples, n +Set the number of samples per each output frame, default is 1024. +@end table + +@subsection Examples + +@itemize + +@item +Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: +@example +anoisesrc=d=60:c=pink:r=44100:a=0.5 +@end example +@end itemize + @section sine Generate an audio signal made of a sine wave with amplitude 1/8. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 49b68db..1f4abeb 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -91,6 +91,7 @@ OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o OBJS-$(CONFIG_AEVALSRC_FILTER) += aeval.o +OBJS-$(CONFIG_ANOISESRC_FILTER) += asrc_anoisesrc.o OBJS-$(CONFIG_ANULLSRC_FILTER) += asrc_anullsrc.o OBJS-$(CONFIG_FLITE_FILTER) += asrc_flite.o OBJS-$(CONFIG_SINE_FILTER) += asrc_sine.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 790587d..63b8fdb 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -113,6 +113,7 @@ void avfilter_register_all(void) REGISTER_FILTER(VOLUMEDETECT, volumedetect, af); REGISTER_FILTER(AEVALSRC, aevalsrc, asrc); +REGISTER_FILTER(ANOISESRC, anoisesrc, asrc); REGISTER_FILTER(ANULLSRC, anullsrc, asrc); REGISTER_FILTER(FLITE, flite, asrc); REGISTER_FILTER(SINE, sine, asrc); diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c new file mode 100644 index 000..e4d4013 --- /dev/null +++ b/libavfilter/asrc_anoisesrc.c @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2015 Kyle Swanson . + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "audio.h" +#include "avfilter.h" +#include "internal.h" +#include "libavutil/lfg.h" +#include "libavutil/random_seed.h" + +typedef struct { +const AVClass *class; +int sample_rate; +double amplitude; +int64_t duration; +int64_t color; +int64_t seed; +int nb_samples; + +int64_t pts; +int infinite; +double (*filter)(double white, double *buf); +double buf[7]; +AVLFG c; +}
[FFmpeg-cvslog] avfilter: add loudnorm
ffmpeg | branch: master | Kyle Swanson | Wed May 11 13:30:14 2016 -0500| [c0c378009b4ba5dea2ac1f93c972a6c84b2dff0d] | committer: Paul B Mahol avfilter: add loudnorm Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0c378009b4ba5dea2ac1f93c972a6c84b2dff0d --- Changelog |1 + MAINTAINERS |1 + configure |5 + doc/filters.texi | 55 +++ libavfilter/Makefile |1 + libavfilter/af_loudnorm.c | 907 + libavfilter/allfilters.c |1 + libavfilter/version.h |2 +- 8 files changed, 972 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 402594d..003b69c 100644 --- a/Changelog +++ b/Changelog @@ -35,6 +35,7 @@ version : - Generic OpenMAX IL encoder with support for Raspberry Pi - IFF ANIM demuxer & decoder - Direct Stream Transfer (DST) decoder +- loudnorm filter version 3.0: - Common Encryption (CENC) MP4 encoding and decoding support diff --git a/MAINTAINERS b/MAINTAINERS index 14bf377..52c30ed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -358,6 +358,7 @@ Filters: af_compand.c Paul B Mahol af_firequalizer.c Muhammad Faiz af_ladspa.c Paul B Mahol + af_loudnorm.c Kyle Swanson af_pan.c Nicolas George af_sidechaincompress.cPaul B Mahol af_silenceremove.cPaul B Mahol diff --git a/configure b/configure index 2dede36..cc2c9e7 100755 --- a/configure +++ b/configure @@ -226,6 +226,8 @@ External library support: --enable-libcdio enable audio CD grabbing with libcdio [no] --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] + --enable-libebur128 enable libebur128 for EBU R128 measurement, + needed for loudnorm filter [no] --enable-libfaac enable AAC encoding via libfaac [no] --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] --enable-libfliteenable flite (voice synthesis) support via libflite [no] @@ -1472,6 +1474,7 @@ EXTERNAL_LIBRARY_LIST=" libcdio libcelt libdc1394 +libebur128 libfaac libfdk_aac libflite @@ -2987,6 +2990,7 @@ hqdn3d_filter_deps="gpl" interlace_filter_deps="gpl" kerndeint_filter_deps="gpl" ladspa_filter_deps="ladspa dlopen" +loudnorm_filter_deps="libebur128" mcdeint_filter_deps="avcodec gpl" movie_filter_deps="avcodec avformat" mpdecimate_filter_deps="gpl" @@ -5593,6 +5597,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config caca caca.h caca_create_canvas +enabled libebur128&& require ebur128 ebur128.h ebur128_relative_threshold -lebur128 enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libfdk_aac&& { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && diff --git a/doc/filters.texi b/doc/filters.texi index a7c480e..27584e9 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2711,6 +2711,61 @@ Modify the @var{N}-th control value. If the specified value is not valid, it is ignored and prior one is kept. @end table +@section loudnorm + +EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. +Support for both single pass (livestreams, files) and double pass (files) modes. +This algorithm can target IL, LRA, and maximum true peak. + +To enable compilation of this filter you need to configure FFmpeg with +@code{--enable-libebur128}. + +The filter accepts the following options: + +@table @option +@item I, i +Set integrated loudness target. +Range is -70.0 - -5.0. Default value is -24.0. + +@item LRA, lra +Set loudness range target. +Range is 1.0 - 20.0. Default value is 7.0. + +@item TP, tp +Set maximum true peak. +Range is -9.0 - +0.0. Default value is -2.0. + +@item measured_I, measured_i +Measured IL of input file. +Range is -99.0 - +0.0. + +@item measured_LRA, measured_lra +Measured LRA of input file. +Range is 0.0 - 99.0. + +@item measured_TP, measured_tp +Measured true peak of input file. +Range is -99.0 - +99.0. + +@item measured_thresh +Measured threshold of input file. +Range is -99.0 - +0.0. + +@item offset +Set offset gain. Gain is applied before the true-p
[FFmpeg-cvslog] avfilter/af_loudnorm: add dual_mono option
ffmpeg | branch: master | Kyle Swanson | Tue Jun 7 11:55:02 2016 -0500| [765703498aa52f38c88afb09754821b17cf60045] | committer: Kyle Swanson avfilter/af_loudnorm: add dual_mono option Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=765703498aa52f38c88afb09754821b17cf60045 --- doc/filters.texi |7 +++ libavfilter/af_loudnorm.c |7 +++ 2 files changed, 14 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index c311f56..2234734 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2765,6 +2765,13 @@ measured_I, measured_LRA, measured_TP, and measured_thresh must also to be specified in order to use this mode. Options are true or false. Default is true. +@item dual_mono +Treat mono input files as "dual-mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to @code{true}, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +Options are true or false. Default is false. + @item print_format Set print format for stats. Options are summary, json, or none. Default value is none. diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c index 9d27c16..604697e 100644 --- a/libavfilter/af_loudnorm.c +++ b/libavfilter/af_loudnorm.c @@ -60,6 +60,7 @@ typedef struct LoudNormContext { double measured_thresh; double offset; int linear; +int dual_mono; enum PrintFormat print_format; double *buf; @@ -113,6 +114,7 @@ static const AVOption loudnorm_options[] = { { "measured_thresh", "measured threshold of input file", OFFSET(measured_thresh), AV_OPT_TYPE_DOUBLE, {.dbl = -70.}, -99., 0., FLAGS }, { "offset", "set offset gain", OFFSET(offset), AV_OPT_TYPE_DOUBLE, {.dbl = 0.},-99., 99., FLAGS }, { "linear", "normalize linearly if possible",OFFSET(linear), AV_OPT_TYPE_BOOL,{.i64 = 1},0, 1, FLAGS }, +{ "dual_mono","treat mono input as dual-mono", OFFSET(dual_mono),AV_OPT_TYPE_BOOL,{.i64 = 0},0, 1, FLAGS }, { "print_format", "set print format for stats", OFFSET(print_format), AV_OPT_TYPE_INT, {.i64 = NONE}, NONE, PF_NB -1, FLAGS, "print_format" }, { "none", 0, 0, AV_OPT_TYPE_CONST, {.i64 = NONE}, 0, 0, FLAGS, "print_format" }, { "json", 0, 0, AV_OPT_TYPE_CONST, {.i64 = JSON}, 0, 0, FLAGS, "print_format" }, @@ -731,6 +733,11 @@ static int config_input(AVFilterLink *inlink) if (!s->r128_out) return AVERROR(ENOMEM); +if (inlink->channels == 1 && s->dual_mono) { +ebur128_set_channel(s->r128_in, 0, EBUR128_DUAL_MONO); +ebur128_set_channel(s->r128_out, 0, EBUR128_DUAL_MONO); +} + s->buf_size = frame_size(inlink->sample_rate, 3000) * inlink->channels; s->buf = av_malloc_array(s->buf_size, sizeof(*s->buf)); if (!s->buf) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST
ffmpeg | branch: master | Kyle Swanson | Mon Jun 29 09:58:50 2020 -0700| [4979afdb858b6312c7250afde2d669c2880651ce] | committer: Kyle Swanson configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST since libvmaf v1.5.1, libvmaf has been relicensed as BSD+Patent Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4979afdb858b6312c7250afde2d669c2880651ce --- configure| 4 ++-- doc/filters.texi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index cbaddaade9..f0eaf2ded1 100755 --- a/configure +++ b/configure @@ -1743,7 +1743,6 @@ EXTERNAL_LIBRARY_VERSION3_LIST=" liblensfun libopencore_amrnb libopencore_amrwb -libvmaf libvo_amrwbenc mbedtls rkmpp @@ -1811,6 +1810,7 @@ EXTERNAL_LIBRARY_LIST=" libtheora libtwolame libv4l2 +libvmaf libvorbis libvpx libwavpack @@ -6385,7 +6385,7 @@ enabled libtwolame&& require libtwolame twolame.h twolame_init -ltwolame die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit -enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf +enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.5.2" libvmaf.h compute_vmaf enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init diff --git a/doc/filters.texi b/doc/filters.texi index f17db3b986..ad2448acb2 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12820,7 +12820,7 @@ The obtained VMAF score is printed through the logging system. It requires Netflix's vmaf library (libvmaf) as a pre-requisite. After installing the library it can be enabled using: -@code{./configure --enable-libvmaf --enable-version3}. +@code{./configure --enable-libvmaf}. If no model path is specified it uses the default model: @code{vmaf_v0.6.1.pkl}. The filter has following options: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] libavf/libvmaf: update docs
ffmpeg | branch: master | Kyle Swanson | Mon Nov 26 15:03:38 2018 -0800| [fd2d6f376d84f1cf1a1fc2daf0560b72a8203901] | committer: Kyle Swanson libavf/libvmaf: update docs Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd2d6f376d84f1cf1a1fc2daf0560b72a8203901 --- doc/filters.texi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index d2d9788d8f..41fbbc5329 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11399,7 +11399,9 @@ Set the file path to be used to store logs. Set the format of the log file (xml or json). @item enable_transform -Enables transform for computing vmaf. +This option can enable/disable the @code{score_transform} applied to the final predicted VMAF score, +if you have specified score_transform option in the input parameter file passed to @code{run_vmaf_training.py} +Default value: @code{false} @item phone_model Invokes the phone model which will generate VMAF scores higher than in the @@ -11438,7 +11440,7 @@ ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null - Example with options: @example -ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf="psnr=1:enable-transform=1" -f null - +ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf="psnr=1:log_fmt=json" -f null - @end example @section limiter ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_libvmaf: update filter for libvmaf v2.0.0
ffmpeg | branch: master | Kyle Swanson | Fri Dec 24 12:43:50 2021 -0800| [3d29724c008d8f27fecf85757152789b074e8ef9] | committer: Kyle Swanson avfilter/vf_libvmaf: update filter for libvmaf v2.0.0 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d29724c008d8f27fecf85757152789b074e8ef9 --- configure| 4 +- doc/filters.texi | 82 +++--- libavfilter/version.h| 2 +- libavfilter/vf_libvmaf.c | 682 +++ 4 files changed, 558 insertions(+), 212 deletions(-) diff --git a/configure b/configure index 94f513288a..493493b4c5 100755 --- a/configure +++ b/configure @@ -3751,7 +3751,7 @@ vaguedenoiser_filter_deps="gpl" vflip_vulkan_filter_deps="vulkan spirv_compiler" vidstabdetect_filter_deps="libvidstab" vidstabtransform_filter_deps="libvidstab" -libvmaf_filter_deps="libvmaf pthreads" +libvmaf_filter_deps="libvmaf" zmq_filter_deps="libzmq" zoompan_filter_deps="swscale" zscale_filter_deps="libzimg const_nan" @@ -6626,7 +6626,7 @@ enabled libtwolame&& require libtwolame twolame.h twolame_init -ltwolame enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit -enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.5.2" libvmaf.h compute_vmaf +enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init diff --git a/doc/filters.texi b/doc/filters.texi index 248c09caf8..9a890d1555 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -14666,68 +14666,60 @@ ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Ca @section libvmaf -Obtain the VMAF (Video Multi-Method Assessment Fusion) -score between two input videos. +Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a +reference/distorted pair of input videos. -The first input is the encoded video, and the second input is the reference video. +The first input is the distorted video, and the second input is the reference video. The obtained VMAF score is printed through the logging system. It requires Netflix's vmaf library (libvmaf) as a pre-requisite. After installing the library it can be enabled using: @code{./configure --enable-libvmaf}. -If no model path is specified it uses the default model: @code{vmaf_v0.6.1.pkl}. The filter has following options: @table @option -@item model_path -Set the model path which is to be used for SVM. -Default value: @code{"/usr/local/share/model/vmaf_v0.6.1.pkl"} - -@item log_path -Set the file path to be used to store logs. +@item model +A `|` delimited list of vmaf models. Each model can be configured with a number of parameters. +Default value: @code{"version=vmaf_v0.6.1"} -@item log_fmt -Set the format of the log file (csv, json or xml). +@item model_path +Deprecated, use model='path=...'. @item enable_transform -This option can enable/disable the @code{score_transform} applied to the final predicted VMAF score, -if you have specified score_transform option in the input parameter file passed to @code{run_vmaf_training.py} -Default value: @code{false} +Deprecated, use model='enable_transform=true'. @item phone_model -Invokes the phone model which will generate VMAF scores higher than in the -regular model, which is more suitable for laptop, TV, etc. viewing conditions. -Default value: @code{false} +Deprecated, use model='enable_transform=true'. + +@item enable_conf_interval +Deprecated, use model='enable_conf_interval=true'. + +@item feature +A `|` delimited list of features. Each feature can be configured with a number of parameters. @item psnr -Enables computing psnr along with vmaf. -Default value: @code{false} +Deprecated, use feature='name=psnr'. @item ssim -Enables computing ssim along with vmaf. -Default value: @code{false} +Deprecated, use feature='name=ssim'. @item ms_ssim -Enables computing ms_ssim along with vmaf. -Default value: @code{false} +Deprecated, use feature='name=ms_ssim'. -@item pool -Set the pool method to be used for computing vmaf. -Options are @code{min}, @code{harmonic_mean} or @cod
[FFmpeg-cvslog] avfilter: add libvmaf_cuda
ffmpeg | branch: master | Kyle Swanson | Mon Sep 25 13:14:13 2023 +0100| [7f685d0f493bbfa44cf1b3b65f9347291e23872b] | committer: Kyle Swanson avfilter: add libvmaf_cuda Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f685d0f493bbfa44cf1b3b65f9347291e23872b --- configure| 2 + doc/filters.texi | 26 ++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_libvmaf.c | 210 +++ 5 files changed, 240 insertions(+) diff --git a/configure b/configure index 1ee8409617..6f9b223481 100755 --- a/configure +++ b/configure @@ -3833,6 +3833,7 @@ vflip_vulkan_filter_deps="vulkan spirv_compiler" vidstabdetect_filter_deps="libvidstab" vidstabtransform_filter_deps="libvidstab" libvmaf_filter_deps="libvmaf" +libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec" zmq_filter_deps="libzmq" zoompan_filter_deps="swscale" zscale_filter_deps="libzimg const_nan" @@ -6811,6 +6812,7 @@ enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uav enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init +enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init diff --git a/doc/filters.texi b/doc/filters.texi index 14a6be49ac..c25450cf6c 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -16928,6 +16928,32 @@ ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STAR @end example @end itemize +@section libvmaf_cuda + +This is the CUDA variant of the @ref{libvmaf} filter. It only accepts CUDA frames. + +It requires Netflix's vmaf library (libvmaf) as a pre-requisite. +After installing the library it can be enabled using: +@code{./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf}. + +@subsection Examples +@itemize + +@item +Basic usage showing CUVID hardware decoding and CUDA scaling with @ref{scale_cuda}: +@example +ffmpeg \ +-hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \ +-hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \ +-filter_complex " +[0:v]scale_cuda=format=yuv420p[ref]; \ +[1:v]scale_cuda=format=yuv420p[dis]; \ +[dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json +" \ +-f null - +@end example +@end itemize + @section limitdiff Apply limited difference filter using second and optionally third video stream. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 2fe0033b21..57f5809acb 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -363,6 +363,7 @@ OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o OBJS-$(CONFIG_LENSFUN_FILTER)+= vf_lensfun.o OBJS-$(CONFIG_LIBPLACEBO_FILTER) += vf_libplacebo.o vulkan.o vulkan_filter.o OBJS-$(CONFIG_LIBVMAF_FILTER)+= vf_libvmaf.o framesync.o +OBJS-$(CONFIG_LIBVMAF_CUDA_FILTER) += vf_libvmaf.o framesync.o OBJS-$(CONFIG_LIMITDIFF_FILTER) += vf_limitdiff.o framesync.o OBJS-$(CONFIG_LIMITER_FILTER)+= vf_limiter.o OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index d4184d6e80..aa49703c6e 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -339,6 +339,7 @@ extern const AVFilter ff_vf_lenscorrection; extern const AVFilter ff_vf_lensfun; extern const AVFilter ff_vf_libplacebo; extern const AVFilter ff_vf_libvmaf; +extern const AVFilter ff_vf_libvmaf_cuda; extern const AVFilter ff_vf_limitdiff; extern const AVFilter ff_vf_limiter; extern const AVFilter ff_vf_loop; diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 67f0d6a22f..2726b061ac 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -24,6 +24,8 @@ * Calculate the VMAF between two input videos. */ +#include "config_components.h" + #include #include "libavutil/avstring.h" @@ -36,6 +38,13 @@ #include "internal.h" #include "video.h" +#if CONFIG_LIBVMAF_CUDA_FILTER +#include + +#
[FFmpeg-cvslog] avfilter/libvmaf: remove deprecated options
ffmpeg | branch: master | Kyle Swanson | Thu Oct 5 13:15:06 2023 -0700| [6028728bb829c04cc68c66c846c75a70bf4c0613] | committer: Kyle Swanson avfilter/libvmaf: remove deprecated options > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6028728bb829c04cc68c66c846c75a70bf4c0613 --- doc/filters.texi | 21 --- libavfilter/vf_libvmaf.c | 97 2 files changed, 118 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index a729a08dce..f5032ddf74 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -16858,30 +16858,9 @@ The filter has following options: A `|` delimited list of vmaf models. Each model can be configured with a number of parameters. Default value: @code{"version=vmaf_v0.6.1"} -@item model_path -Deprecated, use model='path=...'. - -@item enable_transform -Deprecated, use model='enable_transform=true'. - -@item phone_model -Deprecated, use model='enable_transform=true'. - -@item enable_conf_interval -Deprecated, use model='enable_conf_interval=true'. - @item feature A `|` delimited list of features. Each feature can be configured with a number of parameters. -@item psnr -Deprecated, use feature='name=psnr'. - -@item ssim -Deprecated, use feature='name=ssim'. - -@item ms_ssim -Deprecated, use feature='name=ms_ssim'. - @item log_path Set the file path to be used to store log files. diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 2726b061ac..18196c6734 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -76,18 +76,11 @@ typedef struct LIBVMAFContext { #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption libvmaf_options[] = { -{"model_path", "use model='path=...'.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"log_path", "Set the file path to be used to write log.", OFFSET(log_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, {"log_fmt", "Set the format of the log (csv, json, xml, or sub).", OFFSET(log_fmt), AV_OPT_TYPE_STRING, {.str="xml"}, 0, 1, FLAGS}, -{"enable_transform", "use model='enable_transform=true'.", OFFSET(enable_transform), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, -{"phone_model", "use model='enable_transform=true'.", OFFSET(phone_model), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, -{"psnr", "use feature='name=psnr'.", OFFSET(psnr), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, -{"ssim", "use feature='name=float_ssim'.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, -{"ms_ssim", "use feature='name=float_ms_ssim'.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"pool", "Set the pool method to be used for computing vmaf.", OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, {"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, {"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, -{"enable_conf_interval", "model='enable_conf_interval=true'.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"model", "Set the model to be used for computing vmaf.", OFFSET(model_cfg), AV_OPT_TYPE_STRING, {.str="version=vmaf_v0.6.1"}, 0, 1, FLAGS}, {"feature", "Set the feature to be used for computing vmaf.", OFFSET(feature_cfg), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, { NULL } @@ -440,92 +433,6 @@ static enum VmafLogLevel log_level_map(int log_level) } } -static int parse_deprecated_options(AVFilterContext *ctx) -{ -LIBVMAFContext *s = ctx->priv; -VmafModel *model = NULL; -VmafModelCollection *model_collection = NULL; -enum VmafModelFlags flags = VMAF_MODEL_FLAGS_DEFAULT; -int err = 0; - -VmafModelConfig model_cfg = { -.name = "vmaf", -.flags = flag
[FFmpeg-cvslog] avfilter/libvmaf: update pix_fmts
ffmpeg | branch: master | Kyle Swanson | Tue Oct 10 12:55:53 2023 -0700| [2e33f5ced0c9ae2c2d9d6aa1a5535ae637d48ce7] | committer: Kyle Swanson avfilter/libvmaf: update pix_fmts Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e33f5ced0c9ae2c2d9d6aa1a5535ae637d48ce7 --- libavfilter/vf_libvmaf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 18196c6734..2b1fc8bb23 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -463,6 +463,8 @@ static av_cold int init(AVFilterContext *ctx) static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV420P10LE, +AV_PIX_FMT_YUV444P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV420P12LE, +AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_NONE }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/libvmaf: fix broken cuda build
ffmpeg | branch: master | Kyle Swanson | Tue Oct 24 13:48:07 2023 -0700| [e5f774268a06c637df5edb3dffa237caf6e678ea] | committer: Kyle Swanson avfilter/libvmaf: fix broken cuda build Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5f774268a06c637df5edb3dffa237caf6e678ea --- libavfilter/vf_libvmaf.c | 4 1 file changed, 4 deletions(-) diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 2b1fc8bb23..12810b7267 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -704,10 +704,6 @@ static int config_props_cuda(AVFilterLink *outlink) if (err < 0) return err; -err = parse_deprecated_options(ctx); -if (err) -return err; - err = parse_models(ctx); if (err) return err; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/libvmaf: small cleanup for style, whitespace, unused LIBVMAFContext struct members
ffmpeg | branch: master | Kyle Swanson | Mon Nov 27 10:25:08 2023 -0800| [9f1dbca8207ff76378a66ab39378be991f792a37] | committer: Kyle Swanson avfilter/libvmaf: small cleanup for style, whitespace, unused LIBVMAFContext struct members Signed-off-by: Kyle Swanson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f1dbca8207ff76378a66ab39378be991f792a37 --- libavfilter/vf_libvmaf.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 12810b7267..9aec61de19 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -48,18 +48,11 @@ typedef struct LIBVMAFContext { const AVClass *class; FFFrameSync fs; -char *model_path; char *log_path; char *log_fmt; -int enable_transform; -int phone_model; -int psnr; -int ssim; -int ms_ssim; char *pool; int n_threads; int n_subsample; -int enable_conf_interval; char *model_cfg; char *feature_cfg; VmafContext *vmaf; @@ -175,7 +168,6 @@ static int do_vmaf(FFFrameSync *fs) return ff_filter_frame(ctx->outputs[0], dist); } - static AVDictionary **delimited_dict_parse(char *str, unsigned *cnt) { AVDictionary **dict = NULL; @@ -606,7 +598,8 @@ static const AVFilterPad libvmaf_inputs[] = { { .name = "main", .type = AVMEDIA_TYPE_VIDEO, -},{ +}, +{ .name = "reference", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_input_ref, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".