From patchwork Mon Oct 18 11:29:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Mamalakis X-Patchwork-Id: 31140 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3187541ioa; Mon, 18 Oct 2021 04:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJCJHTOq3lVOvLa0NNj5cw+Hq9AXDHmffV2kAm1hcNsfguYlm+H1A3XocHeLPTyWFARZXS X-Received: by 2002:a05:6402:50d4:: with SMTP id h20mr42767535edb.112.1634556617357; Mon, 18 Oct 2021 04:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634556617; cv=none; d=google.com; s=arc-20160816; b=ZZyY7QNeau4liaWbeGcZr/I7mCHFBpHO1GHqZkyDSH0sL6wRUuVyGpdU3VD+w6Q3jk 6pyh9Ei2UI2q8/SbB4+vvAP2FSP1STeUXXHa/0LvA9ilRT/GN9DuF0EapdczWtOYgQbP cM+fXaXt/GFMakwndnpI66e7dvmDyk8tCElSoIIZaveua6HTtXP/KCOpktcBqZfUkB4c WOwuL9c8JENUJ89nnJuIRNsB/rq8yvTN+kV76b4DGXJzREVXFvgOlPMeS1YI+qe2qg2+ 7AzLKaotoPa19F6wfzgGm505FCHXGw0K+RZSiDVlIzjrvLPGUTqwrhrTQWql2wlNTihZ Q96Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=NtKciN4ecUS+EHH4k/imszmevlQSmQOalssxddpHqk4=; b=Ie9zbrJ7OUILtmil4JnI01782kb3y52d5JCEsvxenARSJhx/JP6FfiTjeap+LwJ8g0 txDpDUqtKE4lulQP8SExaKArLAqaACCt24BFztACDXos+nJkHw4chXfg5pI423ltnHhr qpraya38gkQE4Rws22z+fDA/Yy98LPVqKckpUbXCaPrdHS8aG7nORSBeGPLnwhpo7drR RBMRbU7Y9cTCJ5Oe651frnoZ9pan/iWds4X/3CRv3DOO1nK648VqNBVX/q9rEzdREWIK bJdzEJ4UEUj2qP9PpSXMTKXOULyM5SX4Q6rr2rUgKhpydoYYFtlDAINNee0pbUbpZgAs T2RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@boffins-se.20210112.gappssmtp.com header.s=20210112 header.b="pSHSYw/j"; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y12si19278623edj.628.2021.10.18.04.30.04; Mon, 18 Oct 2021 04:30:17 -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=@boffins-se.20210112.gappssmtp.com header.s=20210112 header.b="pSHSYw/j"; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4CEB468A605; Mon, 18 Oct 2021 14:30:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9D4D5680610 for ; Mon, 18 Oct 2021 14:29:53 +0300 (EEST) Received: by mail-ed1-f41.google.com with SMTP id 5so39214845edw.7 for ; Mon, 18 Oct 2021 04:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boffins-se.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8QfiDNib98juQwjfeeW89KRWi1qoc7FmVntxZA2miy4=; b=pSHSYw/jJRXl5C5G2g/Ah3VPgQDfQ35tIldVJcpF9uI/Qw3w698+CWHGOPPOzbJ/2w H17hdXzq954LpYHNP43wjhSlsCHSCZaH9XPD5xek986sFXbNWDkHSC2KhgSUjx+MjRG/ xokIscqeVibTW62xgWP3OIcxvMTwNiZ3aHCXLI2youAMBf3bvXzQBNwP0tJ3PImYv49y HmAfk68eaqBWX96H1muYuL3tDVJ4Mgb2f9wUAZtKpQGadvTdvRvxxuZ5I6FbPmkmTIlU eNCw+AvE8R4OTlKLfTzCstGcM+CJWY9hI7i/QiXDGho/fMNvdNXdDBjGTBtH4MAkYnyi 816w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8QfiDNib98juQwjfeeW89KRWi1qoc7FmVntxZA2miy4=; b=Owywoj+RSCS85WrEoi2oL480l3HllWqS2gvXulaJPHIJtR3cw647vb4vMtM9CgEpRx I5p2nEKzOVew1Or6zsaXLeDU0zlGIADcJwKlJgJ79mYEVY/VggKUfxCPcv1+1Yg+jFA3 3J7F1ClNrMH8Avjb2DEUxhsergNuwxzmgTbi935Yfkbqwm4ZZsBwB7OT3D+R9x1J7R2O 8kDpqDdb5zzRNsYSCXnXtLNHfc4gzKX5Uyh1SCi99XqKCdEo2Jxy7hDcaPXJ+xRfdgTf MnPkSgjwsdd8GxWUv4fciv6RDIjPoyGqNKrjKd/6qtOUO7Z5wIhnUuugpeoHnbiOtDlL rqww== X-Gm-Message-State: AOAM5328LLueJgGk5/qmGbASXQqBWvJtl5aahqieTEMlsnnWAykzzXkp FxjYh0knGdVZTzfueMB2sG+UYXMhl64mNetfYpz8ssObobWyqk3XkRMW3GsGtX85wB5Zd3D7rVu p0XNFW11OU9AVhfzZ7gWoiRETtYaF8TK4v9TvPPO1i3N72IWg/UgKvABEFj4kMJ/GPehDaxmjCQ == X-Received: by 2002:a17:906:94da:: with SMTP id d26mr29717634ejy.213.1634556592751; Mon, 18 Oct 2021 04:29:52 -0700 (PDT) Received: from localhost.localdomain ([2a02:85f:e0e1:500:de8:b558:44d7:f174]) by smtp.gmail.com with ESMTPSA id y19sm10390071edd.39.2021.10.18.04.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 04:29:52 -0700 (PDT) From: konstantin@boffins.se To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Oct 2021 14:29:48 +0300 Message-Id: <20211018112948.3106094-1-konstantin@boffins.se> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_eq: add support for alpha channel X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: KM Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: f8qZ58uRkVlr From: KM --- libavfilter/vf_eq.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c index 4a0d85e8e5..80ab21efb3 100644 --- a/libavfilter/vf_eq.c +++ b/libavfilter/vf_eq.c @@ -236,9 +236,9 @@ static const enum AVPixelFormat pixel_fmts_eq[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_YUV422P, - AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; @@ -281,12 +281,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h); } - if (eq->param[i].adjust) - eq->param[i].adjust(&eq->param[i], out->data[i], out->linesize[i], - in->data[i], in->linesize[i], w, h); - else + if (i == 3 || !eq->param[i].adjust) av_image_copy_plane(out->data[i], out->linesize[i], in->data[i], in->linesize[i], w, h); + + else + eq->param[i].adjust(&eq->param[i], out->data[i], out->linesize[i], + in->data[i], in->linesize[i], w, h); } av_frame_free(&in);