[FFmpeg-devel] [PATCH] Added VMAF filter linking to Netflix's vmaf library

Ronald S. Bultje rsbultje at gmail.com
Wed Jun 21 16:22:11 EEST 2017


Hi,

On Wed, Jun 21, 2017 at 8:16 AM, Ashish Singh <ashk43712 at gmail.com> wrote:

> This is VMAF filter which requires Netflix's vmaf library


Very cool!

(For those not aware, this is a GSoC project, it's work-in-progress but it
can already generate VMAF scores identical to what Netflix' command-line
utility gives.)

Please keep the commit message in the typical style of ffmpeg patches.
First line should be short, e.g. "avfilter: add VMAF filter", and then an
empty line, and then a description (like you did here), but wrapped at 80
characters per line.


> +#include "vmaf.h"
>

This include file is unused and can probably be removed.

+typedef struct VMAFContext {
> +    const AVClass *class;
> +    FFDualInputContext dinput;
> +    uint64_t nb_frames;
> +    FILE *stats_file;
> +    char *stats_file_str;
> +    int stats_version;
> +    int stats_header_written;
> +    int stats_add_max;
>


> +    pthread_t thread;
> +    pthread_attr_t attr;
>

I believe these two are unused.


> +    int nb_components;
> +    double vmaf_sum;
>


> +    VMAFDSPContext dsp;
>

This one also.


> +} VMAFContext;
> +
> +
> +static char *format;
> +static int width, height;
> +pthread_mutex_t lock;
> +pthread_cond_t cond;
> +pthread_t main_thread_id;
> +pthread_t vmaf_thread_id;
> +int eof = 0;
> +double vmaf_score;
> +double curr_vmaf_score;
> +AVFrame *gmain;
> +AVFrame *gref;
>

These should be moved into VMAFContext. You can pass this as a void
*user_data argument into the call to vmaf_calculate(), which can then pass
it back in the read_frame() callback.

Ronald


More information about the ffmpeg-devel mailing list