[FFmpeg-cvslog] libswscale: Remove unused deprecated functions, make used ones static

Andreas Rheinhardt git at videolan.org
Wed Apr 28 00:16:08 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Apr 14 14:14:53 2021 +0200| [ea2d9b7a2e02861ea680f91404414955f55a294c] | committer: James Almer

libswscale: Remove unused deprecated functions, make used ones static

Deprecated in 3b905b9fe611efb3282aa4c5c659e1870d91a83b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea2d9b7a2e02861ea680f91404414955f55a294c
---

 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 */



More information about the ffmpeg-cvslog mailing list