FFmpeg
swscale.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef SWSCALE_SWSCALE_H
22 #define SWSCALE_SWSCALE_H
23 
24 /**
25  * @file
26  * @ingroup libsws
27  * external API header
28  */
29 
30 #include <stdint.h>
31 
32 #include "libavutil/avutil.h"
33 #include "libavutil/frame.h"
34 #include "libavutil/log.h"
35 #include "libavutil/pixfmt.h"
36 #include "version_major.h"
37 #ifndef HAVE_AV_CONFIG_H
38 /* When included as part of the ffmpeg build, only include the major version
39  * to avoid unnecessary rebuilds. When included externally, keep including
40  * the full version information. */
41 #include "version.h"
42 #endif
43 
44 /**
45  * @defgroup libsws libswscale
46  * Color conversion and scaling library.
47  *
48  * @{
49  *
50  * Return the LIBSWSCALE_VERSION_INT constant.
51  */
52 unsigned swscale_version(void);
53 
54 /**
55  * Return the libswscale build-time configuration.
56  */
57 const char *swscale_configuration(void);
58 
59 /**
60  * Return the libswscale license.
61  */
62 const char *swscale_license(void);
63 
64 /* values for the flags, the stuff on the command line is different */
65 #define SWS_FAST_BILINEAR 1
66 #define SWS_BILINEAR 2
67 #define SWS_BICUBIC 4
68 #define SWS_X 8
69 #define SWS_POINT 0x10
70 #define SWS_AREA 0x20
71 #define SWS_BICUBLIN 0x40
72 #define SWS_GAUSS 0x80
73 #define SWS_SINC 0x100
74 #define SWS_LANCZOS 0x200
75 #define SWS_SPLINE 0x400
76 
77 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
78 #define SWS_SRC_V_CHR_DROP_SHIFT 16
79 
80 #define SWS_PARAM_DEFAULT 123456
81 
82 #define SWS_PRINT_INFO 0x1000
83 
84 //the following 3 flags are not completely implemented
85 //internal chrominance subsampling info
86 #define SWS_FULL_CHR_H_INT 0x2000
87 //input subsampling info
88 #define SWS_FULL_CHR_H_INP 0x4000
89 #define SWS_DIRECT_BGR 0x8000
90 #define SWS_ACCURATE_RND 0x40000
91 #define SWS_BITEXACT 0x80000
92 #define SWS_ERROR_DIFFUSION 0x800000
93 
94 #define SWS_MAX_REDUCE_CUTOFF 0.002
95 
96 #define SWS_CS_ITU709 1
97 #define SWS_CS_FCC 4
98 #define SWS_CS_ITU601 5
99 #define SWS_CS_ITU624 5
100 #define SWS_CS_SMPTE170M 5
101 #define SWS_CS_SMPTE240M 7
102 #define SWS_CS_DEFAULT 5
103 #define SWS_CS_BT2020 9
104 
105 /**
106  * Return a pointer to yuv<->rgb coefficients for the given colorspace
107  * suitable for sws_setColorspaceDetails().
108  *
109  * @param colorspace One of the SWS_CS_* macros. If invalid,
110  * SWS_CS_DEFAULT is used.
111  */
112 const int *sws_getCoefficients(int colorspace);
113 
114 // when used for filters they must have an odd number of elements
115 // coeffs cannot be shared between vectors
116 typedef struct SwsVector {
117  double *coeff; ///< pointer to the list of coefficients
118  int length; ///< number of coefficients in the vector
119 } SwsVector;
120 
121 // vectors can be shared
122 typedef struct SwsFilter {
127 } SwsFilter;
128 
129 struct SwsContext;
130 
131 /**
132  * Return a positive value if pix_fmt is a supported input format, 0
133  * otherwise.
134  */
136 
137 /**
138  * Return a positive value if pix_fmt is a supported output format, 0
139  * otherwise.
140  */
142 
143 /**
144  * @param[in] pix_fmt the pixel format
145  * @return a positive value if an endianness conversion for pix_fmt is
146  * supported, 0 otherwise.
147  */
149 
150 /**
151  * Allocate an empty SwsContext. This must be filled and passed to
152  * sws_init_context(). For filling see AVOptions, options.c and
153  * sws_setColorspaceDetails().
154  */
155 struct SwsContext *sws_alloc_context(void);
156 
157 /**
158  * Initialize the swscaler context sws_context.
159  *
160  * @return zero or positive value on success, a negative value on
161  * error
162  */
164 int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
165 
166 /**
167  * Free the swscaler context swsContext.
168  * If swsContext is NULL, then does nothing.
169  */
170 void sws_freeContext(struct SwsContext *swsContext);
171 
172 /**
173  * Allocate and return an SwsContext. You need it to perform
174  * scaling/conversion operations using sws_scale().
175  *
176  * @param srcW the width of the source image
177  * @param srcH the height of the source image
178  * @param srcFormat the source image format
179  * @param dstW the width of the destination image
180  * @param dstH the height of the destination image
181  * @param dstFormat the destination image format
182  * @param flags specify which algorithm and options to use for rescaling
183  * @param param extra parameters to tune the used scaler
184  * For SWS_BICUBIC param[0] and [1] tune the shape of the basis
185  * function, param[0] tunes f(1) and param[1] f´(1)
186  * For SWS_GAUSS param[0] tunes the exponent and thus cutoff
187  * frequency
188  * For SWS_LANCZOS param[0] tunes the width of the window function
189  * @return a pointer to an allocated context, or NULL in case of error
190  * @note this function is to be removed after a saner alternative is
191  * written
192  */
194  int dstW, int dstH, enum AVPixelFormat dstFormat,
195  int flags, SwsFilter *srcFilter,
196  SwsFilter *dstFilter, const double *param);
197 
198 /**
199  * Scale the image slice in srcSlice and put the resulting scaled
200  * slice in the image in dst. A slice is a sequence of consecutive
201  * rows in an image.
202  *
203  * Slices have to be provided in sequential order, either in
204  * top-bottom or bottom-top order. If slices are provided in
205  * non-sequential order the behavior of the function is undefined.
206  *
207  * @param c the scaling context previously created with
208  * sws_getContext()
209  * @param srcSlice the array containing the pointers to the planes of
210  * the source slice
211  * @param srcStride the array containing the strides for each plane of
212  * the source image
213  * @param srcSliceY the position in the source image of the slice to
214  * process, that is the number (counted starting from
215  * zero) in the image of the first row of the slice
216  * @param srcSliceH the height of the source slice, that is the number
217  * of rows in the slice
218  * @param dst the array containing the pointers to the planes of
219  * the destination image
220  * @param dstStride the array containing the strides for each plane of
221  * the destination image
222  * @return the height of the output slice
223  */
224 int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
225  const int srcStride[], int srcSliceY, int srcSliceH,
226  uint8_t *const dst[], const int dstStride[]);
227 
228 /**
229  * Scale source data from src and write the output to dst.
230  *
231  * This is merely a convenience wrapper around
232  * - sws_frame_start()
233  * - sws_send_slice(0, src->height)
234  * - sws_receive_slice(0, dst->height)
235  * - sws_frame_end()
236  *
237  * @param dst The destination frame. See documentation for sws_frame_start() for
238  * more details.
239  * @param src The source frame.
240  *
241  * @return 0 on success, a negative AVERROR code on failure
242  */
243 int sws_scale_frame(struct SwsContext *c, AVFrame *dst, const AVFrame *src);
244 
245 /**
246  * Initialize the scaling process for a given pair of source/destination frames.
247  * Must be called before any calls to sws_send_slice() and sws_receive_slice().
248  *
249  * This function will retain references to src and dst, so they must both use
250  * refcounted buffers (if allocated by the caller, in case of dst).
251  *
252  * @param dst The destination frame.
253  *
254  * The data buffers may either be already allocated by the caller or
255  * left clear, in which case they will be allocated by the scaler.
256  * The latter may have performance advantages - e.g. in certain cases
257  * some output planes may be references to input planes, rather than
258  * copies.
259  *
260  * Output data will be written into this frame in successful
261  * sws_receive_slice() calls.
262  * @param src The source frame. The data buffers must be allocated, but the
263  * frame data does not have to be ready at this point. Data
264  * availability is then signalled by sws_send_slice().
265  * @return 0 on success, a negative AVERROR code on failure
266  *
267  * @see sws_frame_end()
268  */
269 int sws_frame_start(struct SwsContext *c, AVFrame *dst, const AVFrame *src);
270 
271 /**
272  * Finish the scaling process for a pair of source/destination frames previously
273  * submitted with sws_frame_start(). Must be called after all sws_send_slice()
274  * and sws_receive_slice() calls are done, before any new sws_frame_start()
275  * calls.
276  */
277 void sws_frame_end(struct SwsContext *c);
278 
279 /**
280  * Indicate that a horizontal slice of input data is available in the source
281  * frame previously provided to sws_frame_start(). The slices may be provided in
282  * any order, but may not overlap. For vertically subsampled pixel formats, the
283  * slices must be aligned according to subsampling.
284  *
285  * @param slice_start first row of the slice
286  * @param slice_height number of rows in the slice
287  *
288  * @return a non-negative number on success, a negative AVERROR code on failure.
289  */
290 int sws_send_slice(struct SwsContext *c, unsigned int slice_start,
291  unsigned int slice_height);
292 
293 /**
294  * Request a horizontal slice of the output data to be written into the frame
295  * previously provided to sws_frame_start().
296  *
297  * @param slice_start first row of the slice; must be a multiple of
298  * sws_receive_slice_alignment()
299  * @param slice_height number of rows in the slice; must be a multiple of
300  * sws_receive_slice_alignment(), except for the last slice
301  * (i.e. when slice_start+slice_height is equal to output
302  * frame height)
303  *
304  * @return a non-negative number if the data was successfully written into the output
305  * AVERROR(EAGAIN) if more input data needs to be provided before the
306  * output can be produced
307  * another negative AVERROR code on other kinds of scaling failure
308  */
309 int sws_receive_slice(struct SwsContext *c, unsigned int slice_start,
310  unsigned int slice_height);
311 
312 /**
313  * @return alignment required for output slices requested with sws_receive_slice().
314  * Slice offsets and sizes passed to sws_receive_slice() must be
315  * multiples of the value returned from this function.
316  */
317 unsigned int sws_receive_slice_alignment(const struct SwsContext *c);
318 
319 /**
320  * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg)
321  * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg)
322  * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x]
323  * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x]
324  * @param brightness 16.16 fixed point brightness correction
325  * @param contrast 16.16 fixed point contrast correction
326  * @param saturation 16.16 fixed point saturation correction
327 #if LIBSWSCALE_VERSION_MAJOR > 6
328  * @return negative error code on error, non negative otherwise
329 #else
330  * @return -1 if not supported
331 #endif
332  */
333 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
334  int srcRange, const int table[4], int dstRange,
335  int brightness, int contrast, int saturation);
336 
337 /**
338 #if LIBSWSCALE_VERSION_MAJOR > 6
339  * @return negative error code on error, non negative otherwise
340 #else
341  * @return -1 if not supported
342 #endif
343  */
344 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
345  int *srcRange, int **table, int *dstRange,
346  int *brightness, int *contrast, int *saturation);
347 
348 /**
349  * Allocate and return an uninitialized vector with length coefficients.
350  */
351 SwsVector *sws_allocVec(int length);
352 
353 /**
354  * Return a normalized Gaussian curve used to filter stuff
355  * quality = 3 is high quality, lower is lower quality.
356  */
357 SwsVector *sws_getGaussianVec(double variance, double quality);
358 
359 /**
360  * Scale all the coefficients of a by the scalar value.
361  */
362 void sws_scaleVec(SwsVector *a, double scalar);
363 
364 /**
365  * Scale all the coefficients of a so that their sum equals height.
366  */
367 void sws_normalizeVec(SwsVector *a, double height);
368 
369 void sws_freeVec(SwsVector *a);
370 
371 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
372  float lumaSharpen, float chromaSharpen,
373  float chromaHShift, float chromaVShift,
374  int verbose);
376 
377 /**
378  * Check if context can be reused, otherwise reallocate a new one.
379  *
380  * If context is NULL, just calls sws_getContext() to get a new
381  * context. Otherwise, checks if the parameters are the ones already
382  * saved in context. If that is the case, returns the current
383  * context. Otherwise, frees context and gets a new context with
384  * the new parameters.
385  *
386  * Be warned that srcFilter and dstFilter are not checked, they
387  * are assumed to remain the same.
388  */
390  int srcW, int srcH, enum AVPixelFormat srcFormat,
391  int dstW, int dstH, enum AVPixelFormat dstFormat,
392  int flags, SwsFilter *srcFilter,
393  SwsFilter *dstFilter, const double *param);
394 
395 /**
396  * Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
397  *
398  * The output frame will have the same packed format as the palette.
399  *
400  * @param src source frame buffer
401  * @param dst destination frame buffer
402  * @param num_pixels number of pixels to convert
403  * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
404  */
405 void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
406 
407 /**
408  * Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
409  *
410  * With the palette format "ABCD", the destination frame ends up with the format "ABC".
411  *
412  * @param src source frame buffer
413  * @param dst destination frame buffer
414  * @param num_pixels number of pixels to convert
415  * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
416  */
417 void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
418 
419 /**
420  * Get the AVClass for swsContext. It can be used in combination with
421  * AV_OPT_SEARCH_FAKE_OBJ for examining options.
422  *
423  * @see av_opt_find().
424  */
425 const AVClass *sws_get_class(void);
426 
427 /**
428  * @}
429  */
430 
431 #endif /* SWSCALE_SWSCALE_H */
sws_getCachedContext
struct SwsContext * sws_getCachedContext(struct SwsContext *context, int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Check if context can be reused, otherwise reallocate a new one.
Definition: utils.c:2458
SwsContext::saturation
int saturation
Definition: swscale_internal.h:453
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
version_major.h
SwsContext::dstW
int dstW
Width of destination luma/alpha planes.
Definition: swscale_internal.h:513
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
table
static const uint16_t table[]
Definition: prosumer.c:206
SwsContext::srcRange
int srcRange
0 = MPG YUV range, 1 = JPG YUV range (source image).
Definition: swscale_internal.h:456
sws_scale
int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
Scale the image slice in srcSlice and put the resulting scaled slice in the image in dst.
Definition: swscale.c:1201
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
sws_convertPalette8ToPacked24
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
Definition: swscale_unscaled.c:2245
sws_send_slice
int sws_send_slice(struct SwsContext *c, unsigned int slice_start, unsigned int slice_height)
Indicate that a horizontal slice of input data is available in the source frame previously provided t...
Definition: swscale.c:1109
quality
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about quality
Definition: rate_distortion.txt:12
sws_freeVec
void sws_freeVec(SwsVector *a)
Definition: utils.c:2362
sws_receive_slice
int sws_receive_slice(struct SwsContext *c, unsigned int slice_start, unsigned int slice_height)
Request a horizontal slice of the output data to be written into the frame previously provided to sws...
Definition: swscale.c:1129
swscale_license
const char * swscale_license(void)
Return the libswscale license.
Definition: version.c:37
sws_get_class
const AVClass * sws_get_class(void)
Get the AVClass for swsContext.
Definition: options.c:97
SwsContext::srcFormat
enum AVPixelFormat srcFormat
Source pixel format.
Definition: swscale_internal.h:330
sws_frame_start
int sws_frame_start(struct SwsContext *c, AVFrame *dst, const AVFrame *src)
Initialize the scaling process for a given pair of source/destination frames.
Definition: swscale.c:1079
SwsContext::brightness
int brightness
Definition: swscale_internal.h:453
SwsVector::length
int length
number of coefficients in the vector
Definition: swscale.h:118
sws_allocVec
SwsVector * sws_allocVec(int length)
Allocate and return an uninitialized vector with length coefficients.
Definition: utils.c:2172
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demuxing_decoding.c:41
sws_getGaussianVec
SwsVector * sws_getGaussianVec(double variance, double quality)
Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality,...
Definition: utils.c:2189
SwsContext::contrast
int contrast
Definition: swscale_internal.h:453
SwsContext::dstFormat
enum AVPixelFormat dstFormat
Destination pixel format.
Definition: swscale_internal.h:329
context
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
Definition: writing_filters.txt:91
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
sws_getDefaultFilter
SwsFilter * sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose)
Definition: utils.c:2089
sws_alloc_context
struct SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext.
Definition: utils.c:1152
SwsVector::coeff
double * coeff
pointer to the list of coefficients
Definition: swscale.h:117
sws_setColorspaceDetails
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation)
Definition: utils.c:903
sws_scaleVec
void sws_scaleVec(SwsVector *a, double scalar)
Scale all the coefficients of a by the scalar value.
Definition: utils.c:2255
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
SwsFilter::chrV
SwsVector * chrV
Definition: swscale.h:126
SwsVector
Definition: swscale.h:116
sws_getContext
struct SwsContext * sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Allocate and return an SwsContext.
Definition: utils.c:2052
SwsContext::srcH
int srcH
Height of source luma/alpha planes.
Definition: swscale_internal.h:321
srcSliceH
return srcSliceH
Definition: yuv2rgb_template.c:87
frame.h
SwsFilter
Definition: swscale.h:122
height
#define height
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
SwsFilter::lumV
SwsVector * lumV
Definition: swscale.h:124
swscale_configuration
const char * swscale_configuration(void)
Return the libswscale build-time configuration.
Definition: version.c:32
sws_isSupportedInput
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported input format, 0 otherwise.
Definition: utils.c:308
av_warn_unused_result
#define av_warn_unused_result
Definition: attributes.h:64
sws_scale_frame
int sws_scale_frame(struct SwsContext *c, AVFrame *dst, const AVFrame *src)
Scale source data from src and write the output to dst.
Definition: swscale.c:1180
SwsContext::srcW
int srcW
Width of source luma/alpha planes.
Definition: swscale_internal.h:320
sws_isSupportedEndiannessConversion
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
Definition: utils.c:320
log.h
SwsContext::dstRange
int dstRange
0 = MPG YUV range, 1 = JPG YUV range (destination image).
Definition: swscale_internal.h:457
sws_receive_slice_alignment
unsigned int sws_receive_slice_alignment(const struct SwsContext *c)
Definition: swscale.c:1121
sws_isSupportedOutput
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported output format, 0 otherwise.
Definition: utils.c:314
sws_freeFilter
void sws_freeFilter(SwsFilter *filter)
Definition: utils.c:2371
pixfmt.h
verbose
int verbose
Definition: checkasm.c:292
sws_frame_end
void sws_frame_end(struct SwsContext *c)
Finish the scaling process for a pair of source/destination frames previously submitted with sws_fram...
Definition: swscale.c:1072
sws_getColorspaceDetails
int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
if LIBSWSCALE_VERSION_MAJOR > 6
Definition: utils.c:1060
sws_init_context
av_warn_unused_result int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
Definition: utils.c:1294
sws_freeContext
void sws_freeContext(struct SwsContext *swsContext)
Free the swscaler context swsContext.
Definition: utils.c:2383
avutil.h
sws_getCoefficients
const int * sws_getCoefficients(int colorspace)
Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDet...
Definition: yuv2rgb.c:62
swscale_version
unsigned swscale_version(void)
Definition: version.c:26
SwsFilter::lumH
SwsVector * lumH
Definition: swscale.h:123
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
sws_convertPalette8ToPacked32
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
Definition: swscale_unscaled.c:2235
SwsContext
Definition: swscale_internal.h:298
SwsFilter::chrH
SwsVector * chrH
Definition: swscale.h:125
SwsContext::dstH
int dstH
Height of destination luma/alpha planes.
Definition: swscale_internal.h:322
sws_normalizeVec
void sws_normalizeVec(SwsVector *a, double height)
Scale all the coefficients of a so that their sum equals height.
Definition: utils.c:2263
SwsContext::param
double param[2]
Input parameters for scaling algorithms that need them.
Definition: swscale_internal.h:341