FFmpeg
swscale.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Niklas Haas
3  * Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef SWSCALE_SWSCALE_H
23 #define SWSCALE_SWSCALE_H
24 
25 /**
26  * @file
27  * @ingroup libsws
28  * external API header
29  */
30 
31 #include <stdint.h>
32 
33 #include "libavutil/avutil.h"
34 #include "libavutil/frame.h"
35 #include "libavutil/log.h"
36 #include "libavutil/pixfmt.h"
37 #include "version_major.h"
38 #ifndef HAVE_AV_CONFIG_H
39 /* When included as part of the ffmpeg build, only include the major version
40  * to avoid unnecessary rebuilds. When included externally, keep including
41  * the full version information. */
42 #include "version.h"
43 #endif
44 
45 typedef struct SwsContext SwsContext;
46 
47 /**
48  * @defgroup libsws libswscale
49  * Color conversion and scaling library.
50  *
51  * @{
52  *
53  * Return the LIBSWSCALE_VERSION_INT constant.
54  */
55 unsigned swscale_version(void);
56 
57 /**
58  * Return the libswscale build-time configuration.
59  */
60 const char *swscale_configuration(void);
61 
62 /**
63  * Return the libswscale license.
64  */
65 const char *swscale_license(void);
66 
67 /**
68  * Get the AVClass for swsContext. It can be used in combination with
69  * AV_OPT_SEARCH_FAKE_OBJ for examining options.
70  *
71  * @see av_opt_find().
72  */
73 const AVClass *sws_get_class(void);
74 
75 /**
76  * Allocate an empty SwsContext. This must be filled and passed to
77  * sws_init_context(). For filling see AVOptions, options.c and
78  * sws_setColorspaceDetails().
79  */
81 
82 /**
83  * Free the context and everything associated with it, and write NULL
84  * to the provided pointer.
85  */
87 
88 /***************************
89  * Supported frame formats *
90  ***************************/
91 
92 /**
93  * Test if a given pixel format is supported.
94  *
95  * @param output If 0, test if compatible with the source/input frame;
96  * otherwise, with the destination/output frame.
97  * @param format The format to check.
98  *
99  * @return A positive integer if supported, 0 otherwise.
100  */
102 
103 /**
104  * Test if a given color space is supported.
105  *
106  * @param output If 0, test if compatible with the source/input frame;
107  * otherwise, with the destination/output frame.
108  * @param colorspace The colorspace to check.
109  *
110  * @return A positive integer if supported, 0 otherwise.
111  */
112 int sws_test_colorspace(enum AVColorSpace colorspace, int output);
113 
114 /**
115  * Test if a given set of color primaries is supported.
116  *
117  * @param output If 0, test if compatible with the source/input frame;
118  * otherwise, with the destination/output frame.
119  * @param primaries The color primaries to check.
120  *
121  * @return A positive integer if supported, 0 otherwise.
122  */
124 
125 /**
126  * Test if a given color transfer function is supported.
127  *
128  * @param output If 0, test if compatible with the source/input frame;
129  * otherwise, with the destination/output frame.
130  * @param trc The color transfer function to check.
131  *
132  * @return A positive integer if supported, 0 otherwise.
133  */
135 
136 /**
137  * Helper function to run all sws_test_* against a frame, as well as testing
138  * the basic frame properties for sanity. Ignores irrelevant properties - for
139  * example, AVColorSpace is not checked for RGB frames.
140  */
141 int sws_test_frame(const AVFrame *frame, int output);
142 
143 /**
144  * Check if a given conversion is a noop. Returns a positive integer if
145  * no operation needs to be performed, 0 otherwise.
146  */
147 int sws_is_noop(const AVFrame *dst, const AVFrame *src);
148 
149 /* values for the flags, the stuff on the command line is different */
150 #define SWS_FAST_BILINEAR 1
151 #define SWS_BILINEAR 2
152 #define SWS_BICUBIC 4
153 #define SWS_X 8
154 #define SWS_POINT 0x10
155 #define SWS_AREA 0x20
156 #define SWS_BICUBLIN 0x40
157 #define SWS_GAUSS 0x80
158 #define SWS_SINC 0x100
159 #define SWS_LANCZOS 0x200
160 #define SWS_SPLINE 0x400
161 
162 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
163 #define SWS_SRC_V_CHR_DROP_SHIFT 16
164 
165 #define SWS_PARAM_DEFAULT 123456
166 
167 #define SWS_PRINT_INFO 0x1000
168 
169 //the following 3 flags are not completely implemented
170 
171 /**
172  * Perform full chroma upsampling when upscaling to RGB.
173  *
174  * For example, when converting 50x50 yuv420p to 100x100 rgba, setting this flag
175  * will scale the chroma plane from 25x25 to 100x100 (4:4:4), and then convert
176  * the 100x100 yuv444p image to rgba in the final output step.
177  *
178  * Without this flag, the chroma plane is instead scaled to 50x100 (4:2:2),
179  * with a single chroma sample being re-used for both of the horizontally
180  * adjacent RGBA output pixels.
181  */
182 #define SWS_FULL_CHR_H_INT 0x2000
183 
184 /**
185  * Perform full chroma interpolation when downscaling RGB sources.
186  *
187  * For example, when converting a 100x100 rgba source to 50x50 yuv444p, setting
188  * this flag will generate a 100x100 (4:4:4) chroma plane, which is then
189  * downscaled to the required 50x50.
190  *
191  * Without this flag, the chroma plane is instead generated at 50x100 (dropping
192  * every other pixel), before then being downscaled to the required 50x50
193  * resolution.
194  */
195 #define SWS_FULL_CHR_H_INP 0x4000
196 
197 #define SWS_DIRECT_BGR 0x8000
198 
199 #define SWS_ACCURATE_RND 0x40000
200 #define SWS_BITEXACT 0x80000
201 #define SWS_ERROR_DIFFUSION 0x800000
202 
203 #define SWS_MAX_REDUCE_CUTOFF 0.002
204 
205 #define SWS_CS_ITU709 1
206 #define SWS_CS_FCC 4
207 #define SWS_CS_ITU601 5
208 #define SWS_CS_ITU624 5
209 #define SWS_CS_SMPTE170M 5
210 #define SWS_CS_SMPTE240M 7
211 #define SWS_CS_DEFAULT 5
212 #define SWS_CS_BT2020 9
213 
214 /**
215  * Return a pointer to yuv<->rgb coefficients for the given colorspace
216  * suitable for sws_setColorspaceDetails().
217  *
218  * @param colorspace One of the SWS_CS_* macros. If invalid,
219  * SWS_CS_DEFAULT is used.
220  */
221 const int *sws_getCoefficients(int colorspace);
222 
223 // when used for filters they must have an odd number of elements
224 // coeffs cannot be shared between vectors
225 typedef struct SwsVector {
226  double *coeff; ///< pointer to the list of coefficients
227  int length; ///< number of coefficients in the vector
228 } SwsVector;
229 
230 // vectors can be shared
231 typedef struct SwsFilter {
236 } SwsFilter;
237 
238 /**
239  * Return a positive value if pix_fmt is a supported input format, 0
240  * otherwise.
241  */
243 
244 /**
245  * Return a positive value if pix_fmt is a supported output format, 0
246  * otherwise.
247  */
249 
250 /**
251  * @param[in] pix_fmt the pixel format
252  * @return a positive value if an endianness conversion for pix_fmt is
253  * supported, 0 otherwise.
254  */
256 
257 /**
258  * Initialize the swscaler context sws_context.
259  *
260  * @return zero or positive value on success, a negative value on
261  * error
262  */
264 int sws_init_context(SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
265 
266 /**
267  * Free the swscaler context swsContext.
268  * If swsContext is NULL, then does nothing.
269  */
270 void sws_freeContext(SwsContext *swsContext);
271 
272 /**
273  * Allocate and return an SwsContext. You need it to perform
274  * scaling/conversion operations using sws_scale().
275  *
276  * @param srcW the width of the source image
277  * @param srcH the height of the source image
278  * @param srcFormat the source image format
279  * @param dstW the width of the destination image
280  * @param dstH the height of the destination image
281  * @param dstFormat the destination image format
282  * @param flags specify which algorithm and options to use for rescaling
283  * @param param extra parameters to tune the used scaler
284  * For SWS_BICUBIC param[0] and [1] tune the shape of the basis
285  * function, param[0] tunes f(1) and param[1] f´(1)
286  * For SWS_GAUSS param[0] tunes the exponent and thus cutoff
287  * frequency
288  * For SWS_LANCZOS param[0] tunes the width of the window function
289  * @return a pointer to an allocated context, or NULL in case of error
290  * @note this function is to be removed after a saner alternative is
291  * written
292  */
293 SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
294  int dstW, int dstH, enum AVPixelFormat dstFormat,
295  int flags, SwsFilter *srcFilter,
296  SwsFilter *dstFilter, const double *param);
297 
298 /**
299  * Scale the image slice in srcSlice and put the resulting scaled
300  * slice in the image in dst. A slice is a sequence of consecutive
301  * rows in an image.
302  *
303  * Slices have to be provided in sequential order, either in
304  * top-bottom or bottom-top order. If slices are provided in
305  * non-sequential order the behavior of the function is undefined.
306  *
307  * @param c the scaling context previously created with
308  * sws_getContext()
309  * @param srcSlice the array containing the pointers to the planes of
310  * the source slice
311  * @param srcStride the array containing the strides for each plane of
312  * the source image
313  * @param srcSliceY the position in the source image of the slice to
314  * process, that is the number (counted starting from
315  * zero) in the image of the first row of the slice
316  * @param srcSliceH the height of the source slice, that is the number
317  * of rows in the slice
318  * @param dst the array containing the pointers to the planes of
319  * the destination image
320  * @param dstStride the array containing the strides for each plane of
321  * the destination image
322  * @return the height of the output slice
323  */
324 int sws_scale(SwsContext *c, const uint8_t *const srcSlice[],
325  const int srcStride[], int srcSliceY, int srcSliceH,
326  uint8_t *const dst[], const int dstStride[]);
327 
328 /**
329  * Scale source data from src and write the output to dst.
330  *
331  * This is merely a convenience wrapper around
332  * - sws_frame_start()
333  * - sws_send_slice(0, src->height)
334  * - sws_receive_slice(0, dst->height)
335  * - sws_frame_end()
336  *
337  * @param c The scaling context
338  * @param dst The destination frame. See documentation for sws_frame_start() for
339  * more details.
340  * @param src The source frame.
341  *
342  * @return 0 on success, a negative AVERROR code on failure
343  */
345 
346 /**
347  * Initialize the scaling process for a given pair of source/destination frames.
348  * Must be called before any calls to sws_send_slice() and sws_receive_slice().
349  *
350  * This function will retain references to src and dst, so they must both use
351  * refcounted buffers (if allocated by the caller, in case of dst).
352  *
353  * @param c The scaling context
354  * @param dst The destination frame.
355  *
356  * The data buffers may either be already allocated by the caller or
357  * left clear, in which case they will be allocated by the scaler.
358  * The latter may have performance advantages - e.g. in certain cases
359  * some output planes may be references to input planes, rather than
360  * copies.
361  *
362  * Output data will be written into this frame in successful
363  * sws_receive_slice() calls.
364  * @param src The source frame. The data buffers must be allocated, but the
365  * frame data does not have to be ready at this point. Data
366  * availability is then signalled by sws_send_slice().
367  * @return 0 on success, a negative AVERROR code on failure
368  *
369  * @see sws_frame_end()
370  */
372 
373 /**
374  * Finish the scaling process for a pair of source/destination frames previously
375  * submitted with sws_frame_start(). Must be called after all sws_send_slice()
376  * and sws_receive_slice() calls are done, before any new sws_frame_start()
377  * calls.
378  *
379  * @param c The scaling context
380  */
381 void sws_frame_end(SwsContext *c);
382 
383 /**
384  * Indicate that a horizontal slice of input data is available in the source
385  * frame previously provided to sws_frame_start(). The slices may be provided in
386  * any order, but may not overlap. For vertically subsampled pixel formats, the
387  * slices must be aligned according to subsampling.
388  *
389  * @param c The scaling context
390  * @param slice_start first row of the slice
391  * @param slice_height number of rows in the slice
392  *
393  * @return a non-negative number on success, a negative AVERROR code on failure.
394  */
395 int sws_send_slice(SwsContext *c, unsigned int slice_start,
396  unsigned int slice_height);
397 
398 /**
399  * Request a horizontal slice of the output data to be written into the frame
400  * previously provided to sws_frame_start().
401  *
402  * @param c The scaling context
403  * @param slice_start first row of the slice; must be a multiple of
404  * sws_receive_slice_alignment()
405  * @param slice_height number of rows in the slice; must be a multiple of
406  * sws_receive_slice_alignment(), except for the last slice
407  * (i.e. when slice_start+slice_height is equal to output
408  * frame height)
409  *
410  * @return a non-negative number if the data was successfully written into the output
411  * AVERROR(EAGAIN) if more input data needs to be provided before the
412  * output can be produced
413  * another negative AVERROR code on other kinds of scaling failure
414  */
415 int sws_receive_slice(SwsContext *c, unsigned int slice_start,
416  unsigned int slice_height);
417 
418 /**
419  * Get the alignment required for slices
420  *
421  * @param c The scaling context
422  * @return alignment required for output slices requested with sws_receive_slice().
423  * Slice offsets and sizes passed to sws_receive_slice() must be
424  * multiples of the value returned from this function.
425  */
426 unsigned int sws_receive_slice_alignment(const SwsContext *c);
427 
428 /**
429  * @param c the scaling context
430  * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg)
431  * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg)
432  * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x]
433  * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x]
434  * @param brightness 16.16 fixed point brightness correction
435  * @param contrast 16.16 fixed point contrast correction
436  * @param saturation 16.16 fixed point saturation correction
437  *
438  * @return A negative error code on error, non negative otherwise.
439  * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported.
440  */
441 int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4],
442  int srcRange, const int table[4], int dstRange,
443  int brightness, int contrast, int saturation);
444 
445 /**
446  * @return A negative error code on error, non negative otherwise.
447  * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported.
448  */
449 int sws_getColorspaceDetails(SwsContext *c, int **inv_table,
450  int *srcRange, int **table, int *dstRange,
451  int *brightness, int *contrast, int *saturation);
452 
453 /**
454  * Allocate and return an uninitialized vector with length coefficients.
455  */
456 SwsVector *sws_allocVec(int length);
457 
458 /**
459  * Return a normalized Gaussian curve used to filter stuff
460  * quality = 3 is high quality, lower is lower quality.
461  */
462 SwsVector *sws_getGaussianVec(double variance, double quality);
463 
464 /**
465  * Scale all the coefficients of a by the scalar value.
466  */
467 void sws_scaleVec(SwsVector *a, double scalar);
468 
469 /**
470  * Scale all the coefficients of a so that their sum equals height.
471  */
472 void sws_normalizeVec(SwsVector *a, double height);
473 
474 void sws_freeVec(SwsVector *a);
475 
476 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
477  float lumaSharpen, float chromaSharpen,
478  float chromaHShift, float chromaVShift,
479  int verbose);
481 
482 /**
483  * Check if context can be reused, otherwise reallocate a new one.
484  *
485  * If context is NULL, just calls sws_getContext() to get a new
486  * context. Otherwise, checks if the parameters are the ones already
487  * saved in context. If that is the case, returns the current
488  * context. Otherwise, frees context and gets a new context with
489  * the new parameters.
490  *
491  * Be warned that srcFilter and dstFilter are not checked, they
492  * are assumed to remain the same.
493  */
494 SwsContext *sws_getCachedContext(SwsContext *context, int srcW, int srcH,
495  enum AVPixelFormat srcFormat, int dstW, int dstH,
496  enum AVPixelFormat dstFormat, int flags,
497  SwsFilter *srcFilter, SwsFilter *dstFilter,
498  const double *param);
499 
500 /**
501  * Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
502  *
503  * The output frame will have the same packed format as the palette.
504  *
505  * @param src source frame buffer
506  * @param dst destination frame buffer
507  * @param num_pixels number of pixels to convert
508  * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
509  */
510 void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
511 
512 /**
513  * Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
514  *
515  * With the palette format "ABCD", the destination frame ends up with the format "ABC".
516  *
517  * @param src source frame buffer
518  * @param dst destination frame buffer
519  * @param num_pixels number of pixels to convert
520  * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
521  */
522 void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
523 
524 /**
525  * @}
526  */
527 
528 #endif /* SWSCALE_SWSCALE_H */
sws_setColorspaceDetails
int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation)
Definition: utils.c:1046
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
version_major.h
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:611
output
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 output
Definition: filter_design.txt:225
sws_freeContext
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
Definition: utils.c:2453
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
sws_test_primaries
int sws_test_primaries(enum AVColorPrimaries primaries, int output)
Test if a given set of color primaries is supported.
Definition: utils.c:2747
table
static const uint16_t table[]
Definition: prosumer.c:203
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
sws_receive_slice
int sws_receive_slice(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:1170
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:586
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:2613
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:2349
primaries
enum AVColorPrimaries primaries
Definition: mediacodec_wrapper.c:2612
sws_getCachedContext
SwsContext * sws_getCachedContext(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:2539
swscale_license
const char * swscale_license(void)
Return the libswscale license.
Definition: version.c:38
sws_init_context
av_warn_unused_result int sws_init_context(SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
Definition: utils.c:2088
sws_get_class
const AVClass * sws_get_class(void)
Get the AVClass for swsContext.
Definition: options.c:99
SwsContext
struct SwsContext SwsContext
Definition: swscale.h:45
format
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
SwsVector::length
int length
number of coefficients in the vector
Definition: swscale.h:227
sws_allocVec
SwsVector * sws_allocVec(int length)
Allocate and return an uninitialized vector with length coefficients.
Definition: utils.c:2159
sws_test_colorspace
int sws_test_colorspace(enum AVColorSpace colorspace, int output)
Test if a given color space is supported.
Definition: utils.c:2730
ctx
AVFormatContext * ctx
Definition: movenc.c:49
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:2176
sws_frame_end
void sws_frame_end(SwsContext *c)
Finish the scaling process for a pair of source/destination frames previously submitted with sws_fram...
Definition: swscale.c:1109
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:75
sws_is_noop
int sws_is_noop(const AVFrame *dst, const AVFrame *src)
Check if a given conversion is a noop.
Definition: utils.c:2793
sws_getDefaultFilter
SwsFilter * sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose)
Definition: utils.c:2370
sws_test_format
int sws_test_format(enum AVPixelFormat format, int output)
Test if a given pixel format is supported.
Definition: utils.c:2725
SwsVector::coeff
double * coeff
pointer to the list of coefficients
Definition: swscale.h:226
sws_scaleVec
void sws_scaleVec(SwsVector *a, double scalar)
Scale all the coefficients of a by the scalar value.
Definition: utils.c:2242
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:235
height
#define height
Definition: dsp.h:85
sws_alloc_context
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext.
Definition: utils.c:1229
SwsVector
Definition: swscale.h:225
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
frame.h
sws_getColorspaceDetails
int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
Definition: utils.c:1204
SwsFilter
Definition: swscale.h:231
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:233
sws_test_transfer
int sws_test_transfer(enum AVColorTransferCharacteristic trc, int output)
Test if a given color transfer function is supported.
Definition: utils.c:2753
swscale_configuration
const char * swscale_configuration(void)
Return the libswscale build-time configuration.
Definition: version.c:33
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:374
av_warn_unused_result
#define av_warn_unused_result
Definition: attributes.h:64
sws_isSupportedEndiannessConversion
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
Definition: utils.c:386
sws_send_slice
int sws_send_slice(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:1148
log.h
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:640
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:380
sws_test_frame
int sws_test_frame(const AVFrame *frame, int output)
Helper function to run all sws_test_* against a frame, as well as testing the basic frame properties ...
Definition: utils.c:2780
sws_freeFilter
void sws_freeFilter(SwsFilter *filter)
Definition: utils.c:2358
slice_start
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition: dec.c:738
sws_receive_slice_alignment
unsigned int sws_receive_slice_alignment(const SwsContext *c)
Get the alignment required for slices.
Definition: swscale.c:1161
pixfmt.h
sws_frame_start
int sws_frame_start(SwsContext *c, AVFrame *dst, const AVFrame *src)
Initialize the scaling process for a given pair of source/destination frames.
Definition: swscale.c:1117
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
verbose
int verbose
Definition: checkasm.c:404
sws_getContext
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:2122
sws_scale
int sws_scale(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:1246
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:61
swscale_version
unsigned swscale_version(void)
Definition: version.c:27
SwsFilter::lumH
SwsVector * lumH
Definition: swscale.h:232
sws_free_context
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
Definition: utils.c:2529
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
sws_scale_frame
int sws_scale_frame(SwsContext *c, AVFrame *dst, const AVFrame *src)
Scale source data from src and write the output to dst.
Definition: swscale.c:1225
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:2603
SwsFilter::chrH
SwsVector * chrH
Definition: swscale.h:234
sws_normalizeVec
void sws_normalizeVec(SwsVector *a, double height)
Scale all the coefficients of a so that their sum equals height.
Definition: utils.c:2250
src
#define src
Definition: vp8dsp.c:248