From patchwork Mon Jul 3 13:09:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Singh X-Patchwork-Id: 4201 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp9372172vsb; Mon, 3 Jul 2017 06:12:01 -0700 (PDT) X-Received: by 10.223.128.80 with SMTP id 74mr33748448wrk.9.1499087520951; Mon, 03 Jul 2017 06:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499087520; cv=none; d=google.com; s=arc-20160816; b=Yo66j167mOHfCuPHR1Pf3A6sVQDrvGdgdgJM6lMUfXSLv/zridapVj4Fre6LNWO8lH +6i9GBmq2m1DRRKUMWOFKjs8TqOqvSyByecl+6NPPLiXPgtTDbLM4yNhtz0V4Bgl3l0d UBW1tJY+JsjE8MBIbE1NNHq41CXrxMWHfUxILv2TSLAsLPLql/JpMCpHyyJGG3DrGb3z TLvnxsP/GRYk370fcg6ID1kyCyfiQd2dnpIeWsdD5rMD9w+9/MfcWOgrnVWj1nOSJZJr XiTtbhGzDGoo1wqj7Ce2Dl8jp0QfifNgYh2vrTDPRzEe2CmhG0deo+X/PPB1427bT4P5 m/ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=0ZowQRWME+v5YI5AR7liT5CN5P2/+BEzhf3CtC2AiiM=; b=Kf183+dE8jSF3YMYvTAvCGDrja+vXKN1CDqlIvJX+Y9IcL1ZrWykyT4TlnZ/RTxSLI IeyoVRfk1JXAHVqvsvzR+fNrKGN3Y3mCO32gH0BABCovAtcu9hmeU298AGbij2Ki9Op8 u3ytS4/HtLAy5c6Ots+11G5/2nJWcGb3XxvSQhIYC7+91fyaKBuOW5B65MaWSX/2qX4x IHI0x4aE9ssyCf+E/jBlZYSmXpwfn9bxRxM1QlGmfa2OmSl119jkmwgGc5aAKmQ00taX NpKJ3LVVRoTdENYTF5tqPpEESoWyvLikJrSM1kt11kGe+6/0kDNm1cMvvzHu9BdgWVol fSPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=Li23G3SH; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c19si11326476wre.235.2017.07.03.06.11.59; Mon, 03 Jul 2017 06:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=Li23G3SH; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B13616882CF; Mon, 3 Jul 2017 16:11:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9678E6882B3 for ; Mon, 3 Jul 2017 16:11:49 +0300 (EEST) Received: by mail-pf0-f196.google.com with SMTP id z6so25894581pfk.3 for ; Mon, 03 Jul 2017 06:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iL0M41Iylb+rk8Av9EsZajG/4viZ5UkudUD4oFrMPhk=; b=Li23G3SH982eeFYOLpCKL8f0WHT9XMgZvp0irGeVLvVzmQZP87vBSAPE8+dT+C4xRs 8Wwi75v1vidS8GvD8qa/kowCzjUZUwX643JxywWlOvUztywDm5G8vjESSCCseL3jjo/7 LCejICFOIiCnwm8nUDil1vwoHLDhjbv3EUCvfCPolLOqmJHmB0Rve+m2qQkGBN3/htFi U+mVy7kjjrbBNwcsScIJw1xNJ3xaa8SSPMCy8Oo26ZAoXt4CYl+qBnFiSOBVIJL8e9aW BlkCp2HU6nyQviXXFEBildWC1xGr07+/tkqmGRL1L2umWeyINfFqwQ+b2u9ptAez4UyS 4sNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iL0M41Iylb+rk8Av9EsZajG/4viZ5UkudUD4oFrMPhk=; b=iOXXZvTCsMA+/PhRRdFp/GigEeE9UN6iJiBJHXfhK+ZceEsCodrbKk6ybFJtwuKg4V 1Es2WttZP+/u9PkoSjKas+ZbueM5wWcFZCBHFiUVGV7EPkVpwAl9YoqLj+aEaqO1Sl2u nsW1gjjb7r5lu02XBrB07nFkKPvwERVGnKAQW/bYZnLTkDIVepxHu2gZ3CYEbbKEixm3 wbWg8LlnjEFQ6mpi0b6q9eIt2RVjc/sv32uCcEgDGeZZ7VLvbMH7qaSpFhD5vIrgu0bF 7OXvMOq0ZdUe03TJuQql4G/pKEoZTUlfNhXy7XF2ZaljZ1/nd54STpRDhPoDWKzk8EPO SRZA== X-Gm-Message-State: AIVw112GhKtqkujixw+soggOD/b/HBBzuFbufD3QvuLBLVNlOLs8WTC+ T+a9jze0gSWVq2kd X-Received: by 10.84.198.3 with SMTP id o3mr10335984pld.84.1499087509049; Mon, 03 Jul 2017 06:11:49 -0700 (PDT) Received: from localhost.localdomain ([117.244.46.185]) by smtp.gmail.com with ESMTPSA id v9sm34532511pge.26.2017.07.03.06.11.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Jul 2017 06:11:47 -0700 (PDT) From: Ashish Singh To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Jul 2017 18:39:38 +0530 Message-Id: <1499087378-7258-1-git-send-email-ashk43712@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH] avfilter: add ANSNR filter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Ashish Singh MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This is ANSNR filter, one of the component filters of VMAF. Run it using: ffmpeg -i main -i ref -lavfi ansnr -f null - Currently it outputs the average ansnr score over all frames. --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/ansnr.h | 32 ++++ libavfilter/vf_ansnr.c | 403 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 437 insertions(+) create mode 100644 libavfilter/ansnr.h create mode 100644 libavfilter/vf_ansnr.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index f7dfe8a..705e5a1 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -124,6 +124,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER) += asink_anullsink.o # video filters OBJS-$(CONFIG_ALPHAEXTRACT_FILTER) += vf_extractplanes.o OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o +OBJS-$(CONFIG_ANSNR_FILTER) += vf_ansnr.o dualinput.o framesync.o OBJS-$(CONFIG_ASS_FILTER) += vf_subtitles.o OBJS-$(CONFIG_ATADENOISE_FILTER) += vf_atadenoise.o OBJS-$(CONFIG_AVGBLUR_FILTER) += vf_avgblur.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index cd35ae4..c1f67c4 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -136,6 +136,7 @@ static void register_all(void) REGISTER_FILTER(ALPHAEXTRACT, alphaextract, vf); REGISTER_FILTER(ALPHAMERGE, alphamerge, vf); + REGISTER_FILTER(ANSNR, ansnr, vf); REGISTER_FILTER(ASS, ass, vf); REGISTER_FILTER(ATADENOISE, atadenoise, vf); REGISTER_FILTER(AVGBLUR, avgblur, vf); diff --git a/libavfilter/ansnr.h b/libavfilter/ansnr.h new file mode 100644 index 0000000..effd722 --- /dev/null +++ b/libavfilter/ansnr.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017 Ronald S. Bultje + * Copyright (c) 2017 Ashish Pratap Singh + * + * 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 + */ + +#ifndef AVFILTER_PSNR_H +#define AVFILTER_PSNR_H + +#include +#include + +static int compute_ansnr(const void *ref, const void *dis, int w, + int h, int ref_stride, int dis_stride, double *score, + double *score_psnr, double peak, double psnr_max, void *ctx); + +#endif /* AVFILTER_PSNR_H */ diff --git a/libavfilter/vf_ansnr.c b/libavfilter/vf_ansnr.c new file mode 100644 index 0000000..f8d44bf --- /dev/null +++ b/libavfilter/vf_ansnr.c @@ -0,0 +1,403 @@ +/* + * Copyright (c) 2017 Ronald S. Bultje + * Copyright (c) 2017 Ashish Pratap Singh + * + * 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 + */ + +/** + * @file + * Calculate the ANSNR between two input videos. + */ + +#include +#include "libavutil/avstring.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "dualinput.h" +#include "drawutils.h" +#include "formats.h" +#include "internal.h" +#include "ansnr.h" +#include "video.h" + +typedef struct ANSNRContext { + const AVClass *class; + FFDualInputContext dinput; + int width; + int height; + char *format; + float *data_buf; + double ansnr_sum; + uint64_t nb_frames; +} ANSNRContext; + +#define OFFSET(x) offsetof(ANSNRContext, x) +#define MAX_ALIGN 32 +#define ALIGN_CEIL(x) ((x) + ((x) % MAX_ALIGN ? MAX_ALIGN - (x) % MAX_ALIGN : 0)) +#define OPT_RANGE_PIXEL_OFFSET (-128) + +const int ansnr_filter2d_ref_width = 3; +const int ansnr_filter2d_dis_width = 5; +const float ansnr_filter2d_ref[3 * 3] = { + 1.0 / 16.0, 2.0 / 16.0, 1.0 / 16.0, + 2.0 / 16.0, 4.0 / 16.0, 2.0 / 16.0, + 1.0 / 16.0, 2.0 / 16.0, 1.0 / 16.0 +}; +const float ansnr_filter2d_dis[5 * 5] = { + 2.0 / 571.0, 7.0 / 571.0, 12.0 / 571.0, 7.0 / 571.0, 2.0 / 571.0, + 7.0 / 571.0, 31.0 / 571.0, 52.0 / 571.0, 31.0 / 571.0, 7.0 / 571.0, + 12.0 / 571.0, 52.0 / 571.0, 127.0 / 571.0, 52.0 / 571.0, 12.0 / 571.0, + 7.0 / 571.0, 31.0 / 571.0, 52.0 / 571.0, 31.0 / 571.0, 7.0 / 571.0, + 2.0 / 571.0, 7.0 / 571.0, 12.0 / 571.0, 7.0 / 571.0, 2.0 / 571.0 +}; + +static const AVOption ansnr_options[] = { + { NULL } +}; + +AVFILTER_DEFINE_CLASS(ansnr); + +static inline double get_ansnr_avg(double ansnr_sum, uint64_t nb_frames) +{ + return ansnr_sum / nb_frames; +} + +static inline float pow_2(float base) +{ + return base*base; +} + +static void ansnr_mse(float *ref, float *dis, float *signal, float *noise, + int w, int h, int ref_stride, int dis_stride) +{ + int i, j; + + int ref_ind; + int dis_ind; + + float signal_sum = 0; + float noise_sum = 0; + + for (i = 0; i < h; ++i) { + for (j = 0; j < w; ++j) { + ref_ind = i * ref_stride + j; + dis_ind = i * dis_stride + j; + + signal_sum += pow_2(ref[ref_ind]); + noise_sum += pow_2(ref[ref_ind] - dis[dis_ind]); + } + } + + if (signal) { + *signal = signal_sum; + } + if (noise) { + *noise = noise_sum; + } +} + +static void ansnr_filter2d(const float *filt, const void *src, float *dst, + int w, int h, int src_stride, int dst_stride, + int filt_width, ANSNRContext *s) +{ + uint8_t type; + uint8_t sz; + + uint8_t *src_8bit = (uint8_t *) src; + uint16_t *src_10bit = (uint16_t *) src; + + int src_px_stride; + + float filt_coeff, img_coeff; + int i, j, filt_i, filt_j, src_i, src_j; + + if (!strcmp(s->format, "yuv420p") || !strcmp(s->format, "yuv422p") || + !strcmp(s->format, "yuv444p")) { + type = 8; + sz = sizeof(uint8_t); + } + else if (!strcmp(s->format, "yuv420p10le") || !strcmp(s->format, + "yuv422p10le") || !strcmp(s->format, "yuv444p10le")) { + type = 10; + sz = sizeof(uint16_t); + } + + src_px_stride = src_stride / sizeof(sz); + + for (i = 0; i < h; ++i) { + for (j = 0; j < w; ++j) { + float accum = 0; + for (filt_i = 0; filt_i < filt_width; ++filt_i) { + for (filt_j = 0; filt_j < filt_width; ++filt_j) { + filt_coeff = filt[filt_i * filt_width + filt_j]; + + src_i = i - filt_width / 2 + filt_i; + src_j = j - filt_width / 2 + filt_j; + + src_i = FFABS(src_i); + if (src_i >= h) { + src_i = 2 * h - src_i - 1; + } + src_j = FFABS(src_j); + if (src_j >= w) { + src_j = 2 * w - src_j - 1; + } + + if (type == 8) { + img_coeff = src_8bit[src_i * src_px_stride + src_j] + + OPT_RANGE_PIXEL_OFFSET; + } else { + img_coeff = src_10bit[src_i * src_px_stride + src_j] + + OPT_RANGE_PIXEL_OFFSET; + } + + accum += filt_coeff * img_coeff; + } + } + dst[i * dst_stride + j] = accum; + } + } +} + +static int compute_ansnr(const void *ref, const void *dis, int w, int h, + int ref_stride, int dis_stride, double *score, + double *score_psnr, double peak, double psnr_max, + void *ctx) +{ + ANSNRContext *s = (ANSNRContext *) ctx; + + char *data_top; + + float *ref_filt; + float *dis_filt; + + float signal, noise; + + int buf_stride = ALIGN_CEIL(w * sizeof(float)); + size_t buf_sz = (size_t) (buf_stride * h); + + double eps = 1e-10; + + data_top = (float *) (s->data_buf); + + ref_filt = (float *) data_top; + data_top += buf_sz; + dis_filt = (float *) data_top; + data_top += buf_sz; + + buf_stride = buf_stride / sizeof(float); + + ansnr_filter2d(ansnr_filter2d_ref, ref, ref_filt, w, h, ref_stride, + buf_stride, ansnr_filter2d_ref_width, s); + ansnr_filter2d(ansnr_filter2d_dis, dis, dis_filt, w, h, dis_stride, + buf_stride, ansnr_filter2d_dis_width, s); + + ansnr_mse(ref_filt, dis_filt, &signal, &noise, w, h, buf_stride, + buf_stride); + + *score = (noise==0) ? (psnr_max) : (10.0 * log10(signal / noise)); + + *score_psnr = FFMIN(10 * log10(pow_2(peak) * w * h / FFMAX(noise, eps)), + psnr_max); + + return 0; +} + +static AVFrame *do_ansnr(AVFilterContext *ctx, AVFrame *main, const AVFrame *ref) +{ + ANSNRContext *s = ctx->priv; + + char *format = s->format; + + double score = 0.0; + double score_psnr = 0; + + int w = s->width; + int h = s->height; + + double stride; + + double max_psnr; + double peak; + + uint8_t sz; + + if (!strcmp(format, "yuv420p") || !strcmp(format, "yuv422p") || + !strcmp(format, "yuv444p")) { + peak = 255.0; + max_psnr = 60; + sz = sizeof(uint8_t); + } + else if (!strcmp(format, "yuv420p10le") || !strcmp(format, "yuv422p10le") || + !strcmp(format, "yuv444p10le")) { + peak = 255.75; + max_psnr = 72; + sz = sizeof(uint16_t); + } + + stride = ALIGN_CEIL(w * sz); + + compute_ansnr(ref->data[0], main->data[0], w, h, stride, stride, &score, + &score_psnr, peak, max_psnr, s); + + s->nb_frames++; + + s->ansnr_sum += score; + + return main; +} + +static av_cold int init(AVFilterContext *ctx) +{ + ANSNRContext *s = ctx->priv; + + s->dinput.process = do_ansnr; + + return 0; +} + +static int query_formats(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_NONE + }; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); +} + +static int config_input_ref(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + ANSNRContext *s = ctx->priv; + int buf_stride; + size_t buf_sz; + + if (ctx->inputs[0]->w != ctx->inputs[1]->w || + ctx->inputs[0]->h != ctx->inputs[1]->h) { + av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n"); + return AVERROR(EINVAL); + } + if (ctx->inputs[0]->format != ctx->inputs[1]->format) { + av_log(ctx, AV_LOG_ERROR, "Inputs must be of same pixel format.\n"); + return AVERROR(EINVAL); + } + + s->width = ctx->inputs[0]->w; + s->height = ctx->inputs[0]->h; + s->format = av_get_pix_fmt_name(ctx->inputs[0]->format); + + buf_stride = ALIGN_CEIL(s->width * sizeof(float)); + buf_sz = (size_t)buf_stride * s->height; + + if (SIZE_MAX / buf_sz < 3) { + av_log(ctx, AV_LOG_ERROR, "insufficient size.\n"); + return AVERROR(EINVAL); + } + + if (!(s->data_buf = av_malloc(buf_sz * 3))) { + av_log(ctx, AV_LOG_ERROR, "data_buf allocation failed.\n"); + return AVERROR(EINVAL); + } + + return 0; +} + + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + ANSNRContext *s = ctx->priv; + AVFilterLink *mainlink = ctx->inputs[0]; + int ret; + + outlink->w = mainlink->w; + outlink->h = mainlink->h; + outlink->time_base = mainlink->time_base; + outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio; + outlink->frame_rate = mainlink->frame_rate; + if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0) + return ret; + + return 0; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) +{ + ANSNRContext *s = inlink->dst->priv; + return ff_dualinput_filter_frame(&s->dinput, inlink, inpicref); +} + +static int request_frame(AVFilterLink *outlink) +{ + ANSNRContext *s = outlink->src->priv; + return ff_dualinput_request_frame(&s->dinput, outlink); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + ANSNRContext *s = ctx->priv; + + ff_dualinput_uninit(&s->dinput); + + av_free(s->data_buf); + + av_log(ctx, AV_LOG_INFO, "ANSNR AVG: %.3f\n", get_ansnr_avg(s->ansnr_sum, + s->nb_frames)); +} + +static const AVFilterPad ansnr_inputs[] = { + { + .name = "main", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = filter_frame, + },{ + .name = "reference", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = filter_frame, + .config_props = config_input_ref, + }, + { NULL } +}; + +static const AVFilterPad ansnr_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + .request_frame = request_frame, + }, + { NULL } +}; + +AVFilter ff_vf_ansnr = { + .name = "ansnr", + .description = NULL_IF_CONFIG_SMALL("Calculate the ANSNR between two video streams."), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + .priv_size = sizeof(ANSNRContext), + .priv_class = &ansnr_class, + .inputs = ansnr_inputs, + .outputs = ansnr_outputs, +};