From patchwork Mon Apr 19 14:09:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27137 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:49c5:0:0:0:0:0 with SMTP id w188csp1098208yba; Mon, 19 Apr 2021 07:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1CDQlfE5xT+/VMPxkT3JXqjK2o+Dbr0yp8eacUx6hhtRO9MviPt9QJDWFdOOuo3Xd4yKe X-Received: by 2002:a17:906:f41:: with SMTP id h1mr12506076ejj.399.1618841973800; Mon, 19 Apr 2021 07:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618841973; cv=none; d=google.com; s=arc-20160816; b=ynYMkv9xraaLJ9UCy4YSfYXn6is+U8kLFYg8rXtmctdBQmqF5W1uniNWhZ8qDZgvp9 EsQJ/YRyiFbwEz2tZXxR9uZ85HKTTdEYvZezJ0F0me4VYo/rKbnq9EV86WdLCzt5AIQR w+1XNZrUFAy4A4jA/gDATu2RmDQ7Dp0QB9VTFLSlNCLTqP7AppStPZofPXHs2dOsFKJt ffyxpWM8o0ZORAM7MGJp2DnkCHG5PU4kkNpiRgyT4McqXNVu3oqPLiKLcyq42hSw0XNc fPjJnzO+Uh4H0PxxZrayqNMP2dzBoeS4R6bhUhDxxJWTpKN2FwQsNJuUAz3GrFFA7NpH e+MA== 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=6TzkrorM0rU0AMR/rSV3L5l/YTe/Lb6w/IwbflaYkiM=; b=LUnKDeZgSp0MZrn8BrRvVPJIr+MC91AqmXJiidOjeckAsLXfhh5drzLshp9jCR7902 ysOQ/+YyY7CEFrNVf0g/6B4x+UBSHipOu8DoRbdUe875Tcsgc5SlCc2Schl/Ck7pZdVk O2hbZJ2V/snVRnzhQTE23nfmuu2mTHM70cazxKG0MLzLitEFt7GCBc+fzoBa6/RD06Sj 3tV4GANwh77lmllC6u9+rpPCCxwCBq5wGM/t4uEI42ZYhySR5N/Y01qeYINI+M3BWC4q HxQa4j6Iojn8wAc+ws313j/+d88vlQ/6M+Pr8mzs7gWDFHiWBL0L0PQa+IMExO2O6oBn YsaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=VjUXUkrf; 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 y3si7347627edw.274.2021.04.19.07.19.33; Mon, 19 Apr 2021 07:19:33 -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=VjUXUkrf; 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 DD9F4689ADE; Mon, 19 Apr 2021 17:12:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 317FD680987 for ; Mon, 19 Apr 2021 17:12:12 +0300 (EEST) Received: by mail-qt1-f175.google.com with SMTP id 1so26142533qtb.0 for ; Mon, 19 Apr 2021 07:12:12 -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=gLmpGIrebt4FqP4u4OuApbAcL6uJ9N+BRIwe48t2CaU=; b=VjUXUkrfQ30ca1xIuEmKxLcimEMf+k6C6oEYOtk2+QUiBy2Kn2o9MK4+v28w7PSzUZ AeYMgV7quv2H+nGuobcCQ44ockzguxbE5oM6JGrgBH5pISyMGiCxna2/exCJhAJN7Q+Q 6MMayTITujaQDC5lP5mOYDydvLXvKg/Tl+2SyYggBb5bRcO3tlgWmy3YdYpf+uFC3VXC 70q0grrZMEU+zF03Ix1v69C1KWCjG0aTnHWssuuRvpcpKdG3ToJVSmEaL3Oc/xtpTqXN +kjgDrtELp5aw4lU2ipVV5ee5EVhqBLfBP5rCPsUhYs9oE1eEQQP6tgWhwxTqTf1A1Su ci1Q== 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=gLmpGIrebt4FqP4u4OuApbAcL6uJ9N+BRIwe48t2CaU=; b=AmegGvBQyAwZrKzSgp431s3aiCQueTJkrOn5w996lu/Ysy2yfrQsiw65zZmi4di9Mh OWHwee25Bn83ywC/XihM3Y9rIvSuxPztb1GyVIYQF9SFYilNJYU2JiUFuR4TB0j6l5C9 n5VQLtxPiCWI4vRecLLoJt+2ZDUaI6B40EKyQBOAFCRFfvKIwWjGu4ptTabEaIJGeWoH Cy5nA6nUd33r+KQm0YsvHdhSB38jhtcp8kzg/89ZRh85z6M9vKkqsBq4aQxPMONES9x5 0fP3PuRrZEcfvXBQ/jz84UXL0Hulw/vki9aRZovKhodwTvwpwCo0AE+kJAVdYhOhHL06 8u8Q== X-Gm-Message-State: AOAM531Q5ZbKmmGW/qzmdyLvOc3uq5ggzXE+RtFbcgHX/H9XkyqdHMF+ H6PSDg0dkwDF5Sgd5nJsECl3NeFSqaY= X-Received: by 2002:a05:622a:11cd:: with SMTP id n13mr12087947qtk.52.1618841530773; Mon, 19 Apr 2021 07:12:10 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.12.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:12:10 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:09:55 -0300 Message-Id: <20210419141024.8174-59-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 58/87] libswscale: Remove unused deprecated functions, make used ones static 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: rfAZRH87x/0/ Content-Length: 6273 From: Andreas Rheinhardt Deprecated in 3b905b9fe611efb3282aa4c5c659e1870d91a83b. Signed-off-by: Andreas Rheinhardt --- libswscale/swscale.h | 11 ----- libswscale/utils.c | 96 -------------------------------------------- libswscale/version.h | 4 -- 3 files changed, 111 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 7713f51ec6..50d6d46553 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -260,17 +260,6 @@ void sws_scaleVec(SwsVector *a, double scalar); */ void sws_normalizeVec(SwsVector *a, double height); -#if FF_API_SWS_VECTOR -attribute_deprecated SwsVector *sws_getConstVec(double c, int length); -attribute_deprecated SwsVector *sws_getIdentityVec(void); -attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b); -attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b); -attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b); -attribute_deprecated void sws_shiftVec(SwsVector *a, int shift); -attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a); -attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); -#endif - void sws_freeVec(SwsVector *a); SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, diff --git a/libswscale/utils.c b/libswscale/utils.c index 352a8ed116..6bac7b658d 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -54,21 +54,14 @@ #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" -// We have to implement deprecated functions until they are removed, this is the -// simplest way to prevent warnings -#undef attribute_deprecated -#define attribute_deprecated - #include "rgb2rgb.h" #include "swscale.h" #include "swscale_internal.h" -#if !FF_API_SWS_VECTOR static SwsVector *sws_getIdentityVec(void); static void sws_addVec(SwsVector *a, SwsVector *b); static void sws_shiftVec(SwsVector *a, int shift); static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); -#endif static void handle_formats(SwsContext *c); @@ -2081,9 +2074,7 @@ SwsVector *sws_getGaussianVec(double variance, double quality) * Allocate and return a vector with length coefficients, all * with the same value c. */ -#if !FF_API_SWS_VECTOR static -#endif SwsVector *sws_getConstVec(double c, int length) { int i; @@ -2102,9 +2093,7 @@ SwsVector *sws_getConstVec(double c, int length) * Allocate and return a vector with just one coefficient, with * value 1.0. */ -#if !FF_API_SWS_VECTOR static -#endif SwsVector *sws_getIdentityVec(void) { return sws_getConstVec(1.0, 1); @@ -2134,26 +2123,6 @@ void sws_normalizeVec(SwsVector *a, double height) sws_scaleVec(a, height / sws_dcVec(a)); } -#if FF_API_SWS_VECTOR -static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b) -{ - int length = a->length + b->length - 1; - int i, j; - SwsVector *vec = sws_getConstVec(0.0, length); - - if (!vec) - return NULL; - - for (i = 0; i < a->length; i++) { - for (j = 0; j < b->length; j++) { - vec->coeff[i + j] += a->coeff[i] * b->coeff[j]; - } - } - - return vec; -} -#endif - static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) { int length = FFMAX(a->length, b->length); @@ -2171,25 +2140,6 @@ static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) return vec; } -#if FF_API_SWS_VECTOR -static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b) -{ - int length = FFMAX(a->length, b->length); - int i; - SwsVector *vec = sws_getConstVec(0.0, length); - - if (!vec) - return NULL; - - for (i = 0; i < a->length; i++) - vec->coeff[i + (length - 1) / 2 - (a->length - 1) / 2] += a->coeff[i]; - for (i = 0; i < b->length; i++) - vec->coeff[i + (length - 1) / 2 - (b->length - 1) / 2] -= b->coeff[i]; - - return vec; -} -#endif - /* shift left / or right if "shift" is negative */ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) { @@ -2208,9 +2158,7 @@ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) return vec; } -#if !FF_API_SWS_VECTOR static -#endif void sws_shiftVec(SwsVector *a, int shift) { SwsVector *shifted = sws_getShiftedVec(a, shift); @@ -2224,9 +2172,7 @@ void sws_shiftVec(SwsVector *a, int shift) av_free(shifted); } -#if !FF_API_SWS_VECTOR static -#endif void sws_addVec(SwsVector *a, SwsVector *b) { SwsVector *sum = sws_sumVec(a, b); @@ -2240,53 +2186,11 @@ void sws_addVec(SwsVector *a, SwsVector *b) av_free(sum); } -#if FF_API_SWS_VECTOR -void sws_subVec(SwsVector *a, SwsVector *b) -{ - SwsVector *diff = sws_diffVec(a, b); - if (!diff) { - makenan_vec(a); - return; - } - av_free(a->coeff); - a->coeff = diff->coeff; - a->length = diff->length; - av_free(diff); -} - -void sws_convVec(SwsVector *a, SwsVector *b) -{ - SwsVector *conv = sws_getConvVec(a, b); - if (!conv) { - makenan_vec(a); - return; - } - av_free(a->coeff); - a->coeff = conv->coeff; - a->length = conv->length; - av_free(conv); -} - -SwsVector *sws_cloneVec(SwsVector *a) -{ - SwsVector *vec = sws_allocVec(a->length); - - if (!vec) - return NULL; - - memcpy(vec->coeff, a->coeff, a->length * sizeof(*a->coeff)); - - return vec; -} -#endif - /** * Print with av_log() a textual representation of the vector a * if log_level <= av_log_level. */ -#if !FF_API_SWS_VECTOR static -#endif void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level) { int i; diff --git a/libswscale/version.h b/libswscale/version.h index 7a616a42e0..f7bade61ca 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -46,8 +46,4 @@ * the public API and may change, break or disappear at any time. */ -#ifndef FF_API_SWS_VECTOR -#define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6) -#endif - #endif /* SWSCALE_VERSION_H */