From patchwork Sat Sep 30 19:40:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 5353 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.197 with SMTP id n188csp2148276jan; Sat, 30 Sep 2017 12:41:01 -0700 (PDT) X-Received: by 10.28.148.67 with SMTP id w64mr6120908wmd.132.1506800461070; Sat, 30 Sep 2017 12:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506800461; cv=none; d=google.com; s=arc-20160816; b=pgCFTJeD51pVb8m6FNYaLNmermMOM+TFzX8yE9oUeIhWyVLl3SAe92FAizVeVez1Cs 3xF5WlG3TOavArGRvutRtndSjLg2Y3xENnnFjFB4ArRJtu1TwmHzbLI4jKjveomkPJar XG6UJR14welL8ohLQ7czKLubQeNMTvvJQOFxlDnJ3TC+Ba3klxp8qZ2M0CXht3RS7kZs uJug5OucJrfP8mZ5lOtR+UeP7CS3DcJDU/11uaTTQkPf3okB0XJoSd2rh04hYjBUAeYc M1FgAFuQ1wCtavD1zo981QVFD/pqD9GABVx4WS9HoxLUsiBdHjFiwFvWWbtcx+5ATCTQ 7wwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=d0DSlukGYZcyJWUHkyAU6bN/Yy3O4rUn/rBqppGEGIo=; b=xWk3uONaSSqND+aQ9EGtVuDy6ZlkwIOy7BVUhieXXQhAfaRH8JYZTRELpBefQp42u1 xXjWOJj6UvzIT8qTWpRHQjIpIw2I2/eCcIh/DBxouBAOWZx609+ngx6l/L6H9O43pu3i cR7vHzCfzeT8oUf33SA0RDQGFIXnzSZaQt63xwaQIgUKJavzBm3r9YHX4DBf6zaAsQIs U/olCzsQx101jRxvK7Sy5cF6EoelqsGuZKDE10jope0fwkic2+K4fWXhUigC9n7JB3nC XvngybJHgWeEz/6VRO6m2aFm2uFSt9UT6H1MN2CCDHQXUEccmWVh6pt/mM0DSNMW5Vb3 8Chw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=pRaJu2EG; 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 n66si3047478wrb.411.2017.09.30.12.41.00; Sat, 30 Sep 2017 12:41:01 -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.s=20161025 header.b=pRaJu2EG; 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 83647689C07; Sat, 30 Sep 2017 22:40:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 068FA689BCA for ; Sat, 30 Sep 2017 22:40:39 +0300 (EEST) Received: by mail-io0-f171.google.com with SMTP id q11so2153541ioe.10 for ; Sat, 30 Sep 2017 12:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=wPrTZ1PSuyYEq/y6yXPGP+4jEB6N04A0t2e0N6l5UB8=; b=pRaJu2EGCdXlIwR/odqTw3Z2/7JyD40Gx4A6Ht1s13/9A2kTZG5JZbiKwb+5vNRv6+ kN/RsliXxh2jnvS7TWWjkOpY3KHcbpl55hC935MOXSHT+O/hJbwTlYgnCAhsbCVJOqic eQGPYeQ37i0URpRrSNkeM7xpZPbAdZpBV8MQA+58F1EN46QXJf4QbID1W1TYIhq3/zmZ eWrC3cLhou4PCKGZsKZ8ZxQuPZuby+TyNwx8E4IYJX8uzXMm4wIq+QhM4cEno8BbmPRz WcrMCHuLeXluzHVisM0LkKjo7XrercdrP29kCiHVa6fEjrJsdmjILCIGOtFwZhBa8KOX iawg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=wPrTZ1PSuyYEq/y6yXPGP+4jEB6N04A0t2e0N6l5UB8=; b=MuSy6/tZxMGPcB0WUYT/Z2yUWauT1UXZSA1ixmw07pSWD5AWO5xz2jOB6EkWpmAxo2 KEyZCEFFmQy9RdVSDx3V+c2e9IH08ZXBHvQwwDcX8L1URSzoi++B+/5+oiQirLX6VXxL Ta0V5dnw36axJO+Rc62r0ohPHCkCiWHNFqMMRjnw02le+MSedtQHQ/jAdqRfe9TbM43G Th4CN8BFJGeg/4sl080br8i48qRU1yn3cMsgsNaiUp9w0xJnl7BfvauFGl4eUu9QU9wS EnYUX9F1x0G+Da8o3pa8fI5AeGgwJiHXd4MCFcwl0Uelk0VKtxKe5DRpquu09TZJmwXQ 4WKw== X-Gm-Message-State: AMCzsaXohrOcENgTjlZmumRuhsazP63K973Bw53xFJgfrdvIXoXKQw9+ D5cTbhVHahpsjYq9dAta3J3Otr/HL1T3lCgmcdw= X-Google-Smtp-Source: AOwi7QAXn/PdY6s5hyw9oB/R+Y6vpVlxFLeeJb1PybziMQos4eljRZOY6b6dNTnk6WkR440l3Pv5j37iPQxyJHbbpmM= X-Received: by 10.107.132.84 with SMTP id g81mr19193071iod.47.1506800451190; Sat, 30 Sep 2017 12:40:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.81.137 with HTTP; Sat, 30 Sep 2017 12:40:30 -0700 (PDT) In-Reply-To: References: <1504728287-16766-1-git-send-email-ashk43712@gmail.com> <1505508478-17076-1-git-send-email-ashk43712@gmail.com> From: Carl Eugen Hoyos Date: Sat, 30 Sep 2017 21:40:30 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 2017-09-30 20:30 GMT+02:00 Ronald S. Bultje : > Hi Carl, > > On Sat, Sep 30, 2017 at 2:19 PM, Carl Eugen Hoyos > wrote: > >> 2017-09-30 19:47 GMT+02:00 Ronald S. Bultje : >> > Hi Carl, >> > >> > On Sat, Sep 30, 2017 at 1:31 PM, Carl Eugen Hoyos >> > wrote: >> > >> >> Hi! >> >> >> >> 2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh : >> >> >> >> > +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_YUV444P10, AV_PIX_FMT_YUV422P10, >> >> > AV_PIX_FMT_YUV420P10, >> >> >> >> Is the algorithm only defined for these formats and bit-depth >> >> or are there just missing features? >> >> Gray and gray10 come to mind... >> >> >> > >> > Great question! I _believe_ that vmaf overall is luma-only, so it should >> be >> > entirely independent of chroma. >> >> Then imo, above function is just wrong, it should check for >> non-rgb or similar (think of YUVA444 and friends). >> > > I don't think I'm familiar enough with lavfi to send a patch, can you send > one? What I've asked Ashish to do (and what he's done here) is simply to > reproduce as closely as possible what Netflix' code does, and they only > support 420, 422 and 444 for 8 and 10 bits/component. I'm happy to support > more if I know how to. Attached patch also support GBRP, I don't know if this is a good or bad idea. Carl Eugen From c7da156438424bf9b08aaddaada4967868d28105 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 30 Sep 2017 21:39:08 +0200 Subject: [PATCH] lavfi/vmafmotion: Allow more pix_fmts. --- libavfilter/vf_vmafmotion.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c index 6b6150a..48986b7 100644 --- a/libavfilter/vf_vmafmotion.c +++ b/libavfilter/vf_vmafmotion.c @@ -261,15 +261,19 @@ int ff_vmafmotion_init(VMAFMotionData *s, 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_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10, - AV_PIX_FMT_NONE - }; - - AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); - if (!fmts_list) - return AVERROR(ENOMEM); + AVFilterFormats *fmts_list = NULL; + int format, ret; + + for (format = 0; av_pix_fmt_desc_get(format); format++) { + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); + if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) && + (desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) && + (!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth == 8) && + (desc->comp[0].depth == 8 || desc->comp[0].depth == 10) && + (ret = ff_add_format(&fmts_list, format)) < 0) + return ret; + } + return ff_set_common_formats(ctx, fmts_list); } -- 1.7.10.4