History

libswscale: Remove unused deprecated functions, make used ones static

Deprecated in 3b905b9fe611efb3282aa4c5c659e1870d91a83b.

Andreas Rheinhardt committed 5 years ago

Commit ea2d9b71 parent 0c820b13 files · +0 −111Browse files

Unified · Split

3 files
  1. libswscale/swscale.h +0 −11
  2. libswscale/utils.c +0 −96
  3. libswscale/version.h +0 −4
libswscale/swscale.h+0−11
@@ -260,17 +260,6 @@ void sws_scaleVec(SwsVector *a, double scalar); · 259 unmodified lines
260260 */
261261 void sws_normalizeVec(SwsVector *a, double height);
262262
263−#if FF_API_SWS_VECTOR
264−attribute_deprecated SwsVector *sws_getConstVec(double c, int length);
265−attribute_deprecated SwsVector *sws_getIdentityVec(void);
266−attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b);
267−attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b);
268−attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b);
269−attribute_deprecated void sws_shiftVec(SwsVector *a, int shift);
270−attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a);
271−attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
272−#endif
273−
274263 void sws_freeVec(SwsVector *a);
275264
276265 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
libswscale/utils.c+0−96
@@ -54,21 +54,14 @@ · 53 unmodified lines
5454 #include "libavutil/x86/asm.h"
5555 #include "libavutil/x86/cpu.h"
5656
57−// We have to implement deprecated functions until they are removed, this is the
58−// simplest way to prevent warnings
59−#undef attribute_deprecated
60−#define attribute_deprecated
61−
6257 #include "rgb2rgb.h"
6358 #include "swscale.h"
6459 #include "swscale_internal.h"
6560
66−#if !FF_API_SWS_VECTOR
6761 static SwsVector *sws_getIdentityVec(void);
6862 static void sws_addVec(SwsVector *a, SwsVector *b);
6963 static void sws_shiftVec(SwsVector *a, int shift);
7064 static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
71−#endif
7265
7366 static void handle_formats(SwsContext *c);
7467
@@ -2081,9 +2074,7 @@ SwsVector *sws_getGaussianVec(double variance, double quality) · 2006 unmodified lines
20812074 * Allocate and return a vector with length coefficients, all
20822075 * with the same value c.
20832076 */
2084−#if !FF_API_SWS_VECTOR
20852077 static
2086−#endif
20872078 SwsVector *sws_getConstVec(double c, int length)
20882079 {
20892080 int i;
@@ -2102,9 +2093,7 @@ SwsVector *sws_getConstVec(double c, int length) · 12 unmodified lines
21022093 * Allocate and return a vector with just one coefficient, with
21032094 * value 1.0.
21042095 */
2105−#if !FF_API_SWS_VECTOR
21062096 static
2107−#endif
21082097 SwsVector *sws_getIdentityVec(void)
21092098 {
21102099 return sws_getConstVec(1.0, 1);
@@ -2134,26 +2123,6 @@ void sws_normalizeVec(SwsVector *a, double height) · 23 unmodified lines
21342123 sws_scaleVec(a, height / sws_dcVec(a));
21352124 }
21362125
2137−#if FF_API_SWS_VECTOR
2138−static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b)
2139−{
2140− int length = a->length + b->length - 1;
2141− int i, j;
2142− SwsVector *vec = sws_getConstVec(0.0, length);
2143−
2144− if (!vec)
2145− return NULL;
2146−
2147− for (i = 0; i < a->length; i++) {
2148− for (j = 0; j < b->length; j++) {
2149− vec->coeff[i + j] += a->coeff[i] * b->coeff[j];
2150− }
2151− }
2152−
2153− return vec;
2154−}
2155−#endif
2156−
21572126 static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b)
21582127 {
21592128 int length = FFMAX(a->length, b->length);
@@ -2171,25 +2140,6 @@ static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) · 11 unmodified lines
21712140 return vec;
21722141 }
21732142
2174−#if FF_API_SWS_VECTOR
2175−static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b)
2176−{
2177− int length = FFMAX(a->length, b->length);
2178− int i;
2179− SwsVector *vec = sws_getConstVec(0.0, length);
2180−
2181− if (!vec)
2182− return NULL;
2183−
2184− for (i = 0; i < a->length; i++)
2185− vec->coeff[i + (length - 1) / 2 - (a->length - 1) / 2] += a->coeff[i];
2186− for (i = 0; i < b->length; i++)
2187− vec->coeff[i + (length - 1) / 2 - (b->length - 1) / 2] -= b->coeff[i];
2188−
2189− return vec;
2190−}
2191−#endif
2192−
21932143 /* shift left / or right if "shift" is negative */
21942144 static SwsVector *sws_getShiftedVec(SwsVector *a, int shift)
21952145 {
@@ -2208,9 +2158,7 @@ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) · 12 unmodified lines
22082158 return vec;
22092159 }
22102160
2211−#if !FF_API_SWS_VECTOR
22122161 static
2213−#endif
22142162 void sws_shiftVec(SwsVector *a, int shift)
22152163 {
22162164 SwsVector *shifted = sws_getShiftedVec(a, shift);
@@ -2224,9 +2172,7 @@ void sws_shiftVec(SwsVector *a, int shift) · 7 unmodified lines
22242172 av_free(shifted);
22252173 }
22262174
2227−#if !FF_API_SWS_VECTOR
22282175 static
2229−#endif
22302176 void sws_addVec(SwsVector *a, SwsVector *b)
22312177 {
22322178 SwsVector *sum = sws_sumVec(a, b);
@@ -2240,53 +2186,11 @@ void sws_addVec(SwsVector *a, SwsVector *b) · 7 unmodified lines
22402186 av_free(sum);
22412187 }
22422188
2243−#if FF_API_SWS_VECTOR
2244−void sws_subVec(SwsVector *a, SwsVector *b)
2245−{
2246− SwsVector *diff = sws_diffVec(a, b);
2247− if (!diff) {
2248− makenan_vec(a);
2249− return;
2250− }
2251− av_free(a->coeff);
2252− a->coeff = diff->coeff;
2253− a->length = diff->length;
2254− av_free(diff);
2255−}
2256−
2257−void sws_convVec(SwsVector *a, SwsVector *b)
2258−{
2259− SwsVector *conv = sws_getConvVec(a, b);
2260− if (!conv) {
2261− makenan_vec(a);
2262− return;
2263− }
2264− av_free(a->coeff);
2265− a->coeff = conv->coeff;
2266− a->length = conv->length;
2267− av_free(conv);
2268−}
2269−
2270−SwsVector *sws_cloneVec(SwsVector *a)
2271−{
2272− SwsVector *vec = sws_allocVec(a->length);
2273−
2274− if (!vec)
2275− return NULL;
2276−
2277− memcpy(vec->coeff, a->coeff, a->length * sizeof(*a->coeff));
2278−
2279− return vec;
2280−}
2281−#endif
2282−
22832189 /**
22842190 * Print with av_log() a textual representation of the vector a
22852191 * if log_level <= av_log_level.
22862192 */
2287−#if !FF_API_SWS_VECTOR
22882193 static
2289−#endif
22902194 void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level)
22912195 {
22922196 int i;
libswscale/version.h+0−4
@@ -46,8 +46,4 @@ · 45 unmodified lines
4646 * the public API and may change, break or disappear at any time.
4747 */
4848
49−#ifndef FF_API_SWS_VECTOR
50−#define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6)
51−#endif
52−
5349 #endif /* SWSCALE_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t