From patchwork Mon Apr 19 14:09:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27042 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp561717iob; Mon, 19 Apr 2021 07:18:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI2ZIApt8/jucj1UKjc2GuJl6OlGmgMyiADj3QzscoAZd/ZjN4BhN0i2zPn/kypIPHR3JA X-Received: by 2002:a17:907:20f0:: with SMTP id rh16mr23452803ejb.320.1618841927096; Mon, 19 Apr 2021 07:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618841927; cv=none; d=google.com; s=arc-20160816; b=Boa0PABbfM1PPgF0H8WcqdsQBojwYAIvhZo9GEYeRit9UXFIMzFcFkoWmz3Buw3B9t tQja5jePRZcu0wb1MGB5Hf8OC9mc3LEPv0IT2EoWaXcJgWhxRWdXb5ysA4wX8qcgx0OX DL/fJYFsyZYNo8eJLvB1asH6YBwx65u3we1m2kUYS5dul4C3yDELoVpQNrwLjN/nb5ev 9kFLWAM8B5KwVlNN+xSeyL8xLk5U04nryB8mJzD315xo9Mv8+tJQu77Fa4tW4MPB3MeE SFI8ZJvqWwEcm0+c+nQWUoXfafKBhiOLaQgvXOwWWwfQ9Jl0nd0A9kOW8O4bPIbmTJD5 3YvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=Yl6uRITgRVd5jKX3VFHc/EV/yOkVP9ssrilb9uTofHE=; b=hL/KEYzuLD6MDiL6+JlR+gppexL/qLNXJPi4HigWjUugi4elKu/QIkAoOCxMRgoT97 te0X+kvMSg8gd3zNINtVTybgsTE79CNgIiC+qqKpsybIG6UrXucBK2QAe3hOknOQOB1y uuFFRQt4mSVgyQjo69DpRS2O539L1DY+Vkc3Pb2AY3H/3+CYxsm5z0YVBOBQh4aNp4l0 SHJ8Cbl35TUoOkxE2oQvcwxzzGmr8tN+Z1OAQ0/eBeUdiueRNb9WZVY0/GnQDACLunql sbbtPcYuz1ZMF2Qj7Lot4Ngtqp9HnKpcx46OjcOODg1A+s2cpdZ2gDvNRagLyQmAOjrA 8Z+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=cFlNOHo4; 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=QUARANTINE 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 o16si1665783edc.1.2021.04.19.07.18.46; Mon, 19 Apr 2021 07:18:47 -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=cFlNOHo4; 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=QUARANTINE 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 CCF156899EC; Mon, 19 Apr 2021 17:12:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 422E768995F for ; Mon, 19 Apr 2021 17:12:09 +0300 (EEST) Received: by mail-qt1-f180.google.com with SMTP id h7so26145228qtx.3 for ; Mon, 19 Apr 2021 07:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=f+GW4B6OTvck4V+xGSGS8qpc7JB1kxIBLpWjLgXc1Mo=; b=cFlNOHo4A2/kL+SuObmVYVC55OAvqGYbMgodns+Omhyw9TsClcmgP8FBmsCxj7LeD1 xgcPH878k3XOg3eqDaw5wdIALelSDCPe7nVllnNUkRR+SgDmGue0Yiy/Ocv9N45perER 8TDK0logHTfZtEngt1g7JXkA7vHnv8QlmZ5TeRXpRxCqodtS/jqOYtOS4DF9F6TQurx/ RSyFgUJtpcm3LEXLEt+R6NtW3zavfQHBp5as2VYPzCjwSbtuUOVDwKP9BHZoVbf3r1FR TmfOSPdZnbylVzGurBCYNenYbvM0Y1racE3PsylxYfxusp3DcwHeovDxTPLapYjoSgVB azWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f+GW4B6OTvck4V+xGSGS8qpc7JB1kxIBLpWjLgXc1Mo=; b=n4NnJtWdPNldAudjD+cP5rU7McPYISF8NcmML2DtfNi0VoLNuFuVEzFHngiAkam+If uPXDcStQFIZ7T/jmycnbYXGKgJ/+tfP2IYwvnES1st2tWeORJf24wEFgvcjrACXbBKWC gE/PU7jThGw+s6LxEIldDvDMYqin3x7+nEvysDhgyq0YQT6Z0Fyu5efSFlIfSrxhhrSV p7SfTNCNY2CDyajPZ47BYgCQUS52lYVR1NLEuHMSC1jj8CQIVYUl4WqdmAppQnENy93+ PkK6xei235fOyaziwWtajPpv9tneVxjXG7BhxgW8XAnPyP/uuzu4UYhHOjp5sg967T59 E7Pg== X-Gm-Message-State: AOAM532/etd8ilhM9rgdLFIGdbjI5O3OaANBR6A3bBXbq+gKCSkbYu31 GJO2+avm1l4tzfYgodbKaWVMWU+naOE= X-Received: by 2002:a05:622a:1487:: with SMTP id t7mr11468069qtx.345.1618841528568; Mon, 19 Apr 2021 07:12:08 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.12.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:12:08 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:09:53 -0300 Message-Id: <20210419141024.8174-57-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419141024.8174-1-jamrial@gmail.com> References: <20210419141024.8174-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 56/87] avfilter/transform: Stop exporting internal functions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 95C55lCHb+dX From: Andreas Rheinhardt avfilter_transform, avfilter_(add|sub|mult)_matrix are not part of the public API (transform.h is not a public header), yet they are currently exported because of their name. This commit changes this: avfilter_transform is renamed to ff_affine_transform; the other functions are just removed as they have never been used at all. Found-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- libavfilter/transform.c | 23 +---------------------- libavfilter/transform.h | 29 +---------------------------- libavfilter/vf_deshake.c | 5 +++-- 3 files changed, 5 insertions(+), 52 deletions(-) diff --git a/libavfilter/transform.c b/libavfilter/transform.c index f4f9e0a47d..1f91436f73 100644 --- a/libavfilter/transform.c +++ b/libavfilter/transform.c @@ -122,28 +122,7 @@ void ff_get_matrix( matrix[8] = 1; } -void avfilter_add_matrix(const float *m1, const float *m2, float *result) -{ - int i; - for (i = 0; i < 9; i++) - result[i] = m1[i] + m2[i]; -} - -void avfilter_sub_matrix(const float *m1, const float *m2, float *result) -{ - int i; - for (i = 0; i < 9; i++) - result[i] = m1[i] - m2[i]; -} - -void avfilter_mul_matrix(const float *m1, float scalar, float *result) -{ - int i; - for (i = 0; i < 9; i++) - result[i] = m1[i] * scalar; -} - -int avfilter_transform(const uint8_t *src, uint8_t *dst, +int ff_affine_transform(const uint8_t *src, uint8_t *dst, int src_stride, int dst_stride, int width, int height, const float *matrix, enum InterpolateMethod interpolate, diff --git a/libavfilter/transform.h b/libavfilter/transform.h index 9b0c19ceca..0344f9c228 100644 --- a/libavfilter/transform.h +++ b/libavfilter/transform.h @@ -83,33 +83,6 @@ void ff_get_matrix( float *matrix ); -/** - * Add two matrices together. result = m1 + m2. - * - * @param m1 9-item transformation matrix - * @param m2 9-item transformation matrix - * @param result 9-item transformation matrix - */ -void avfilter_add_matrix(const float *m1, const float *m2, float *result); - -/** - * Subtract one matrix from another. result = m1 - m2. - * - * @param m1 9-item transformation matrix - * @param m2 9-item transformation matrix - * @param result 9-item transformation matrix - */ -void avfilter_sub_matrix(const float *m1, const float *m2, float *result); - -/** - * Multiply a matrix by a scalar value. result = m1 * scalar. - * - * @param m1 9-item transformation matrix - * @param scalar a number - * @param result 9-item transformation matrix - */ -void avfilter_mul_matrix(const float *m1, float scalar, float *result); - /** * Do an affine transformation with the given interpolation method. This * multiplies each vector [x,y,1] by the matrix and then interpolates to @@ -126,7 +99,7 @@ void avfilter_mul_matrix(const float *m1, float scalar, float *result); * @param fill edge fill method * @return negative on error */ -int avfilter_transform(const uint8_t *src, uint8_t *dst, +int ff_affine_transform(const uint8_t *src, uint8_t *dst, int src_stride, int dst_stride, int width, int height, const float *matrix, enum InterpolateMethod interpolate, diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index 28a541b94a..8771399351 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -330,8 +330,9 @@ static int deshake_transform_c(AVFilterContext *ctx, for (i = 0; i < 3; i++) { // Transform the luma and chroma planes - ret = avfilter_transform(in->data[i], out->data[i], in->linesize[i], out->linesize[i], - plane_w[i], plane_h[i], matrixs[i], interpolate, fill); + ret = ff_affine_transform(in->data[i], out->data[i], in->linesize[i], + out->linesize[i], plane_w[i], plane_h[i], + matrixs[i], interpolate, fill); if (ret < 0) return ret; }