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
260 */260 */
261void sws_normalizeVec(SwsVector *a, double height);261void sws_normalizeVec(SwsVector *a, double height);
262 262
263#if FF_API_SWS_VECTOR
264attribute_deprecated SwsVector *sws_getConstVec(double c, int length);
265attribute_deprecated SwsVector *sws_getIdentityVec(void);
266attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b);
267attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b);
268attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b);
269attribute_deprecated void sws_shiftVec(SwsVector *a, int shift);
270attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a);
271attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
272#endif
273
274void sws_freeVec(SwsVector *a);263void sws_freeVec(SwsVector *a);
275 264
276SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,265SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
libswscale/utils.c+0−96
@@ -54,21 +54,14 @@ · 53 unmodified lines
54#include "libavutil/x86/asm.h"54#include "libavutil/x86/asm.h"
55#include "libavutil/x86/cpu.h"55#include "libavutil/x86/cpu.h"
56 56
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
62#include "rgb2rgb.h"57#include "rgb2rgb.h"
63#include "swscale.h"58#include "swscale.h"
64#include "swscale_internal.h"59#include "swscale_internal.h"
65 60
66#if !FF_API_SWS_VECTOR
67static SwsVector *sws_getIdentityVec(void);61static SwsVector *sws_getIdentityVec(void);
68static void sws_addVec(SwsVector *a, SwsVector *b);62static void sws_addVec(SwsVector *a, SwsVector *b);
69static void sws_shiftVec(SwsVector *a, int shift);63static void sws_shiftVec(SwsVector *a, int shift);
70static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);64static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
71#endif
72 65
73static void handle_formats(SwsContext *c);66static void handle_formats(SwsContext *c);
74 67
@@ -2081,9 +2074,7 @@ SwsVector *sws_getGaussianVec(double variance, double quality) · 2006 unmodified lines
2081 * Allocate and return a vector with length coefficients, all2074 * Allocate and return a vector with length coefficients, all
2082 * with the same value c.2075 * with the same value c.
2083 */2076 */
2084#if !FF_API_SWS_VECTOR
2085static2077static
2086#endif
2087SwsVector *sws_getConstVec(double c, int length)2078SwsVector *sws_getConstVec(double c, int length)
2088{2079{
2089 int i;2080 int i;
@@ -2102,9 +2093,7 @@ SwsVector *sws_getConstVec(double c, int length) · 12 unmodified lines
2102 * Allocate and return a vector with just one coefficient, with2093 * Allocate and return a vector with just one coefficient, with
2103 * value 1.0.2094 * value 1.0.
2104 */2095 */
2105#if !FF_API_SWS_VECTOR
2106static2096static
2107#endif
2108SwsVector *sws_getIdentityVec(void)2097SwsVector *sws_getIdentityVec(void)
2109{2098{
2110 return sws_getConstVec(1.0, 1);2099 return sws_getConstVec(1.0, 1);
@@ -2134,26 +2123,6 @@ void sws_normalizeVec(SwsVector *a, double height) · 23 unmodified lines
2134 sws_scaleVec(a, height / sws_dcVec(a));2123 sws_scaleVec(a, height / sws_dcVec(a));
2135}2124}
2136 2125
2137#if FF_API_SWS_VECTOR
2138static 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
2157static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b)2126static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b)
2158{2127{
2159 int length = FFMAX(a->length, b->length);2128 int length = FFMAX(a->length, b->length);
@@ -2171,25 +2140,6 @@ static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) · 11 unmodified lines
2171 return vec;2140 return vec;
2172}2141}
2173 2142
2174#if FF_API_SWS_VECTOR
2175static 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
2193/* shift left / or right if "shift" is negative */2143/* shift left / or right if "shift" is negative */
2194static SwsVector *sws_getShiftedVec(SwsVector *a, int shift)2144static SwsVector *sws_getShiftedVec(SwsVector *a, int shift)
2195{2145{
@@ -2208,9 +2158,7 @@ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) · 12 unmodified lines
2208 return vec;2158 return vec;
2209}2159}
2210 2160
2211#if !FF_API_SWS_VECTOR
2212static2161static
2213#endif
2214void sws_shiftVec(SwsVector *a, int shift)2162void sws_shiftVec(SwsVector *a, int shift)
2215{2163{
2216 SwsVector *shifted = sws_getShiftedVec(a, shift);2164 SwsVector *shifted = sws_getShiftedVec(a, shift);
@@ -2224,9 +2172,7 @@ void sws_shiftVec(SwsVector *a, int shift) · 7 unmodified lines
2224 av_free(shifted);2172 av_free(shifted);
2225}2173}
2226 2174
2227#if !FF_API_SWS_VECTOR
2228static2175static
2229#endif
2230void sws_addVec(SwsVector *a, SwsVector *b)2176void sws_addVec(SwsVector *a, SwsVector *b)
2231{2177{
2232 SwsVector *sum = sws_sumVec(a, b);2178 SwsVector *sum = sws_sumVec(a, b);
@@ -2240,53 +2186,11 @@ void sws_addVec(SwsVector *a, SwsVector *b) · 7 unmodified lines
2240 av_free(sum);2186 av_free(sum);
2241}2187}
2242 2188
2243#if FF_API_SWS_VECTOR
2244void 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
2257void 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
2270SwsVector *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
2283/**2189/**
2284 * Print with av_log() a textual representation of the vector a2190 * Print with av_log() a textual representation of the vector a
2285 * if log_level <= av_log_level.2191 * if log_level <= av_log_level.
2286 */2192 */
2287#if !FF_API_SWS_VECTOR
2288static2193static
2289#endif
2290void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level)2194void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level)
2291{2195{
2292 int i;2196 int i;
libswscale/version.h+0−4
@@ -46,8 +46,4 @@ · 45 unmodified lines
46 * the public API and may change, break or disappear at any time.46 * the public API and may change, break or disappear at any time.
47 */47 */
48 48
49#ifndef FF_API_SWS_VECTOR
50#define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6)
51#endif
52
53#endif /* SWSCALE_VERSION_H */49#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