FFmpeg
swscale_internal.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_INTERNAL_H
22 #define SWSCALE_SWSCALE_INTERNAL_H
23 
24 #include <stdatomic.h>
25 #include <assert.h>
26 
27 #include "config.h"
28 #include "swscale.h"
29 #include "graph.h"
30 
31 #include "libavutil/avassert.h"
32 #include "libavutil/common.h"
33 #include "libavutil/frame.h"
34 #include "libavutil/intreadwrite.h"
35 #include "libavutil/log.h"
36 #include "libavutil/mem_internal.h"
37 #include "libavutil/pixfmt.h"
38 #include "libavutil/pixdesc.h"
39 #include "libavutil/slicethread.h"
40 #include "libavutil/half2float.h"
41 
42 #if HAVE_ALTIVEC
43 #define SWSINTERNAL_ADDITIONAL_ASM_SIZE (7*16 + 2*8 + /* alignment */ 16)
44 #endif
45 #ifndef SWSINTERNAL_ADDITIONAL_ASM_SIZE
46 #define SWSINTERNAL_ADDITIONAL_ASM_SIZE 0
47 #endif
48 
49 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
50 
51 #define YUVRGB_TABLE_HEADROOM 512
52 #define YUVRGB_TABLE_LUMA_HEADROOM 512
53 
54 #define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
55 
56 #define SWS_MAX_THREADS 8192 /* sanity clamp */
57 
58 #if HAVE_BIGENDIAN
59 #define ALT32_CORR (-1)
60 #else
61 #define ALT32_CORR 1
62 #endif
63 
64 #if ARCH_X86_64
65 # define APCK_PTR2 8
66 # define APCK_COEF 16
67 # define APCK_SIZE 24
68 #else
69 # define APCK_PTR2 4
70 # define APCK_COEF 8
71 # define APCK_SIZE 16
72 #endif
73 
74 #define RETCODE_USE_CASCADE -12345
75 
76 typedef struct SwsInternal SwsInternal;
77 
78 static inline SwsInternal *sws_internal(const SwsContext *sws)
79 {
80  return (SwsInternal *) sws;
81 }
82 
83 typedef struct Range {
84  unsigned int start;
85  unsigned int len;
86 } Range;
87 
88 typedef struct RangeList {
90  unsigned int nb_ranges;
92 } RangeList;
93 
94 int ff_range_add(RangeList *r, unsigned int start, unsigned int len);
95 
96 typedef int (*SwsFunc)(SwsInternal *c, const uint8_t *const src[],
97  const int srcStride[], int srcSliceY, int srcSliceH,
98  uint8_t *const dst[], const int dstStride[]);
99 
100 typedef void (*SwsColorFunc)(const SwsInternal *c, uint8_t *dst, int dst_stride,
101  const uint8_t *src, int src_stride, int w, int h);
102 
103 typedef struct SwsLuts {
104  uint16_t *in;
105  uint16_t *out;
106 } SwsLuts;
107 
108 typedef struct SwsColorXform {
110  int16_t mat[3][3];
111 } SwsColorXform;
112 
113 /**
114  * Write one line of horizontally scaled data to planar output
115  * without any additional vertical scaling (or point-scaling).
116  *
117  * @param src scaled source data, 15 bits for 8-10-bit output,
118  * 19 bits for 16-bit output (in int32_t)
119  * @param dest pointer to the output plane. For >8-bit
120  * output, this is in uint16_t
121  * @param dstW width of destination in pixels
122  * @param dither ordered dither array of type int16_t and size 8
123  * @param offset Dither offset
124  */
125 typedef void (*yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW,
126  const uint8_t *dither, int offset);
127 
128 /**
129  * Write one line of horizontally scaled data to planar output
130  * with multi-point vertical scaling between input pixels.
131  *
132  * @param filter vertical luma/alpha scaling coefficients, 12 bits [0,4096]
133  * @param src scaled luma (Y) or alpha (A) source data, 15 bits for
134  * 8-10-bit output, 19 bits for 16-bit output (in int32_t)
135  * @param filterSize number of vertical input lines to scale
136  * @param dest pointer to output plane. For >8-bit
137  * output, this is in uint16_t
138  * @param dstW width of destination pixels
139  * @param offset Dither offset
140  */
141 typedef void (*yuv2planarX_fn)(const int16_t *filter, int filterSize,
142  const int16_t **src, uint8_t *dest, int dstW,
143  const uint8_t *dither, int offset);
144 
145 /**
146  * Write one line of horizontally scaled chroma to interleaved output
147  * with multi-point vertical scaling between input pixels.
148  *
149  * @param dstFormat destination pixel format
150  * @param chrDither ordered dither array of type uint8_t and size 8
151  * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096]
152  * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit
153  * output, 19 bits for 16-bit output (in int32_t)
154  * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit
155  * output, 19 bits for 16-bit output (in int32_t)
156  * @param chrFilterSize number of vertical chroma input lines to scale
157  * @param dest pointer to the output plane. For >8-bit
158  * output, this is in uint16_t
159  * @param dstW width of chroma planes
160  */
161 typedef void (*yuv2interleavedX_fn)(enum AVPixelFormat dstFormat,
162  const uint8_t *chrDither,
163  const int16_t *chrFilter,
164  int chrFilterSize,
165  const int16_t **chrUSrc,
166  const int16_t **chrVSrc,
167  uint8_t *dest, int dstW);
168 
169 /**
170  * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
171  * output without any additional vertical scaling (or point-scaling). Note
172  * that this function may do chroma scaling, see the "uvalpha" argument.
173  *
174  * @param c SWS scaling context
175  * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output,
176  * 19 bits for 16-bit output (in int32_t)
177  * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output,
178  * 19 bits for 16-bit output (in int32_t)
179  * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output,
180  * 19 bits for 16-bit output (in int32_t)
181  * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output,
182  * 19 bits for 16-bit output (in int32_t)
183  * @param dest pointer to the output plane. For 16-bit output, this is
184  * uint16_t
185  * @param dstW width of lumSrc and alpSrc in pixels, number of pixels
186  * to write into dest[]
187  * @param uvalpha chroma scaling coefficient for the second line of chroma
188  * pixels, either 2048 or 0. If 0, one chroma input is used
189  * for 2 output pixels (or if the SWS_FLAG_FULL_CHR_INT flag
190  * is set, it generates 1 output pixel). If 2048, two chroma
191  * input pixels should be averaged for 2 output pixels (this
192  * only happens if SWS_FLAG_FULL_CHR_INT is not set)
193  * @param y vertical line number for this output. This does not need
194  * to be used to calculate the offset in the destination,
195  * but can be used to generate comfort noise using dithering
196  * for some output formats.
197  */
198 typedef void (*yuv2packed1_fn)(SwsInternal *c, const int16_t *lumSrc,
199  const int16_t *chrUSrc[2],
200  const int16_t *chrVSrc[2],
201  const int16_t *alpSrc, uint8_t *dest,
202  int dstW, int uvalpha, int y);
203 /**
204  * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
205  * output by doing bilinear scaling between two input lines.
206  *
207  * @param c SWS scaling context
208  * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output,
209  * 19 bits for 16-bit output (in int32_t)
210  * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output,
211  * 19 bits for 16-bit output (in int32_t)
212  * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output,
213  * 19 bits for 16-bit output (in int32_t)
214  * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output,
215  * 19 bits for 16-bit output (in int32_t)
216  * @param dest pointer to the output plane. For 16-bit output, this is
217  * uint16_t
218  * @param dstW width of lumSrc and alpSrc in pixels, number of pixels
219  * to write into dest[]
220  * @param yalpha luma/alpha scaling coefficients for the second input line.
221  * The first line's coefficients can be calculated by using
222  * 4096 - yalpha
223  * @param uvalpha chroma scaling coefficient for the second input line. The
224  * first line's coefficients can be calculated by using
225  * 4096 - uvalpha
226  * @param y vertical line number for this output. This does not need
227  * to be used to calculate the offset in the destination,
228  * but can be used to generate comfort noise using dithering
229  * for some output formats.
230  */
231 typedef void (*yuv2packed2_fn)(SwsInternal *c, const int16_t *lumSrc[2],
232  const int16_t *chrUSrc[2],
233  const int16_t *chrVSrc[2],
234  const int16_t *alpSrc[2],
235  uint8_t *dest,
236  int dstW, int yalpha, int uvalpha, int y);
237 /**
238  * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
239  * output by doing multi-point vertical scaling between input pixels.
240  *
241  * @param c SWS scaling context
242  * @param lumFilter vertical luma/alpha scaling coefficients, 12 bits [0,4096]
243  * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output,
244  * 19 bits for 16-bit output (in int32_t)
245  * @param lumFilterSize number of vertical luma/alpha input lines to scale
246  * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096]
247  * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output,
248  * 19 bits for 16-bit output (in int32_t)
249  * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output,
250  * 19 bits for 16-bit output (in int32_t)
251  * @param chrFilterSize number of vertical chroma input lines to scale
252  * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output,
253  * 19 bits for 16-bit output (in int32_t)
254  * @param dest pointer to the output plane. For 16-bit output, this is
255  * uint16_t
256  * @param dstW width of lumSrc and alpSrc in pixels, number of pixels
257  * to write into dest[]
258  * @param y vertical line number for this output. This does not need
259  * to be used to calculate the offset in the destination,
260  * but can be used to generate comfort noise using dithering
261  * or some output formats.
262  */
263 typedef void (*yuv2packedX_fn)(SwsInternal *c, const int16_t *lumFilter,
264  const int16_t **lumSrc, int lumFilterSize,
265  const int16_t *chrFilter,
266  const int16_t **chrUSrc,
267  const int16_t **chrVSrc, int chrFilterSize,
268  const int16_t **alpSrc, uint8_t *dest,
269  int dstW, int y);
270 
271 /**
272  * Write one line of horizontally scaled Y/U/V/A to YUV/RGB
273  * output by doing multi-point vertical scaling between input pixels.
274  *
275  * @param c SWS scaling context
276  * @param lumFilter vertical luma/alpha scaling coefficients, 12 bits [0,4096]
277  * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output,
278  * 19 bits for 16-bit output (in int32_t)
279  * @param lumFilterSize number of vertical luma/alpha input lines to scale
280  * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096]
281  * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output,
282  * 19 bits for 16-bit output (in int32_t)
283  * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output,
284  * 19 bits for 16-bit output (in int32_t)
285  * @param chrFilterSize number of vertical chroma input lines to scale
286  * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output,
287  * 19 bits for 16-bit output (in int32_t)
288  * @param dest pointer to the output planes. For 16-bit output, this is
289  * uint16_t
290  * @param dstW width of lumSrc and alpSrc in pixels, number of pixels
291  * to write into dest[]
292  * @param y vertical line number for this output. This does not need
293  * to be used to calculate the offset in the destination,
294  * but can be used to generate comfort noise using dithering
295  * or some output formats.
296  */
297 typedef void (*yuv2anyX_fn)(SwsInternal *c, const int16_t *lumFilter,
298  const int16_t **lumSrc, int lumFilterSize,
299  const int16_t *chrFilter,
300  const int16_t **chrUSrc,
301  const int16_t **chrVSrc, int chrFilterSize,
302  const int16_t **alpSrc, uint8_t **dest,
303  int dstW, int y);
304 
305 /**
306  * Unscaled conversion of luma/alpha plane to YV12 for horizontal scaler.
307  */
308 typedef void (*planar1_YV12_fn)(uint8_t *dst, const uint8_t *src, const uint8_t *src2,
309  const uint8_t *src3, int width, uint32_t *pal,
310  void *opaque);
311 
312 /**
313  * Unscaled conversion of chroma plane to YV12 for horizontal scaler.
314  */
315 typedef void (*planar2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src,
316  const uint8_t *src2, const uint8_t *src3,
317  int width, uint32_t *pal, void *opaque);
318 
319 /**
320  * Unscaled conversion of arbitrary planar data (e.g. RGBA) to YV12, through
321  * conversion using the given color matrix.
322  */
323 typedef void (*planarX_YV12_fn)(uint8_t *dst, const uint8_t *src[4], int width,
324  int32_t *rgb2yuv, void *opaque);
325 
326 typedef void (*planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2,
327  const uint8_t *src[4], int width,
328  int32_t *rgb2yuv, void *opaque);
329 
330 struct SwsSlice;
331 struct SwsFilterDescriptor;
332 
333 /* This struct should be aligned on at least a 32-byte boundary. */
334 struct SwsInternal {
335  /* Currently active user-facing options. Also contains AVClass */
337 
338  /* Parent context (for slice contexts) */
340 
343  int *slice_err;
345 
346  /* Scaling graph, reinitialized dynamically as needed. */
347  SwsGraph *graph[2]; /* top, bottom fields */
348 
349  // values passed to current sws_receive_slice() call
352 
353  /**
354  * Note that src, dst, srcStride, dstStride will be copied in the
355  * sws_scale() wrapper so they can be freely modified here.
356  */
358  int chrSrcW; ///< Width of source chroma planes.
359  int chrSrcH; ///< Height of source chroma planes.
360  int chrDstW; ///< Width of destination chroma planes.
361  int chrDstH; ///< Height of destination chroma planes.
364  int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.
365  int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.
367  int chrSrcHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image.
368  int chrSrcVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image.
369  int chrDstHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image.
370  int chrDstVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination image.
371  int vChrDrop; ///< Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user.
372  int sliceDir; ///< Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top).
373 
376 
378 
379  /* The cascaded_* fields allow splitting a scaler task into multiple
380  * sequential steps, this is for example used to limit the maximum
381  * downscaling factor that needs to be supported in one scaler.
382  */
385  uint8_t *cascaded_tmp[2][4];
387 
388  double gamma_value;
390  uint16_t *gamma;
391  uint16_t *inv_gamma;
392 
393  int numDesc;
394  int descIndex[2];
395  int numSlice;
396  struct SwsSlice *slice;
398 
399  uint32_t pal_yuv[256];
400  uint32_t pal_rgb[256];
401 
402  float uint2float_lut[256];
403 
404  /**
405  * @name Scaled horizontal lines ring buffer.
406  * The horizontal scaler keeps just enough scaled lines in a ring buffer
407  * so they may be passed to the vertical scaler. The pointers to the
408  * allocated buffers for each line are duplicated in sequence in the ring
409  * buffer to simplify indexing and avoid wrapping around between lines
410  * inside the vertical scaler code. The wrapping is done before the
411  * vertical scaler is called.
412  */
413  //@{
414  int lastInLumBuf; ///< Last scaled horizontal luma/alpha line from source in the ring buffer.
415  int lastInChrBuf; ///< Last scaled horizontal chroma line from source in the ring buffer.
416  //@}
417 
420 
421  /**
422  * @name Horizontal and vertical filters.
423  * To better understand the following fields, here is a pseudo-code of
424  * their usage in filtering a horizontal line:
425  * @code
426  * for (i = 0; i < width; i++) {
427  * dst[i] = 0;
428  * for (j = 0; j < filterSize; j++)
429  * dst[i] += src[ filterPos[i] + j ] * filter[ filterSize * i + j ];
430  * dst[i] >>= FRAC_BITS; // The actual implementation is fixed-point.
431  * }
432  * @endcode
433  */
434  //@{
435  int16_t *hLumFilter; ///< Array of horizontal filter coefficients for luma/alpha planes.
436  int16_t *hChrFilter; ///< Array of horizontal filter coefficients for chroma planes.
437  int16_t *vLumFilter; ///< Array of vertical filter coefficients for luma/alpha planes.
438  int16_t *vChrFilter; ///< Array of vertical filter coefficients for chroma planes.
439  int32_t *hLumFilterPos; ///< Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.
440  int32_t *hChrFilterPos; ///< Array of horizontal filter starting positions for each dst[i] for chroma planes.
441  int32_t *vLumFilterPos; ///< Array of vertical filter starting positions for each dst[i] for luma/alpha planes.
442  int32_t *vChrFilterPos; ///< Array of vertical filter starting positions for each dst[i] for chroma planes.
443  int hLumFilterSize; ///< Horizontal filter size for luma/alpha pixels.
444  int hChrFilterSize; ///< Horizontal filter size for chroma pixels.
445  int vLumFilterSize; ///< Vertical filter size for luma/alpha pixels.
446  int vChrFilterSize; ///< Vertical filter size for chroma pixels.
447  //@}
448 
449  int lumMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
450  int chrMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
451  uint8_t *lumMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
452  uint8_t *chrMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
453 
456 
457  int dstY; ///< Last destination vertical line output from last slice.
458  void *yuvTable; // pointer to the yuv->rgb table start so it can be freed()
459  // alignment ensures the offset can be added in a single
460  // instruction on e.g. ARM
462  uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM];
463  uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM];
464  uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM];
465  DECLARE_ALIGNED(16, int32_t, input_rgb2yuv_table)[16+40*4]; // This table can contain both C and SIMD formatted values, the C vales are always at the XY_IDX points
466 #define RY_IDX 0
467 #define GY_IDX 1
468 #define BY_IDX 2
469 #define RU_IDX 3
470 #define GU_IDX 4
471 #define BU_IDX 5
472 #define RV_IDX 6
473 #define GV_IDX 7
474 #define BV_IDX 8
475 #define RGB2YUV_SHIFT 15
476 
477  int *dither_error[4];
478 
479  //Colorspace stuff
480  int contrast, brightness, saturation; // for sws_getColorspaceDetails
485  int srcXYZ;
486  int dstXYZ;
493 
494 #define RED_DITHER "0*8"
495 #define GREEN_DITHER "1*8"
496 #define BLUE_DITHER "2*8"
497 #define Y_COEFF "3*8"
498 #define VR_COEFF "4*8"
499 #define UB_COEFF "5*8"
500 #define VG_COEFF "6*8"
501 #define UG_COEFF "7*8"
502 #define Y_OFFSET "8*8"
503 #define U_OFFSET "9*8"
504 #define V_OFFSET "10*8"
505 #define LUM_MMX_FILTER_OFFSET "11*8"
506 #define CHR_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)
507 #define DSTW_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2"
508 #define ESP_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+8"
509 #define VROUNDER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+16"
510 #define U_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+24"
511 #define V_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+32"
512 #define Y_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+40"
513 #define ALP_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+48"
514 #define UV_OFF_PX "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+48"
515 #define UV_OFF_BYTE "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+56"
516 #define DITHER16 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+64"
517 #define DITHER32 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+80"
518 #define DITHER32_INT (11*8+4*4*MAX_FILTER_SIZE*3+80) // value equal to above, used for checking that the struct hasn't been changed by mistake
519 
520  DECLARE_ALIGNED(8, uint64_t, redDither);
523 
524  DECLARE_ALIGNED(8, uint64_t, yCoeff);
525  DECLARE_ALIGNED(8, uint64_t, vrCoeff);
526  DECLARE_ALIGNED(8, uint64_t, ubCoeff);
527  DECLARE_ALIGNED(8, uint64_t, vgCoeff);
528  DECLARE_ALIGNED(8, uint64_t, ugCoeff);
529  DECLARE_ALIGNED(8, uint64_t, yOffset);
530  DECLARE_ALIGNED(8, uint64_t, uOffset);
531  DECLARE_ALIGNED(8, uint64_t, vOffset);
534  int dstW_mmx;
535  DECLARE_ALIGNED(8, uint64_t, esp);
536  DECLARE_ALIGNED(8, uint64_t, vRounder);
537  DECLARE_ALIGNED(8, uint64_t, u_temp);
538  DECLARE_ALIGNED(8, uint64_t, v_temp);
539  DECLARE_ALIGNED(8, uint64_t, y_temp);
541  // alignment of these values is not necessary, but merely here
542  // to maintain the same offset across x8632 and x86-64. Once we
543  // use proper offset macros in the asm, they can be removed.
544  DECLARE_ALIGNED(8, ptrdiff_t, uv_off); ///< offset (in pixels) between u and v planes
545  DECLARE_ALIGNED(8, ptrdiff_t, uv_offx2); ///< offset (in bytes) between u and v planes
546  DECLARE_ALIGNED(8, uint16_t, dither16)[8];
547  DECLARE_ALIGNED(8, uint32_t, dither32)[8];
548 
549  const uint8_t *chrDither8, *lumDither8;
550 
552 
553 /* pre defined color-spaces gamma */
554 #define XYZ_GAMMA (2.6)
555 #define RGB_GAMMA (2.2)
560 
561  /* function pointers for swscale() */
569 
570  /// Opaque data pointer passed to all input functions.
572 
576 
577  /**
578  * Functions to read planar input, such as planar RGB, and convert
579  * internally to Y/UV/A.
580  */
581  /** @{ */
585  /** @} */
586 
587  /**
588  * Scale one horizontal line of input data using a bilinear filter
589  * to produce one line of output data. Compared to SwsInternal->hScale(),
590  * please take note of the following caveats when using these:
591  * - Scaling is done using only 7 bits instead of 14-bit coefficients.
592  * - You can use no more than 5 input pixels to produce 4 output
593  * pixels. Therefore, this filter should not be used for downscaling
594  * by more than ~20% in width (because that equals more than 5/4th
595  * downscaling and thus more than 5 pixels input per 4 pixels output).
596  * - In general, bilinear filters create artifacts during downscaling
597  * (even when <20%), because one output pixel will span more than one
598  * input pixel, and thus some pixels will need edges of both neighbor
599  * pixels to interpolate the output pixel. Since you can use at most
600  * two input pixels per output pixel in bilinear scaling, this is
601  * impossible and thus downscaling by any size will create artifacts.
602  * To enable this type of scaling, set SWS_FLAG_FAST_BILINEAR
603  * in SwsInternal->flags.
604  */
605  /** @{ */
607  int16_t *dst, int dstWidth,
608  const uint8_t *src, int srcW, int xInc);
610  int16_t *dst1, int16_t *dst2, int dstWidth,
611  const uint8_t *src1, const uint8_t *src2,
612  int srcW, int xInc);
613  /** @} */
614 
615  /**
616  * Scale one horizontal line of input data using a filter over the input
617  * lines, to produce one (differently sized) line of output data.
618  *
619  * @param dst pointer to destination buffer for horizontally scaled
620  * data. If the number of bits per component of one
621  * destination pixel (SwsInternal->dstBpc) is <= 10, data
622  * will be 15 bpc in 16 bits (int16_t) width. Else (i.e.
623  * SwsInternal->dstBpc == 16), data will be 19bpc in
624  * 32 bits (int32_t) width.
625  * @param dstW width of destination image
626  * @param src pointer to source data to be scaled. If the number of
627  * bits per component of a source pixel (SwsInternal->srcBpc)
628  * is 8, this is 8bpc in 8 bits (uint8_t) width. Else
629  * (i.e. SwsInternal->dstBpc > 8), this is native depth
630  * in 16 bits (uint16_t) width. In other words, for 9-bit
631  * YUV input, this is 9bpc, for 10-bit YUV input, this is
632  * 10bpc, and for 16-bit RGB or YUV, this is 16bpc.
633  * @param filter filter coefficients to be used per output pixel for
634  * scaling. This contains 14bpp filtering coefficients.
635  * Guaranteed to contain dstW * filterSize entries.
636  * @param filterPos position of the first input pixel to be used for
637  * each output pixel during scaling. Guaranteed to
638  * contain dstW entries.
639  * @param filterSize the number of input coefficients to be used (and
640  * thus the number of input pixels to be used) for
641  * creating a single output pixel. Is aligned to 4
642  * (and input coefficients thus padded with zeroes)
643  * to simplify creating SIMD code.
644  */
645  /** @{ */
646  void (*hyScale)(SwsInternal *c, int16_t *dst, int dstW,
647  const uint8_t *src, const int16_t *filter,
648  const int32_t *filterPos, int filterSize);
649  void (*hcScale)(SwsInternal *c, int16_t *dst, int dstW,
650  const uint8_t *src, const int16_t *filter,
651  const int32_t *filterPos, int filterSize);
652  /** @} */
653 
654  /**
655  * Color range conversion functions if needed.
656  * If SwsInternal->dstBpc is > 14:
657  * - int16_t *dst (data is 15 bpc)
658  * - uint16_t coeff
659  * - int32_t offset
660  * Otherwise (SwsInternal->dstBpc is <= 14):
661  * - int32_t *dst (data is 19 bpc)
662  * - uint32_t coeff
663  * - int64_t offset
664  */
665  /** @{ */
666  void (*lumConvertRange)(int16_t *dst, int width,
667  uint32_t coeff, int64_t offset);
668  void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width,
669  uint32_t coeff, int64_t offset);
670  /** @} */
671 
676 
677  int needs_hcscale; ///< Set if there are chroma planes to be converted.
678 
679  // scratch buffer for converting packed rgb0 sources
680  // filled with a copy of the input frame + fully opaque alpha,
681  // then passed as input to further conversion
682  uint8_t *rgb0_scratch;
684 
685  // scratch buffer for converting XYZ sources
686  // filled with the input converted to rgb48
687  // then passed as input to further conversion
688  uint8_t *xyz_scratch;
689  unsigned int xyz_scratch_allocated;
690 
691  unsigned int dst_slice_align;
695 
697 
698  // Hardware specific private data
699  void *hw_priv;
700 };
701 //FIXME check init (where 0)
702 
703 static_assert(offsetof(SwsInternal, redDither) + DITHER32_INT == offsetof(SwsInternal, dither32),
704  "dither32 must be at the same offset as redDither + DITHER32_INT");
705 
706 #if ARCH_X86_64
707 /* x86 yuv2gbrp uses the SwsInternal for yuv coefficients
708  if struct offsets change the asm needs to be updated too */
709 static_assert(offsetof(SwsInternal, yuv2rgb_y_offset) == 40348,
710  "yuv2rgb_y_offset must be updated in x86 asm");
711 #endif
712 
714 int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4],
715  int fullRange, int brightness,
716  int contrast, int saturation);
717 void ff_yuv2rgb_init_tables_ppc(SwsInternal *c, const int inv_table[4],
718  int brightness, int contrast, int saturation);
719 
720 void ff_updateMMXDitherTables(SwsInternal *c, int dstY);
721 
722 void ff_update_palette(SwsInternal *c, const uint32_t *pal);
723 
729 
732 
734 
739 
741 {
743  av_assert0(desc);
744  return desc->comp[0].depth == 16;
745 }
746 
748 {
750  av_assert0(desc);
751  return desc->comp[0].depth == 32;
752 }
753 
755 {
757  av_assert0(desc);
758  return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 14;
759 }
760 
762 {
764  av_assert0(desc);
765  return desc->flags & AV_PIX_FMT_FLAG_BE;
766 }
767 
769 {
771  av_assert0(desc);
772  return !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
773 }
774 
776 {
778  av_assert0(desc);
779  return ((desc->flags & AV_PIX_FMT_FLAG_PLANAR) && isYUV(pix_fmt));
780 }
781 
782 /*
783  * Identity semi-planar YUV formats. Specifically, those are YUV formats
784  * where the second and third components (U & V) are on the same plane.
785  */
787 {
789  av_assert0(desc);
790  return (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane);
791 }
792 
794 {
796  av_assert0(desc);
797  return (desc->flags & AV_PIX_FMT_FLAG_RGB);
798 }
799 
801 {
803  av_assert0(desc);
804  return !(desc->flags & AV_PIX_FMT_FLAG_PAL) &&
805  !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) &&
806  desc->nb_components <= 2 &&
809 }
810 
812 {
813  return pix_fmt == AV_PIX_FMT_RGB48BE ||
831 }
832 
834 {
835  return pix_fmt == AV_PIX_FMT_BGR48BE ||
853 }
854 
856 {
858  av_assert0(desc);
859  return !!(desc->flags & AV_PIX_FMT_FLAG_BAYER);
860 }
861 
863 {
865  av_assert0(desc);
866  return desc->comp[1].depth == 8;
867 }
868 
870 {
872  av_assert0(desc);
873  return (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
875 }
876 
878 {
880  av_assert0(desc);
881  return desc->flags & AV_PIX_FMT_FLAG_FLOAT;
882 }
883 
885 {
887  av_assert0(desc);
888  return (desc->flags & AV_PIX_FMT_FLAG_FLOAT) && desc->comp[0].depth == 16;
889 }
890 
892 {
894  av_assert0(desc);
895  if (pix_fmt == AV_PIX_FMT_PAL8)
896  return 1;
897  return desc->flags & AV_PIX_FMT_FLAG_ALPHA;
898 }
899 
901 {
903  av_assert0(desc);
904  return (desc->nb_components >= 2 && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) ||
907 }
908 
910 {
912  av_assert0(desc);
913  return (desc->nb_components >= 2 && (desc->flags & AV_PIX_FMT_FLAG_PLANAR));
914 }
915 
917 {
919  av_assert0(desc);
921 }
922 
924 {
926  av_assert0(desc);
927  return ((desc->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) ==
929 }
930 
932 {
933  switch (pix_fmt) {
934  case AV_PIX_FMT_PAL8:
936  case AV_PIX_FMT_BGR8:
937  case AV_PIX_FMT_GRAY8:
939  case AV_PIX_FMT_RGB8:
940  return 1;
941  default:
942  return 0;
943  }
944 }
945 
946 /*
947  * Identity formats where the data is in the high bits, and the low bits are shifted away.
948  */
950 {
951  int i;
953  av_assert0(desc);
955  return 0;
956  for (i = 0; i < desc->nb_components; i++) {
957  if (!desc->comp[i].shift)
958  return 0;
959  if ((desc->comp[i].shift + desc->comp[i].depth) & 0x7)
960  return 0;
961  }
962  return 1;
963 }
964 
965 /*
966  * Identity formats where the chroma planes are swapped (CrCb order).
967  */
969 {
971  av_assert0(desc);
972  if (!isYUV(pix_fmt))
973  return 0;
974  if ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) && desc->nb_components < 4)
975  return 0;
976  if (desc->nb_components < 3)
977  return 0;
979  return desc->comp[1].offset > desc->comp[2].offset;
980  else
981  return desc->comp[1].plane > desc->comp[2].plane;
982 }
983 
984 extern const uint64_t ff_dither4[2];
985 extern const uint64_t ff_dither8[2];
986 
987 extern const uint8_t ff_dither_2x2_4[3][8];
988 extern const uint8_t ff_dither_2x2_8[3][8];
989 extern const uint8_t ff_dither_4x4_16[5][8];
990 extern const uint8_t ff_dither_8x8_32[9][8];
991 extern const uint8_t ff_dither_8x8_73[9][8];
992 extern const uint8_t ff_dither_8x8_128[9][8];
993 extern const uint8_t ff_dither_8x8_220[9][8];
994 
995 extern const int32_t ff_yuv2rgb_coeffs[11][4];
996 
997 extern const AVClass ff_sws_context_class;
998 
1000  SwsFilter *dstFilter);
1001 
1002 /**
1003  * Set c->convert_unscaled to an unscaled converter if one exists for the
1004  * specific source and destination formats, bit depths, flags, etc.
1005  */
1010 
1012 
1014  planar1_YV12_fn *lumToYV12,
1015  planar1_YV12_fn *alpToYV12,
1016  planar2_YV12_fn *chrToYV12,
1017  planarX_YV12_fn *readLumPlanar,
1018  planarX_YV12_fn *readAlpPlanar,
1019  planarX2_YV12_fn *readChrPlanar);
1021  yuv2planar1_fn *yuv2plane1,
1023  yuv2interleavedX_fn *yuv2nv12cX,
1024  yuv2packed1_fn *yuv2packed1,
1025  yuv2packed2_fn *yuv2packed2,
1026  yuv2packedX_fn *yuv2packedX,
1027  yuv2anyX_fn *yuv2anyX);
1035 
1038 
1039 void ff_hyscale_fast_c(SwsInternal *c, int16_t *dst, int dstWidth,
1040  const uint8_t *src, int srcW, int xInc);
1041 void ff_hcscale_fast_c(SwsInternal *c, int16_t *dst1, int16_t *dst2,
1042  int dstWidth, const uint8_t *src1,
1043  const uint8_t *src2, int srcW, int xInc);
1044 int ff_init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
1045  int16_t *filter, int32_t *filterPos,
1046  int numSplits);
1047 void ff_hyscale_fast_mmxext(SwsInternal *c, int16_t *dst,
1048  int dstWidth, const uint8_t *src,
1049  int srcW, int xInc);
1050 void ff_hcscale_fast_mmxext(SwsInternal *c, int16_t *dst1, int16_t *dst2,
1051  int dstWidth, const uint8_t *src1,
1052  const uint8_t *src2, int srcW, int xInc);
1053 
1054 int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
1055  const int srcStride[], int srcSliceY, int srcSliceH,
1056  uint8_t *const dst[], const int dstStride[]);
1057 
1058 void ff_copyPlane(const uint8_t *src, int srcStride,
1059  int srcSliceY, int srcSliceH, int width,
1060  uint8_t *dst, int dstStride);
1061 
1062 static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y,
1063  int alpha, int bits, const int big_endian)
1064 {
1065  uint8_t *ptr = plane + stride * y;
1066  int v = alpha ? 0xFFFF>>(16-bits) : (1<<(bits-1));
1067  if (big_endian != HAVE_BIGENDIAN)
1068  v = av_bswap16(v);
1069  for (int i = 0; i < height; i++) {
1070  for (int j = 0; j < width; j++)
1071  AV_WN16(ptr + 2 * j, v);
1072  ptr += stride;
1073  }
1074 }
1075 
1076 static inline void fillPlane32(uint8_t *plane, int stride, int width, int height, int y,
1077  int alpha, int bits, const int big_endian, int is_float)
1078 {
1079  uint8_t *ptr = plane + stride * y;
1080  uint32_t v;
1081  uint32_t onef32 = 0x3f800000;
1082  if (is_float)
1083  v = alpha ? onef32 : 0;
1084  else
1085  v = alpha ? 0xFFFFFFFF>>(32-bits) : (1<<(bits-1));
1086  if (big_endian != HAVE_BIGENDIAN)
1087  v = av_bswap32(v);
1088 
1089  for (int i = 0; i < height; i++) {
1090  for (int j = 0; j < width; j++)
1091  AV_WN32(ptr + 4 * j, v);
1092  ptr += stride;
1093  }
1094 }
1095 
1096 
1097 #define MAX_SLICE_PLANES 4
1098 
1099 /// Slice plane
1100 typedef struct SwsPlane
1101 {
1102  int available_lines; ///< max number of lines that can be hold by this plane
1103  int sliceY; ///< index of first line
1104  int sliceH; ///< number of lines
1105  uint8_t **line; ///< line buffer
1106  uint8_t **tmp; ///< Tmp line buffer used by mmx code
1107 } SwsPlane;
1108 
1109 /**
1110  * Struct which defines a slice of an image to be scaled or an output for
1111  * a scaled slice.
1112  * A slice can also be used as intermediate ring buffer for scaling steps.
1113  */
1114 typedef struct SwsSlice
1115 {
1116  int width; ///< Slice line width
1117  int h_chr_sub_sample; ///< horizontal chroma subsampling factor
1118  int v_chr_sub_sample; ///< vertical chroma subsampling factor
1119  int is_ring; ///< flag to identify if this slice is a ring buffer
1120  int should_free_lines; ///< flag to identify if there are dynamic allocated lines
1121  enum AVPixelFormat fmt; ///< planes pixel format
1122  SwsPlane plane[MAX_SLICE_PLANES]; ///< color planes
1123 } SwsSlice;
1124 
1125 /**
1126  * Struct which holds all necessary data for processing a slice.
1127  * A processing step can be a color conversion or horizontal/vertical scaling.
1128  */
1129 typedef struct SwsFilterDescriptor
1130 {
1131  SwsSlice *src; ///< Source slice
1132  SwsSlice *dst; ///< Output slice
1133 
1134  int alpha; ///< Flag for processing alpha channel
1135  void *instance; ///< Filter instance data
1136 
1137  /// Function for processing input slice sliceH lines starting from line sliceY
1138  int (*process)(SwsInternal *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH);
1140 
1141 // warp input lines in the form (src + width*i + j) to slice format (line[i][j])
1142 // relative=true means first line src[x][0] otherwise first line is src[x][lum/crh Y]
1143 int ff_init_slice_from_src(SwsSlice * s, uint8_t *const src[4], const int stride[4],
1144  int srcW, int lumY, int lumH, int chrY, int chrH, int relative);
1145 
1146 // Initialize scaler filter descriptor chain
1148 
1149 // Free all filter data
1151 
1152 /*
1153  function for applying ring buffer logic into slice s
1154  It checks if the slice can hold more @lum lines, if yes
1155  do nothing otherwise remove @lum least used lines.
1156  It applies the same procedure for @chr lines.
1157 */
1158 int ff_rotate_slice(SwsSlice *s, int lum, int chr);
1159 
1160 /// initializes gamma conversion descriptor
1162 
1163 /// initializes lum pixel format conversion descriptor
1165 
1166 /// initializes lum horizontal scaling descriptor
1167 int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
1168 
1169 /// initializes chr pixel format conversion descriptor
1171 
1172 /// initializes chr horizontal scaling descriptor
1173 int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
1174 
1176 
1177 /// initializes vertical scaling descriptors
1179 
1180 /// setup vertical scaler functions
1182  yuv2interleavedX_fn yuv2nv12cX, yuv2packed1_fn yuv2packed1, yuv2packed2_fn yuv2packed2,
1183  yuv2packedX_fn yuv2packedX, yuv2anyX_fn yuv2anyX, int use_mmx);
1184 
1185 void ff_sws_slice_worker(void *priv, int jobnr, int threadnr,
1186  int nb_jobs, int nb_threads);
1187 
1188 int ff_swscale(SwsInternal *c, const uint8_t *const src[], const int srcStride[],
1189  int srcSliceY, int srcSliceH, uint8_t *const dst[],
1190  const int dstStride[], int dstSliceY, int dstSliceH);
1191 
1192 
1193 //number of extra lines to process
1194 #define MAX_LINES_AHEAD 4
1195 
1196 //shuffle filter and filterPos for hyScale and hcScale filters in avx2
1197 int ff_shuffle_filter_coefficients(SwsInternal *c, int* filterPos, int filterSize, int16_t *filter, int dstW);
1198 #endif /* SWSCALE_SWSCALE_INTERNAL_H */
ff_hyscale_fast_mmxext
void ff_hyscale_fast_mmxext(SwsInternal *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)
Definition: hscale_fast_bilinear_simd.c:192
isBayer
static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:855
SwsInternal::needs_hcscale
int needs_hcscale
Set if there are chroma planes to be converted.
Definition: swscale_internal.h:677
SwsInternal::greenDither
uint64_t greenDither
Definition: swscale_internal.h:521
SwsInternal::input_rgb2yuv_table
int32_t input_rgb2yuv_table[16+40 *4]
Definition: swscale_internal.h:465
yuv2planar1_fn
void(* yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Write one line of horizontally scaled data to planar output without any additional vertical scaling (...
Definition: swscale_internal.h:125
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
SwsInternal::table_rV
uint8_t * table_rV[256+2 *YUVRGB_TABLE_HEADROOM]
Definition: swscale_internal.h:462
ff_dither_8x8_128
const uint8_t ff_dither_8x8_128[9][8]
Definition: swscale.c:42
AV_PIX_FMT_BGR48LE
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:146
isPlanarRGB
static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:923
SwsPlane::sliceH
int sliceH
number of lines
Definition: swscale_internal.h:1104
SwsInternal::rgb0_scratch
uint8_t * rgb0_scratch
Definition: swscale_internal.h:682
SwsInternal::hLumFilterSize
int hLumFilterSize
Horizontal filter size for luma/alpha pixels.
Definition: swscale_internal.h:443
ff_sws_slice_worker
void ff_sws_slice_worker(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads)
Definition: swscale.c:1528
isRGB
static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:793
Half2FloatTables
Definition: half2float.h:27
isPacked
static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:900
SwsPlane::line
uint8_t ** line
line buffer
Definition: swscale_internal.h:1105
r
const char * r
Definition: vf_curves.c:127
SwsInternal::rgb0_scratch_allocated
unsigned int rgb0_scratch_allocated
Definition: swscale_internal.h:683
AV_PIX_FMT_BGRA64BE
@ AV_PIX_FMT_BGRA64BE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:204
ff_dither_8x8_220
const uint8_t ff_dither_8x8_220[9][8]
Definition: output.c:85
ff_sws_init_output_funcs
void ff_sws_init_output_funcs(SwsInternal *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, yuv2interleavedX_fn *yuv2nv12cX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX, yuv2anyX_fn *yuv2anyX)
Definition: output.c:3289
mem_internal.h
SwsInternal::lumConvertRange_coeff
uint32_t lumConvertRange_coeff
Definition: swscale_internal.h:672
SwsInternal::srcFormatBpp
int srcFormatBpp
Number of bits per pixel of the source pixel format.
Definition: swscale_internal.h:365
AV_PIX_FMT_BGR32
#define AV_PIX_FMT_BGR32
Definition: pixfmt.h:513
AV_PIX_FMT_RGB444LE
@ AV_PIX_FMT_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:136
isPlanarYUV
static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:775
SwsInternal::cascaded_tmp
uint8_t * cascaded_tmp[2][4]
Definition: swscale_internal.h:385
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3456
SwsInternal::desc
struct SwsFilterDescriptor * desc
Definition: swscale_internal.h:397
SwsInternal::formatConvBuffer
uint8_t * formatConvBuffer
Definition: swscale_internal.h:418
ff_yuv2rgb_init_tables_ppc
void ff_yuv2rgb_init_tables_ppc(SwsInternal *c, const int inv_table[4], int brightness, int contrast, int saturation)
Definition: yuv2rgb_altivec.c:638
src1
const pixel * src1
Definition: h264pred_template.c:420
SwsInternal::stride_unaligned_warned
atomic_int stride_unaligned_warned
Definition: swscale_internal.h:692
saturation
static IPT saturation(const CmsCtx *ctx, IPT ipt)
Definition: cms.c:559
ff_yuv2rgb_init_x86
SwsFunc ff_yuv2rgb_init_x86(SwsInternal *c)
Definition: yuv2rgb.c:241
int64_t
long long int64_t
Definition: coverity.c:34
RangeList::ranges_allocated
int ranges_allocated
Definition: swscale_internal.h:91
SwsInternal::lastInChrBuf
int lastInChrBuf
Last scaled horizontal chroma line from source in the ring buffer.
Definition: swscale_internal.h:415
AV_PIX_FMT_FLAG_FLOAT
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:158
SwsSlice::plane
SwsPlane plane[MAX_SLICE_PLANES]
color planes
Definition: swscale_internal.h:1122
SwsInternal::color_conversion_warned
int color_conversion_warned
Definition: swscale_internal.h:694
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
pixdesc.h
AV_PIX_FMT_RGBA64BE
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:202
ff_sws_alphablendaway
int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
Definition: alphablend.c:23
isGray
static av_always_inline int isGray(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:800
ff_rotate_slice
int ff_rotate_slice(SwsSlice *s, int lum, int chr)
Definition: slice.c:120
ff_sws_init_range_convert_aarch64
av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
Definition: swscale.c:314
SwsFilterDescriptor
Struct which holds all necessary data for processing a slice.
Definition: swscale_internal.h:1129
yuv2planeX
static void FUNC() yuv2planeX(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Definition: swscale_ppc_template.c:84
table
static const uint16_t table[]
Definition: prosumer.c:203
SwsInternal::lumToYV12
planar1_YV12_fn lumToYV12
Definition: swscale_internal.h:573
AV_PIX_FMT_MONOWHITE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:82
rgb2yuv
static const char rgb2yuv[]
Definition: vf_scale_vulkan.c:84
atomic_int
intptr_t atomic_int
Definition: stdatomic.h:55
SwsInternal::vChrFilterPos
int32_t * vChrFilterPos
Array of vertical filter starting positions for each dst[i] for chroma planes.
Definition: swscale_internal.h:442
SwsInternal::vChrFilterSize
int vChrFilterSize
Vertical filter size for chroma pixels.
Definition: swscale_internal.h:446
SwsInternal::y_temp
uint64_t y_temp
Definition: swscale_internal.h:539
AV_PIX_FMT_RGB32_1
#define AV_PIX_FMT_RGB32_1
Definition: pixfmt.h:512
ff_sws_init_swscale_vsx
void ff_sws_init_swscale_vsx(SwsInternal *c)
Definition: swscale_vsx.c:2019
ff_yuv2rgb_init_aarch64
SwsFunc ff_yuv2rgb_init_aarch64(SwsInternal *c)
Definition: swscale_unscaled.c:271
SwsInternal::uint2float_lut
float uint2float_lut[256]
Definition: swscale_internal.h:402
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
SwsInternal::cascaded_tmpStride
int cascaded_tmpStride[2][4]
Definition: swscale_internal.h:384
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
SwsInternal::esp
uint64_t esp
Definition: swscale_internal.h:535
SwsInternal::h2f_tables
Half2FloatTables * h2f_tables
Definition: swscale_internal.h:696
SwsInternal::dstW_mmx
int dstW_mmx
Definition: swscale_internal.h:534
SwsInternal::dstBpc
int dstBpc
Definition: swscale_internal.h:366
SwsInternal::lumMmxFilter
int32_t lumMmxFilter[4 *MAX_FILTER_SIZE]
Definition: swscale_internal.h:532
SwsInternal::yuv2rgb_u2b_coeff
int yuv2rgb_u2b_coeff
Definition: swscale_internal.h:492
AVSliceThread
struct AVSliceThread AVSliceThread
Definition: slicethread.h:22
SwsInternal::srcXYZ
int srcXYZ
Definition: swscale_internal.h:485
SwsInternal::hcscale_fast
void(* hcscale_fast)(SwsInternal *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)
Definition: swscale_internal.h:609
SwsInternal::table_gV
int table_gV[256+2 *YUVRGB_TABLE_HEADROOM]
Definition: swscale_internal.h:461
ff_sws_init_scale
void ff_sws_init_scale(SwsInternal *c)
Definition: swscale.c:698
AV_PIX_FMT_RGB555BE
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:114
SwsInternal::frame_dst
AVFrame * frame_dst
Definition: swscale_internal.h:375
SwsInternal::chrDstH
int chrDstH
Height of destination chroma planes.
Definition: swscale_internal.h:361
SwsInternal::dither32
uint32_t dither32[8]
Definition: swscale_internal.h:547
SwsSlice::fmt
enum AVPixelFormat fmt
planes pixel format
Definition: swscale_internal.h:1121
SwsFilterDescriptor::src
SwsSlice * src
Source slice.
Definition: swscale_internal.h:1131
ff_sws_init_single_context
int ff_sws_init_single_context(SwsContext *sws, SwsFilter *srcFilter, SwsFilter *dstFilter)
Definition: utils.c:1121
Range::start
unsigned int start
Definition: swscale_internal.h:84
SwsInternal::chrDstW
int chrDstW
Width of destination chroma planes.
Definition: swscale_internal.h:360
SwsInternal::chrMmxextFilterCode
uint8_t * chrMmxextFilterCode
Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
Definition: swscale_internal.h:452
SwsInternal::use_mmx_vfilter
int use_mmx_vfilter
Definition: swscale_internal.h:551
SwsInternal::hLumFilter
int16_t * hLumFilter
Array of horizontal filter coefficients for luma/alpha planes.
Definition: swscale_internal.h:435
is16BPS
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:740
SwsFilterDescriptor::instance
void * instance
Filter instance data.
Definition: swscale_internal.h:1135
ff_sws_init_input_funcs
void ff_sws_init_input_funcs(SwsInternal *c, planar1_YV12_fn *lumToYV12, planar1_YV12_fn *alpToYV12, planar2_YV12_fn *chrToYV12, planarX_YV12_fn *readLumPlanar, planarX_YV12_fn *readAlpPlanar, planarX2_YV12_fn *readChrPlanar)
SwsInternal::vRounder
uint64_t vRounder
Definition: swscale_internal.h:536
ff_sws_init_swscale_x86
void ff_sws_init_swscale_x86(SwsInternal *c)
Definition: swscale.c:490
SwsInternal::table_gU
uint8_t * table_gU[256+2 *YUVRGB_TABLE_HEADROOM]
Definition: swscale_internal.h:463
SwsInternal::inv_gamma
uint16_t * inv_gamma
Definition: swscale_internal.h:391
SwsInternal::slicethread
AVSliceThread * slicethread
Definition: swscale_internal.h:341
SwsInternal::input_opaque
void * input_opaque
Opaque data pointer passed to all input functions.
Definition: swscale_internal.h:571
AV_PIX_FMT_FLAG_HWACCEL
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:128
SwsInternal::uOffset
uint64_t uOffset
Definition: swscale_internal.h:530
SwsInternal::readAlpPlanar
planarX_YV12_fn readAlpPlanar
Definition: swscale_internal.h:583
Range::len
unsigned int len
Definition: swscale_internal.h:85
ff_dither_2x2_8
const uint8_t ff_dither_2x2_8[3][8]
Definition: output.c:46
SwsInternal::frame_src
AVFrame * frame_src
Definition: swscale_internal.h:374
ff_sws_init_range_convert_loongarch
av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c)
Definition: swscale_init_loongarch.c:27
SwsInternal::yuv2rgb_v2g_coeff
int yuv2rgb_v2g_coeff
Definition: swscale_internal.h:490
ff_sws_init_xyzdsp_aarch64
av_cold void ff_sws_init_xyzdsp_aarch64(SwsInternal *c)
Definition: swscale.c:339
isNBPS
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:754
SwsFilterDescriptor::process
int(* process)(SwsInternal *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH)
Function for processing input slice sliceH lines starting from line sliceY.
Definition: swscale_internal.h:1138
SwsSlice::h_chr_sub_sample
int h_chr_sub_sample
horizontal chroma subsampling factor
Definition: swscale_internal.h:1117
SwsInternal::yuvTable
void * yuvTable
Definition: swscale_internal.h:458
SwsInternal::dstColorspaceTable
int dstColorspaceTable[4]
Definition: swscale_internal.h:482
ff_hyscale_fast_c
void ff_hyscale_fast_c(SwsInternal *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)
Definition: hscale_fast_bilinear.c:23
ff_dither4
const uint64_t ff_dither4[2]
Definition: swscale.c:33
ff_dither_8x8_73
const uint8_t ff_dither_8x8_73[9][8]
Definition: output.c:72
SwsInternal::opts
SwsContext opts
Definition: swscale_internal.h:336
SwsColorFunc
void(* SwsColorFunc)(const SwsInternal *c, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: swscale_internal.h:100
MAX_FILTER_SIZE
#define MAX_FILTER_SIZE
Definition: swscale_internal.h:54
AV_PIX_FMT_BGR8
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:90
avassert.h
SwsInternal::xyz_scratch
uint8_t * xyz_scratch
Definition: swscale_internal.h:688
SwsInternal::pal_rgb
uint32_t pal_rgb[256]
Definition: swscale_internal.h:400
SwsColorXform::gamma
SwsLuts gamma
Definition: swscale_internal.h:109
av_cold
#define av_cold
Definition: attributes.h:106
SwsInternal::src_ranges
RangeList src_ranges
Definition: swscale_internal.h:377
ff_shuffle_filter_coefficients
int ff_shuffle_filter_coefficients(SwsInternal *c, int *filterPos, int filterSize, int16_t *filter, int dstW)
Definition: utils.c:97
YUVRGB_TABLE_HEADROOM
#define YUVRGB_TABLE_HEADROOM
Definition: swscale_internal.h:51
yuv2packed2_fn
void(* yuv2packed2_fn)(SwsInternal *c, const int16_t *lumSrc[2], const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing bilinear scalin...
Definition: swscale_internal.h:231
SwsInternal::slice_err
int * slice_err
Definition: swscale_internal.h:343
SwsInternal::brightness
int brightness
Definition: swscale_internal.h:480
SwsInternal::redDither
uint64_t redDither
Definition: swscale_internal.h:520
SwsInternal::nb_slice_ctx
int nb_slice_ctx
Definition: swscale_internal.h:344
intreadwrite.h
dither
static const uint16_t dither[8][8]
Definition: vf_gradfun.c:46
SwsInternal::slice_ctx
SwsContext ** slice_ctx
Definition: swscale_internal.h:342
s
#define s(width, name)
Definition: cbs_vp9.c:198
SwsInternal::alpToYV12
planar1_YV12_fn alpToYV12
Definition: swscale_internal.h:574
ff_dither_8x8_32
const uint8_t ff_dither_8x8_32[9][8]
Definition: output.c:60
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
SwsInternal::cascaded_context
SwsContext * cascaded_context[3]
Definition: swscale_internal.h:383
SwsSlice::width
int width
Slice line width.
Definition: swscale_internal.h:1116
SwsInternal::hw_priv
void * hw_priv
Definition: swscale_internal.h:699
SwsInternal::ugCoeff
uint64_t ugCoeff
Definition: swscale_internal.h:528
bits
uint8_t bits
Definition: vp3data.h:128
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:42
ff_yuv2rgb_c_init_tables
int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
SwsPlane::tmp
uint8_t ** tmp
Tmp line buffer used by mmx code.
Definition: swscale_internal.h:1106
ff_get_unscaled_swscale
void ff_get_unscaled_swscale(SwsInternal *c)
Set c->convert_unscaled to an unscaled converter if one exists for the specific source and destinatio...
Definition: swscale_unscaled.c:2377
AV_PIX_FMT_FLAG_ALPHA
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:147
SwsInternal::dither_error
int * dither_error[4]
Definition: swscale_internal.h:477
ff_sws_context_class
const AVClass ff_sws_context_class
Definition: options.c:98
AV_PIX_FMT_RGB4
@ AV_PIX_FMT_RGB4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:94
SwsInternal::lumMmxextFilterCode
uint8_t * lumMmxextFilterCode
Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
Definition: swscale_internal.h:451
ff_sws_init_swscale_aarch64
void ff_sws_init_swscale_aarch64(SwsInternal *c)
Definition: swscale.c:350
SwsInternal::contrast
int contrast
Definition: swscale_internal.h:480
AV_PIX_FMT_BGR32_1
#define AV_PIX_FMT_BGR32_1
Definition: pixfmt.h:514
SwsInternal::vLumFilterSize
int vLumFilterSize
Vertical filter size for luma/alpha pixels.
Definition: swscale_internal.h:445
ff_sws_init_swscale_loongarch
void ff_sws_init_swscale_loongarch(SwsInternal *c)
Definition: swscale_init_loongarch.c:62
SwsInternal::chrSrcH
int chrSrcH
Height of source chroma planes.
Definition: swscale_internal.h:359
ff_sws_init_range_convert
av_cold void ff_sws_init_range_convert(SwsInternal *c)
Definition: swscale.c:627
ff_init_hscaler_mmxext
int ff_init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode, int16_t *filter, int32_t *filterPos, int numSplits)
Definition: hscale_fast_bilinear_simd.c:30
SwsInternal::chrConvertRange
void(* chrConvertRange)(int16_t *dst1, int16_t *dst2, int width, uint32_t coeff, int64_t offset)
Definition: swscale_internal.h:668
SwsInternal::yuv2anyX
yuv2anyX_fn yuv2anyX
Definition: swscale_internal.h:568
isSemiPlanarYUV
static av_always_inline int isSemiPlanarYUV(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:786
ff_hcscale_fast_mmxext
void ff_hcscale_fast_mmxext(SwsInternal *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)
Definition: hscale_fast_bilinear_simd.c:282
SwsInternal::chrConvertRange_coeff
uint32_t chrConvertRange_coeff
Definition: swscale_internal.h:673
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:113
ff_yuv2rgb_init_ppc
SwsFunc ff_yuv2rgb_init_ppc(SwsInternal *c)
Definition: yuv2rgb_altivec.c:567
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
ff_init_slice_from_src
int ff_init_slice_from_src(SwsSlice *s, uint8_t *const src[4], const int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative)
Definition: slice.c:148
SwsInternal::srcBpc
int srcBpc
Definition: swscale_internal.h:366
SwsInternal::dither16
uint16_t dither16[8]
Definition: swscale_internal.h:546
planarX_YV12_fn
void(* planarX_YV12_fn)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opaque)
Unscaled conversion of arbitrary planar data (e.g.
Definition: swscale_internal.h:323
isFloat16
static av_always_inline int isFloat16(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:884
SwsPlane::available_lines
int available_lines
max number of lines that can be hold by this plane
Definition: swscale_internal.h:1102
SwsInternal::uv_off
ptrdiff_t uv_off
offset (in pixels) between u and v planes
Definition: swscale_internal.h:544
AV_PIX_FMT_RGB48LE
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:110
SwsInternal::hyScale
void(* hyScale)(SwsInternal *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Scale one horizontal line of input data using a filter over the input lines, to produce one (differen...
Definition: swscale_internal.h:646
SwsInternal::chrXInc
int chrXInc
Definition: swscale_internal.h:362
AV_PIX_FMT_MONOBLACK
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:83
RangeList
Definition: swscale_internal.h:88
SwsInternal::chrMmxextFilterCodeSize
int chrMmxextFilterCodeSize
Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
Definition: swscale_internal.h:450
ff_sws_init_swscale_riscv
void ff_sws_init_swscale_riscv(SwsInternal *c)
Definition: swscale.c:74
AV_PIX_FMT_BGR565LE
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:118
AV_PIX_FMT_RGBA64LE
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:203
SwsInternal::saturation
int saturation
Definition: swscale_internal.h:480
SwsPlane
Slice plane.
Definition: swscale_internal.h:1100
RangeList::nb_ranges
unsigned int nb_ranges
Definition: swscale_internal.h:90
ff_get_unscaled_swscale_ppc
void ff_get_unscaled_swscale_ppc(SwsInternal *c)
Definition: yuv2yuv_altivec.c:188
planarX2_YV12_fn
void(* planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opaque)
Definition: swscale_internal.h:326
ff_init_desc_hscale
int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int *filter_pos, int filter_size, int xInc)
initializes lum horizontal scaling descriptor
Definition: hscale.c:146
SwsInternal::readLumPlanar
planarX_YV12_fn readLumPlanar
Functions to read planar input, such as planar RGB, and convert internally to Y/UV/A.
Definition: swscale_internal.h:582
SwsInternal::canMMXEXTBeUsed
int canMMXEXTBeUsed
Definition: swscale_internal.h:454
SwsInternal::lastInLumBuf
int lastInLumBuf
Last scaled horizontal luma/alpha line from source in the ring buffer.
Definition: swscale_internal.h:414
ff_sws_init_range_convert_x86
av_cold void ff_sws_init_range_convert_x86(SwsInternal *c)
Definition: swscale.c:474
SwsInternal::slice
struct SwsSlice * slice
Definition: swscale_internal.h:396
AV_PIX_FMT_RGB8
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
Definition: pixfmt.h:93
SwsInternal::chrMmxFilter
int32_t chrMmxFilter[4 *MAX_FILTER_SIZE]
Definition: swscale_internal.h:533
AV_PIX_FMT_BGR4
@ AV_PIX_FMT_BGR4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:91
ff_yuv2rgb_init_loongarch
SwsFunc ff_yuv2rgb_init_loongarch(SwsInternal *c)
Definition: swscale_init_loongarch.c:110
SwsInternal::lumXInc
int lumXInc
Definition: swscale_internal.h:362
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PIX_FMT_BGR555BE
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:119
planar2_YV12_fn
void(* planar2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opaque)
Unscaled conversion of chroma plane to YV12 for horizontal scaler.
Definition: swscale_internal.h:315
SwsInternal::dstXYZ
int dstXYZ
Definition: swscale_internal.h:486
ff_init_desc_no_chr
int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst)
Definition: hscale.c:284
Range
Definition: vf_colorbalance.c:37
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
SwsInternal::dstY
int dstY
Last destination vertical line output from last slice.
Definition: swscale_internal.h:457
SwsInternal::yuv2packed2
yuv2packed2_fn yuv2packed2
Definition: swscale_internal.h:566
AV_PIX_FMT_BGR4_BYTE
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:92
ff_range_add
int ff_range_add(RangeList *r, unsigned int start, unsigned int len)
Definition: utils.c:2392
isDataInHighBits
static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:949
ff_sws_init_xyzdsp
av_cold void ff_sws_init_xyzdsp(SwsInternal *c)
Definition: swscale.c:864
yuv2packedX_fn
void(* yuv2packedX_fn)(SwsInternal *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing multi-point ver...
Definition: swscale_internal.h:263
SwsInternal::needAlpha
int needAlpha
Definition: swscale_internal.h:419
relative
static IPT relative(const CmsCtx *ctx, IPT ipt)
Definition: cms.c:544
isBE
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:761
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
SwsInternal::parent
SwsContext * parent
Definition: swscale_internal.h:339
SwsInternal::xyz_scratch_allocated
unsigned int xyz_scratch_allocated
Definition: swscale_internal.h:689
SwsInternal::xyz12Torgb48
SwsColorFunc xyz12Torgb48
Definition: swscale_internal.h:556
height
#define height
Definition: dsp.h:89
SwsInternal::yuv2rgb_v2r_coeff
int yuv2rgb_v2r_coeff
Definition: swscale_internal.h:489
SwsFilterDescriptor::dst
SwsSlice * dst
Output slice.
Definition: swscale_internal.h:1132
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:104
ff_sws_init_swscale_ppc
void ff_sws_init_swscale_ppc(SwsInternal *c)
Definition: swscale_altivec.c:233
AV_WN32
#define AV_WN32(p, v)
Definition: intreadwrite.h:372
SwsInternal::yCoeff
uint64_t yCoeff
Definition: swscale_internal.h:524
AV_PIX_FMT_FLAG_RGB
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:136
fillPlane16
static void fillPlane16(uint8_t *plane, int stride, int width, int height, int y, int alpha, int bits, const int big_endian)
Definition: swscale_internal.h:1062
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
usePal
static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:931
av_bswap32
#define av_bswap32
Definition: bswap.h:47
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
isAnyRGB
static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:869
AV_PIX_FMT_RGB444BE
@ AV_PIX_FMT_RGB444BE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:137
SwsInternal::yuv2rgb_y_coeff
int yuv2rgb_y_coeff
Definition: swscale_internal.h:488
SwsInternal::data_unaligned_warned
atomic_int data_unaligned_warned
Definition: swscale_internal.h:693
planar1_YV12_fn
void(* planar1_YV12_fn)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opaque)
Unscaled conversion of luma/alpha plane to YV12 for horizontal scaler.
Definition: swscale_internal.h:308
ff_init_desc_chscale
int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int *filter_pos, int filter_size, int xInc)
initializes chr horizontal scaling descriptor
Definition: hscale.c:253
isYUV
static av_always_inline int isYUV(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:768
AV_PIX_FMT_FLAG_BITSTREAM
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:124
ff_init_desc_cfmt_convert
int ff_init_desc_cfmt_convert(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint32_t *pal)
initializes chr pixel format conversion descriptor
Definition: hscale.c:238
ff_init_vscale
int ff_init_vscale(SwsInternal *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst)
initializes vertical scaling descriptors
Definition: vscale.c:214
ff_swscale
int ff_swscale(SwsInternal *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[], int dstSliceY, int dstSliceH)
Definition: swscale.c:263
frame.h
AV_PIX_FMT_BGR444BE
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:139
SwsInternal::rgb48Toxyz12
SwsColorFunc rgb48Toxyz12
Definition: swscale_internal.h:557
SwsFilter
Definition: swscale.h:413
SwsLuts
Definition: swscale_internal.h:103
is32BPS
static av_always_inline int is32BPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:747
AV_PIX_FMT_RGB32
#define AV_PIX_FMT_RGB32
Definition: pixfmt.h:511
SwsInternal::hChrFilterSize
int hChrFilterSize
Horizontal filter size for chroma pixels.
Definition: swscale_internal.h:444
isBGRinInt
static av_always_inline int isBGRinInt(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:833
SwsInternal::sliceDir
int sliceDir
Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top).
Definition: swscale_internal.h:372
isSwappedChroma
static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:968
AV_PIX_FMT_BGR565BE
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:117
offset
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 offset
Definition: writing_filters.txt:86
ff_free_filters
int ff_free_filters(SwsInternal *c)
Definition: slice.c:386
ff_init_filters
int ff_init_filters(SwsInternal *c)
Definition: slice.c:246
SwsInternal::is_internal_gamma
int is_internal_gamma
Definition: swscale_internal.h:389
SwsInternal::yuv2packed1
yuv2packed1_fn yuv2packed1
Definition: swscale_internal.h:565
fillPlane32
static void fillPlane32(uint8_t *plane, int stride, int width, int height, int y, int alpha, int bits, const int big_endian, int is_float)
Definition: swscale_internal.h:1076
slicethread.h
half2float.h
SwsInternal::u_temp
uint64_t u_temp
Definition: swscale_internal.h:537
AV_PIX_FMT_FLAG_BAYER
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:152
ff_init_gamma_convert
int ff_init_gamma_convert(SwsFilterDescriptor *desc, SwsSlice *src, uint16_t *table)
initializes gamma conversion descriptor
Definition: gamma.c:59
SwsInternal::dstFormatBpp
int dstFormatBpp
Number of bits per pixel of the destination pixel format.
Definition: swscale_internal.h:364
yuv2anyX_fn
void(* yuv2anyX_fn)(SwsInternal *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t **dest, int dstW, int y)
Write one line of horizontally scaled Y/U/V/A to YUV/RGB output by doing multi-point vertical scaling...
Definition: swscale_internal.h:297
SwsInternal::hLumFilterPos
int32_t * hLumFilterPos
Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.
Definition: swscale_internal.h:439
AV_PIX_FMT_BGRA64LE
@ AV_PIX_FMT_BGRA64LE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:205
SwsInternal::alpMmxFilter
int32_t alpMmxFilter[4 *MAX_FILTER_SIZE]
Definition: swscale_internal.h:540
SwsInternal::vChrDrop
int vChrDrop
Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user...
Definition: swscale_internal.h:371
SwsInternal::vrCoeff
uint64_t vrCoeff
Definition: swscale_internal.h:525
SwsInternal::dst_slice_align
unsigned int dst_slice_align
Definition: swscale_internal.h:691
sws
static SwsContext * sws[3]
Definition: swscale.c:73
SwsInternal::yOffset
uint64_t yOffset
Definition: swscale_internal.h:529
AV_PIX_FMT_RGB555LE
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:115
SwsInternal::yuv2rgb_u2g_coeff
int yuv2rgb_u2g_coeff
Definition: swscale_internal.h:491
SwsInternal::numDesc
int numDesc
Definition: swscale_internal.h:393
AV_PIX_FMT_RGB48BE
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:109
ff_yuv2rgb_coeffs
const int32_t ff_yuv2rgb_coeffs[11][4]
Definition: yuv2rgb.c:47
log.h
SwsInternal::yuv2planeX
yuv2planarX_fn yuv2planeX
Definition: swscale_internal.h:563
ff_copyPlane
void ff_copyPlane(const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride)
Definition: swscale_unscaled.c:125
SwsInternal::chrDstHSubSample
int chrDstHSubSample
Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination...
Definition: swscale_internal.h:369
src2
const pixel * src2
Definition: h264pred_template.c:421
SwsInternal::yuv2rgb_y_offset
int yuv2rgb_y_offset
Definition: swscale_internal.h:487
SwsInternal::v_temp
uint64_t v_temp
Definition: swscale_internal.h:538
SwsInternal::cascaded_mainindex
int cascaded_mainindex
Definition: swscale_internal.h:386
common.h
SwsSlice::should_free_lines
int should_free_lines
flag to identify if there are dynamic allocated lines
Definition: swscale_internal.h:1120
av_always_inline
#define av_always_inline
Definition: attributes.h:63
yuv2interleavedX_fn
void(* yuv2interleavedX_fn)(enum AVPixelFormat dstFormat, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int dstW)
Write one line of horizontally scaled chroma to interleaved output with multi-point vertical scaling ...
Definition: swscale_internal.h:161
graph.h
AV_PIX_FMT_FLAG_BE
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:116
SwsSlice::is_ring
int is_ring
flag to identify if this slice is a ring buffer
Definition: swscale_internal.h:1119
SwsInternal::ubCoeff
uint64_t ubCoeff
Definition: swscale_internal.h:526
SwsInternal::lumConvertRange
void(* lumConvertRange)(int16_t *dst, int width, uint32_t coeff, int64_t offset)
Color range conversion functions if needed.
Definition: swscale_internal.h:666
len
int len
Definition: vorbis_enc_data.h:426
ff_updateMMXDitherTables
void ff_updateMMXDitherTables(SwsInternal *c, int dstY)
SwsSlice::v_chr_sub_sample
int v_chr_sub_sample
vertical chroma subsampling factor
Definition: swscale_internal.h:1118
AV_PIX_FMT_RGB4_BYTE
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:95
SwsInternal::chrYInc
int chrYInc
Definition: swscale_internal.h:363
SwsSlice
Struct which defines a slice of an image to be scaled or an output for a scaled slice.
Definition: swscale_internal.h:1114
ff_sws_init_altivec_bufs
int ff_sws_init_altivec_bufs(SwsInternal *c)
isFloat
static av_always_inline int isFloat(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:877
RangeList::ranges
Range * ranges
Definition: swscale_internal.h:89
SwsInternal::chrDstVSubSample
int chrDstVSubSample
Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination i...
Definition: swscale_internal.h:370
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:84
yuv2packed1_fn
void(* yuv2packed1_fn)(SwsInternal *c, const int16_t *lumSrc, const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc, uint8_t *dest, int dstW, int uvalpha, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output without any additional v...
Definition: swscale_internal.h:198
SwsInternal::vLumFilter
int16_t * vLumFilter
Array of vertical filter coefficients for luma/alpha planes.
Definition: swscale_internal.h:437
SwsFilterDescriptor::alpha
int alpha
Flag for processing alpha channel.
Definition: swscale_internal.h:1134
SwsInternal
Definition: swscale_internal.h:334
SwsColorXform::mat
int16_t mat[3][3]
Definition: swscale_internal.h:110
pixfmt.h
ff_dither8
const uint64_t ff_dither8[2]
Definition: swscale.c:37
ff_sws_init_swscale_arm
void ff_sws_init_swscale_arm(SwsInternal *c)
Definition: swscale.c:33
SwsInternal::vLumFilterPos
int32_t * vLumFilterPos
Array of vertical filter starting positions for each dst[i] for luma/alpha planes.
Definition: swscale_internal.h:441
SwsInternal::rgb2xyz
SwsColorXform rgb2xyz
Definition: swscale_internal.h:559
yuv2planarX_fn
void(* yuv2planarX_fn)(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Write one line of horizontally scaled data to planar output with multi-point vertical scaling between...
Definition: swscale_internal.h:141
SwsInternal::chrDither8
const uint8_t * chrDither8
Definition: swscale_internal.h:549
SwsInternal::table_bU
uint8_t * table_bU[256+2 *YUVRGB_TABLE_HEADROOM]
Definition: swscale_internal.h:464
SwsInternal::convert_unscaled
SwsFunc convert_unscaled
Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be fre...
Definition: swscale_internal.h:357
SwsInternal::hyscale_fast
void(* hyscale_fast)(SwsInternal *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)
Scale one horizontal line of input data using a bilinear filter to produce one line of output data.
Definition: swscale_internal.h:606
MAX_SLICE_PLANES
#define MAX_SLICE_PLANES
Definition: swscale_internal.h:1097
SwsInternal::src0Alpha
int src0Alpha
Definition: swscale_internal.h:483
ff_init_vscale_pfn
void ff_init_vscale_pfn(SwsInternal *c, yuv2planar1_fn yuv2plane1, yuv2planarX_fn yuv2planeX, yuv2interleavedX_fn yuv2nv12cX, yuv2packed1_fn yuv2packed1, yuv2packed2_fn yuv2packed2, yuv2packedX_fn yuv2packedX, yuv2anyX_fn yuv2anyX, int use_mmx)
setup vertical scaler functions
Definition: vscale.c:258
isPackedRGB
static av_always_inline int isPackedRGB(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:916
ff_sws_fill_xyztables
av_cold int ff_sws_fill_xyztables(SwsInternal *c)
Definition: utils.c:735
SwsInternal::xyz2rgb
SwsColorXform xyz2rgb
Definition: swscale_internal.h:558
SwsLuts::out
uint16_t * out
Definition: swscale_internal.h:105
SwsInternal::chrSrcHSubSample
int chrSrcHSubSample
Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source imag...
Definition: swscale_internal.h:367
SwsInternal::blueDither
uint64_t blueDither
Definition: swscale_internal.h:522
AV_PIX_FMT_FLAG_PLANAR
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:132
ff_get_unscaled_swscale_aarch64
void ff_get_unscaled_swscale_aarch64(SwsInternal *c)
Definition: swscale_unscaled.c:264
SwsInternal::descIndex
int descIndex[2]
Definition: swscale_internal.h:394
AV_PIX_FMT_RGB565BE
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:112
SwsInternal::hChrFilterPos
int32_t * hChrFilterPos
Array of horizontal filter starting positions for each dst[i] for chroma planes.
Definition: swscale_internal.h:440
SwsInternal::warned_unuseable_bilinear
int warned_unuseable_bilinear
Definition: swscale_internal.h:455
ff_yuv2rgb_get_func_ptr
SwsFunc ff_yuv2rgb_get_func_ptr(SwsInternal *c)
SwsInternal::gamma
uint16_t * gamma
Definition: swscale_internal.h:390
SwsInternal::numSlice
int numSlice
Definition: swscale_internal.h:395
desc
const char * desc
Definition: libsvtav1.c:82
DITHER32_INT
#define DITHER32_INT
Definition: swscale_internal.h:518
SwsInternal::vChrFilter
int16_t * vChrFilter
Array of vertical filter coefficients for chroma planes.
Definition: swscale_internal.h:438
SwsInternal::graph
SwsGraph * graph[2]
Definition: swscale_internal.h:347
SwsInternal::pal_yuv
uint32_t pal_yuv[256]
Definition: swscale_internal.h:399
isBayer16BPS
static av_always_inline int isBayer16BPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:862
SwsInternal::chrSrcVSubSample
int chrSrcVSubSample
Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image.
Definition: swscale_internal.h:368
SwsInternal::dst0Alpha
int dst0Alpha
Definition: swscale_internal.h:484
SwsPlane::sliceY
int sliceY
index of first line
Definition: swscale_internal.h:1103
SwsInternal::dst_slice_height
int dst_slice_height
Definition: swscale_internal.h:351
SwsGraph
Filter graph, which represents a 'baked' pixel format conversion.
Definition: graph.h:103
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
w
uint8_t w
Definition: llvidencdsp.c:39
AV_PIX_FMT_BGR555LE
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:120
SwsInternal::readChrPlanar
planarX2_YV12_fn readChrPlanar
Definition: swscale_internal.h:584
SwsInternal::yuv2plane1
yuv2planar1_fn yuv2plane1
Definition: swscale_internal.h:562
lum
static double lum(void *priv, double x, double y, int plane)
Definition: vf_fftfilt.c:107
alpha
static const int16_t alpha[]
Definition: ilbcdata.h:55
SwsInternal::chrToYV12
planar2_YV12_fn chrToYV12
Definition: swscale_internal.h:575
SwsFunc
int(* SwsFunc)(SwsInternal *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
Definition: swscale_internal.h:96
isRGBinInt
static av_always_inline int isRGBinInt(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:811
SwsInternal::dst_slice_start
int dst_slice_start
Definition: swscale_internal.h:350
ff_sws_init_range_convert_riscv
av_cold void ff_sws_init_range_convert_riscv(SwsInternal *c)
Definition: swscale.c:29
ff_sws_free_altivec_bufs
void ff_sws_free_altivec_bufs(SwsInternal *c)
int32_t
int32_t
Definition: audioconvert.c:56
SwsInternal::lumConvertRange_offset
int64_t lumConvertRange_offset
Definition: swscale_internal.h:674
SwsInternal::hcScale
void(* hcScale)(SwsInternal *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale_internal.h:649
coeff
static const double coeff[2][5]
Definition: vf_owdenoise.c:80
SwsColorXform
Definition: swscale_internal.h:108
sws_internal
static SwsInternal * sws_internal(const SwsContext *sws)
Definition: swscale_internal.h:78
SwsInternal::srcColorspaceTable
int srcColorspaceTable[4]
Definition: swscale_internal.h:481
ff_init_desc_fmt_convert
int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint32_t *pal)
initializes lum pixel format conversion descriptor
Definition: hscale.c:129
h
h
Definition: vp9dsp_template.c:2070
SwsInternal::lumMmxextFilterCodeSize
int lumMmxextFilterCodeSize
Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
Definition: swscale_internal.h:449
stride
#define stride
Definition: h264pred_template.c:536
isPlanar
static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:909
SwsInternal::vgCoeff
uint64_t vgCoeff
Definition: swscale_internal.h:527
width
#define width
Definition: dsp.h:89
ff_get_unscaled_swscale_arm
void ff_get_unscaled_swscale_arm(SwsInternal *c)
Definition: swscale_unscaled.c:185
av_bswap16
#define av_bswap16
Definition: bswap.h:28
SwsContext
Main external API structure.
Definition: swscale.h:191
AV_PIX_FMT_FLAG_PAL
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:120
AV_PIX_FMT_BGR444LE
@ AV_PIX_FMT_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:138
SwsInternal::chrSrcW
int chrSrcW
Width of source chroma planes.
Definition: swscale_internal.h:358
ff_update_palette
void ff_update_palette(SwsInternal *c, const uint32_t *pal)
Definition: swscale.c:874
SwsLuts::in
uint16_t * in
Definition: swscale_internal.h:104
SwsInternal::yuv2nv12cX
yuv2interleavedX_fn yuv2nv12cX
Definition: swscale_internal.h:564
SwsInternal::lumDither8
const uint8_t * lumDither8
Definition: swscale_internal.h:549
SwsInternal::lumYInc
int lumYInc
Definition: swscale_internal.h:363
SwsInternal::gamma_value
double gamma_value
Definition: swscale_internal.h:388
ff_dither_4x4_16
const uint8_t ff_dither_4x4_16[5][8]
Definition: output.c:52
ff_hcscale_fast_c
void ff_hcscale_fast_c(SwsInternal *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)
Definition: hscale_fast_bilinear.c:38
SwsInternal::uv_offx2
ptrdiff_t uv_offx2
offset (in bytes) between u and v planes
Definition: swscale_internal.h:545
src
#define src
Definition: vp8dsp.c:248
swscale.h
SwsInternal::chrConvertRange_offset
int64_t chrConvertRange_offset
Definition: swscale_internal.h:675
ff_dither_2x2_4
const uint8_t ff_dither_2x2_4[3][8]
Definition: output.c:40
SwsInternal::yuv2packedX
yuv2packedX_fn yuv2packedX
Definition: swscale_internal.h:567
isALPHA
static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:891
SwsInternal::hChrFilter
int16_t * hChrFilter
Array of horizontal filter coefficients for chroma planes.
Definition: swscale_internal.h:436
SwsInternal::vOffset
uint64_t vOffset
Definition: swscale_internal.h:531
AV_PIX_FMT_BGR48BE
@ AV_PIX_FMT_BGR48BE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:145
AV_WN16
#define AV_WN16(p, v)
Definition: intreadwrite.h:368