46
49
# define APCK_COEF 16
47
50
# define APCK_SIZE 24
51
54
# define APCK_SIZE 16
56
typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
59
typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
57
60
int srcStride[], int srcSliceY, int srcSliceH,
58
uint8_t* dst[], int dstStride[]);
60
typedef void (*yuv2planar1_fn) (struct SwsContext *c,
61
const int16_t *lumSrc, const int16_t *chrUSrc,
62
const int16_t *chrVSrc, const int16_t *alpSrc,
64
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
65
int dstW, int chrDstW);
66
typedef void (*yuv2planarX_fn) (struct SwsContext *c,
67
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
68
const int16_t *chrFilter, const int16_t **chrUSrc,
69
const int16_t **chrVSrc, int chrFilterSize,
70
const int16_t **alpSrc,
72
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
73
int dstW, int chrDstW);
74
typedef void (*yuv2packed1_fn) (struct SwsContext *c,
76
const uint16_t *ubuf0, const uint16_t *ubuf1,
77
const uint16_t *vbuf0, const uint16_t *vbuf1,
78
const uint16_t *abuf0,
80
int dstW, int uvalpha, int dstFormat, int flags, int y);
81
typedef void (*yuv2packed2_fn) (struct SwsContext *c,
82
const uint16_t *buf0, const uint16_t *buf1,
83
const uint16_t *ubuf0, const uint16_t *ubuf1,
84
const uint16_t *vbuf0, const uint16_t *vbuf1,
85
const uint16_t *abuf0, const uint16_t *abuf1,
87
int dstW, int yalpha, int uvalpha, int y);
88
typedef void (*yuv2packedX_fn) (struct SwsContext *c,
89
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
90
const int16_t *chrFilter, const int16_t **chrUSrc,
91
const int16_t **chrVSrc, int chrFilterSize,
92
const int16_t **alpSrc, uint8_t *dest,
61
uint8_t *dst[], int dstStride[]);
64
* Write one line of horizontally scaled data to planar output
65
* without any additional vertical scaling (or point-scaling).
67
* @param src scaled source data, 15bit for 8-10bit output,
68
* 19-bit for 16bit output (in int32_t)
69
* @param dest pointer to the output plane. For >8bit
70
* output, this is in uint16_t
71
* @param dstW width of destination in pixels
72
* @param dither ordered dither array of type int16_t and size 8
73
* @param offset Dither offset
75
typedef void (*yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW,
76
const uint8_t *dither, int offset);
79
* Write one line of horizontally scaled data to planar output
80
* with multi-point vertical scaling between input pixels.
82
* @param filter vertical luma/alpha scaling coefficients, 12bit [0,4096]
83
* @param src scaled luma (Y) or alpha (A) source data, 15bit for 8-10bit output,
84
* 19-bit for 16bit output (in int32_t)
85
* @param filterSize number of vertical input lines to scale
86
* @param dest pointer to output plane. For >8bit
87
* output, this is in uint16_t
88
* @param dstW width of destination pixels
89
* @param offset Dither offset
91
typedef void (*yuv2planarX_fn)(const int16_t *filter, int filterSize,
92
const int16_t **src, uint8_t *dest, int dstW,
93
const uint8_t *dither, int offset);
96
* Write one line of horizontally scaled chroma to interleaved output
97
* with multi-point vertical scaling between input pixels.
99
* @param c SWS scaling context
100
* @param chrFilter vertical chroma scaling coefficients, 12bit [0,4096]
101
* @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
102
* 19-bit for 16bit output (in int32_t)
103
* @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
104
* 19-bit for 16bit output (in int32_t)
105
* @param chrFilterSize number of vertical chroma input lines to scale
106
* @param dest pointer to the output plane. For >8bit
107
* output, this is in uint16_t
108
* @param dstW width of chroma planes
110
typedef void (*yuv2interleavedX_fn)(struct SwsContext *c,
111
const int16_t *chrFilter,
113
const int16_t **chrUSrc,
114
const int16_t **chrVSrc,
115
uint8_t *dest, int dstW);
118
* Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
119
* output without any additional vertical scaling (or point-scaling). Note
120
* that this function may do chroma scaling, see the "uvalpha" argument.
122
* @param c SWS scaling context
123
* @param lumSrc scaled luma (Y) source data, 15bit for 8-10bit output,
124
* 19-bit for 16bit output (in int32_t)
125
* @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
126
* 19-bit for 16bit output (in int32_t)
127
* @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
128
* 19-bit for 16bit output (in int32_t)
129
* @param alpSrc scaled alpha (A) source data, 15bit for 8-10bit output,
130
* 19-bit for 16bit output (in int32_t)
131
* @param dest pointer to the output plane. For 16bit output, this is
133
* @param dstW width of lumSrc and alpSrc in pixels, number of pixels
134
* to write into dest[]
135
* @param uvalpha chroma scaling coefficient for the second line of chroma
136
* pixels, either 2048 or 0. If 0, one chroma input is used
137
* for 2 output pixels (or if the SWS_FLAG_FULL_CHR_INT flag
138
* is set, it generates 1 output pixel). If 2048, two chroma
139
* input pixels should be averaged for 2 output pixels (this
140
* only happens if SWS_FLAG_FULL_CHR_INT is not set)
141
* @param y vertical line number for this output. This does not need
142
* to be used to calculate the offset in the destination,
143
* but can be used to generate comfort noise using dithering
144
* for some output formats.
146
typedef void (*yuv2packed1_fn)(struct SwsContext *c, const int16_t *lumSrc,
147
const int16_t *chrUSrc[2],
148
const int16_t *chrVSrc[2],
149
const int16_t *alpSrc, uint8_t *dest,
150
int dstW, int uvalpha, int y);
152
* Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
153
* output by doing bilinear scaling between two input lines.
155
* @param c SWS scaling context
156
* @param lumSrc scaled luma (Y) source data, 15bit for 8-10bit output,
157
* 19-bit for 16bit output (in int32_t)
158
* @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
159
* 19-bit for 16bit output (in int32_t)
160
* @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
161
* 19-bit for 16bit output (in int32_t)
162
* @param alpSrc scaled alpha (A) source data, 15bit for 8-10bit output,
163
* 19-bit for 16bit output (in int32_t)
164
* @param dest pointer to the output plane. For 16bit output, this is
166
* @param dstW width of lumSrc and alpSrc in pixels, number of pixels
167
* to write into dest[]
168
* @param yalpha luma/alpha scaling coefficients for the second input line.
169
* The first line's coefficients can be calculated by using
171
* @param uvalpha chroma scaling coefficient for the second input line. The
172
* first line's coefficients can be calculated by using
174
* @param y vertical line number for this output. This does not need
175
* to be used to calculate the offset in the destination,
176
* but can be used to generate comfort noise using dithering
177
* for some output formats.
179
typedef void (*yuv2packed2_fn)(struct SwsContext *c, const int16_t *lumSrc[2],
180
const int16_t *chrUSrc[2],
181
const int16_t *chrVSrc[2],
182
const int16_t *alpSrc[2],
184
int dstW, int yalpha, int uvalpha, int y);
186
* Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
187
* output by doing multi-point vertical scaling between input pixels.
189
* @param c SWS scaling context
190
* @param lumFilter vertical luma/alpha scaling coefficients, 12bit [0,4096]
191
* @param lumSrc scaled luma (Y) source data, 15bit for 8-10bit output,
192
* 19-bit for 16bit output (in int32_t)
193
* @param lumFilterSize number of vertical luma/alpha input lines to scale
194
* @param chrFilter vertical chroma scaling coefficients, 12bit [0,4096]
195
* @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
196
* 19-bit for 16bit output (in int32_t)
197
* @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
198
* 19-bit for 16bit output (in int32_t)
199
* @param chrFilterSize number of vertical chroma input lines to scale
200
* @param alpSrc scaled alpha (A) source data, 15bit for 8-10bit output,
201
* 19-bit for 16bit output (in int32_t)
202
* @param dest pointer to the output plane. For 16bit output, this is
204
* @param dstW width of lumSrc and alpSrc in pixels, number of pixels
205
* to write into dest[]
206
* @param y vertical line number for this output. This does not need
207
* to be used to calculate the offset in the destination,
208
* but can be used to generate comfort noise using dithering
209
* or some output formats.
211
typedef void (*yuv2packedX_fn)(struct SwsContext *c, const int16_t *lumFilter,
212
const int16_t **lumSrc, int lumFilterSize,
213
const int16_t *chrFilter,
214
const int16_t **chrUSrc,
215
const int16_t **chrVSrc, int chrFilterSize,
216
const int16_t **alpSrc, uint8_t *dest,
95
219
/* This struct should be aligned on at least a 32-byte boundary. */
96
220
typedef struct SwsContext {
287
421
/* function pointers for swScale() */
288
yuv2planar1_fn yuv2yuv1;
289
yuv2planarX_fn yuv2yuvX;
422
yuv2planar1_fn yuv2plane1;
423
yuv2planarX_fn yuv2planeX;
424
yuv2interleavedX_fn yuv2nv12cX;
290
425
yuv2packed1_fn yuv2packed1;
291
426
yuv2packed2_fn yuv2packed2;
292
427
yuv2packedX_fn yuv2packedX;
429
/// Unscaled conversion of luma plane to YV12 for horizontal scaler.
294
430
void (*lumToYV12)(uint8_t *dst, const uint8_t *src,
295
int width, uint32_t *pal); ///< Unscaled conversion of luma plane to YV12 for horizontal scaler.
431
int width, uint32_t *pal);
432
/// Unscaled conversion of alpha plane to YV12 for horizontal scaler.
296
433
void (*alpToYV12)(uint8_t *dst, const uint8_t *src,
297
int width, uint32_t *pal); ///< Unscaled conversion of alpha plane to YV12 for horizontal scaler.
434
int width, uint32_t *pal);
435
/// Unscaled conversion of chroma planes to YV12 for horizontal scaler.
298
436
void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV,
299
437
const uint8_t *src1, const uint8_t *src2,
300
int width, uint32_t *pal); ///< Unscaled conversion of chroma planes to YV12 for horizontal scaler.
438
int width, uint32_t *pal);
441
* Functions to read planar input, such as planar RGB, and convert
442
* internally to Y/UV.
445
void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width);
446
void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4],
451
* Scale one horizontal line of input data using a bilinear filter
452
* to produce one line of output data. Compared to SwsContext->hScale(),
453
* please take note of the following caveats when using these:
454
* - Scaling is done using only 7bit instead of 14bit coefficients.
455
* - You can use no more than 5 input pixels to produce 4 output
456
* pixels. Therefore, this filter should not be used for downscaling
457
* by more than ~20% in width (because that equals more than 5/4th
458
* downscaling and thus more than 5 pixels input per 4 pixels output).
459
* - In general, bilinear filters create artifacts during downscaling
460
* (even when <20%), because one output pixel will span more than one
461
* input pixel, and thus some pixels will need edges of both neighbor
462
* pixels to interpolate the output pixel. Since you can use at most
463
* two input pixels per output pixel in bilinear scaling, this is
464
* impossible and thus downscaling by any size will create artifacts.
465
* To enable this type of scaling, set SWS_FLAG_FAST_BILINEAR
466
* in SwsContext->flags.
301
469
void (*hyscale_fast)(struct SwsContext *c,
302
470
int16_t *dst, int dstWidth,
303
471
const uint8_t *src, int srcW, int xInc);
305
473
int16_t *dst1, int16_t *dst2, int dstWidth,
306
474
const uint8_t *src1, const uint8_t *src2,
307
475
int srcW, int xInc);
309
void (*hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW,
310
int xInc, const int16_t *filter, const int16_t *filterPos,
313
void (*lumConvertRange)(int16_t *dst, int width); ///< Color range conversion function for luma plane if needed.
314
void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width); ///< Color range conversion function for chroma planes if needed.
479
* Scale one horizontal line of input data using a filter over the input
480
* lines, to produce one (differently sized) line of output data.
482
* @param dst pointer to destination buffer for horizontally scaled
483
* data. If the number of bits per component of one
484
* destination pixel (SwsContext->dstBpc) is <= 10, data
485
* will be 15bpc in 16bits (int16_t) width. Else (i.e.
486
* SwsContext->dstBpc == 16), data will be 19bpc in
487
* 32bits (int32_t) width.
488
* @param dstW width of destination image
489
* @param src pointer to source data to be scaled. If the number of
490
* bits per component of a source pixel (SwsContext->srcBpc)
491
* is 8, this is 8bpc in 8bits (uint8_t) width. Else
492
* (i.e. SwsContext->dstBpc > 8), this is native depth
493
* in 16bits (uint16_t) width. In other words, for 9-bit
494
* YUV input, this is 9bpc, for 10-bit YUV input, this is
495
* 10bpc, and for 16-bit RGB or YUV, this is 16bpc.
496
* @param filter filter coefficients to be used per output pixel for
497
* scaling. This contains 14bpp filtering coefficients.
498
* Guaranteed to contain dstW * filterSize entries.
499
* @param filterPos position of the first input pixel to be used for
500
* each output pixel during scaling. Guaranteed to
501
* contain dstW entries.
502
* @param filterSize the number of input coefficients to be used (and
503
* thus the number of input pixels to be used) for
504
* creating a single output pixel. Is aligned to 4
505
* (and input coefficients thus padded with zeroes)
506
* to simplify creating SIMD code.
509
void (*hyScale)(struct SwsContext *c, int16_t *dst, int dstW,
510
const uint8_t *src, const int16_t *filter,
511
const int16_t *filterPos, int filterSize);
512
void (*hcScale)(struct SwsContext *c, int16_t *dst, int dstW,
513
const uint8_t *src, const int16_t *filter,
514
const int16_t *filterPos, int filterSize);
517
/// Color range conversion function for luma plane if needed.
518
void (*lumConvertRange)(int16_t *dst, int width);
519
/// Color range conversion function for chroma planes if needed.
520
void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width);
316
522
int needs_hcscale; ///< Set if there are chroma planes to be converted.
319
524
//FIXME check init (where 0)
338
543
const char *sws_format_name(enum PixelFormat format);
340
//FIXME replace this with something faster
341
#define is16BPS(x) ( \
342
(x)==PIX_FMT_GRAY16BE \
343
|| (x)==PIX_FMT_GRAY16LE \
344
|| (x)==PIX_FMT_BGR48BE \
345
|| (x)==PIX_FMT_BGR48LE \
346
|| (x)==PIX_FMT_RGB48BE \
347
|| (x)==PIX_FMT_RGB48LE \
348
|| (x)==PIX_FMT_YUV420P16LE \
349
|| (x)==PIX_FMT_YUV422P16LE \
350
|| (x)==PIX_FMT_YUV444P16LE \
351
|| (x)==PIX_FMT_YUV420P16BE \
352
|| (x)==PIX_FMT_YUV422P16BE \
353
|| (x)==PIX_FMT_YUV444P16BE \
355
#define is9_OR_10BPS(x) ( \
356
(x)==PIX_FMT_YUV420P9LE \
357
|| (x)==PIX_FMT_YUV420P9BE \
358
|| (x)==PIX_FMT_YUV444P9BE \
359
|| (x)==PIX_FMT_YUV444P9LE \
360
|| (x)==PIX_FMT_YUV422P10BE \
361
|| (x)==PIX_FMT_YUV422P10LE \
362
|| (x)==PIX_FMT_YUV444P10BE \
363
|| (x)==PIX_FMT_YUV444P10LE \
364
|| (x)==PIX_FMT_YUV420P10LE \
365
|| (x)==PIX_FMT_YUV420P10BE \
367
#define isBE(x) ((x)&1)
368
#define isPlanar8YUV(x) ( \
369
(x)==PIX_FMT_YUV410P \
370
|| (x)==PIX_FMT_YUV420P \
371
|| (x)==PIX_FMT_YUVA420P \
372
|| (x)==PIX_FMT_YUV411P \
373
|| (x)==PIX_FMT_YUV422P \
374
|| (x)==PIX_FMT_YUV444P \
375
|| (x)==PIX_FMT_YUV440P \
376
|| (x)==PIX_FMT_NV12 \
377
|| (x)==PIX_FMT_NV21 \
379
#define isPlanarYUV(x) ( \
381
|| (x)==PIX_FMT_YUV420P9LE \
382
|| (x)==PIX_FMT_YUV444P9LE \
383
|| (x)==PIX_FMT_YUV420P10LE \
384
|| (x)==PIX_FMT_YUV422P10LE \
385
|| (x)==PIX_FMT_YUV444P10LE \
386
|| (x)==PIX_FMT_YUV420P16LE \
387
|| (x)==PIX_FMT_YUV422P16LE \
388
|| (x)==PIX_FMT_YUV444P16LE \
389
|| (x)==PIX_FMT_YUV420P9BE \
390
|| (x)==PIX_FMT_YUV444P9BE \
391
|| (x)==PIX_FMT_YUV420P10BE \
392
|| (x)==PIX_FMT_YUV422P10BE \
393
|| (x)==PIX_FMT_YUV444P10BE \
394
|| (x)==PIX_FMT_YUV420P16BE \
395
|| (x)==PIX_FMT_YUV422P16BE \
396
|| (x)==PIX_FMT_YUV444P16BE \
399
(x)==PIX_FMT_UYVY422 \
400
|| (x)==PIX_FMT_YUYV422 \
403
#define isGray(x) ( \
405
|| (x)==PIX_FMT_Y400A \
406
|| (x)==PIX_FMT_GRAY16BE \
407
|| (x)==PIX_FMT_GRAY16LE \
409
#define isGray16(x) ( \
410
(x)==PIX_FMT_GRAY16BE \
411
|| (x)==PIX_FMT_GRAY16LE \
413
#define isRGBinInt(x) ( \
414
(x)==PIX_FMT_RGB48BE \
415
|| (x)==PIX_FMT_RGB48LE \
416
|| (x)==PIX_FMT_RGB32 \
417
|| (x)==PIX_FMT_RGB32_1 \
418
|| (x)==PIX_FMT_RGB24 \
419
|| (x)==PIX_FMT_RGB565BE \
420
|| (x)==PIX_FMT_RGB565LE \
421
|| (x)==PIX_FMT_RGB555BE \
422
|| (x)==PIX_FMT_RGB555LE \
423
|| (x)==PIX_FMT_RGB444BE \
424
|| (x)==PIX_FMT_RGB444LE \
425
|| (x)==PIX_FMT_RGB8 \
426
|| (x)==PIX_FMT_RGB4 \
427
|| (x)==PIX_FMT_RGB4_BYTE \
428
|| (x)==PIX_FMT_MONOBLACK \
429
|| (x)==PIX_FMT_MONOWHITE \
431
#define isBGRinInt(x) ( \
432
(x)==PIX_FMT_BGR48BE \
433
|| (x)==PIX_FMT_BGR48LE \
434
|| (x)==PIX_FMT_BGR32 \
435
|| (x)==PIX_FMT_BGR32_1 \
436
|| (x)==PIX_FMT_BGR24 \
437
|| (x)==PIX_FMT_BGR565BE \
438
|| (x)==PIX_FMT_BGR565LE \
439
|| (x)==PIX_FMT_BGR555BE \
440
|| (x)==PIX_FMT_BGR555LE \
441
|| (x)==PIX_FMT_BGR444BE \
442
|| (x)==PIX_FMT_BGR444LE \
443
|| (x)==PIX_FMT_BGR8 \
444
|| (x)==PIX_FMT_BGR4 \
445
|| (x)==PIX_FMT_BGR4_BYTE \
446
|| (x)==PIX_FMT_MONOBLACK \
447
|| (x)==PIX_FMT_MONOWHITE \
449
#define isRGBinBytes(x) ( \
450
(x)==PIX_FMT_RGB48BE \
451
|| (x)==PIX_FMT_RGB48LE \
452
|| (x)==PIX_FMT_RGBA \
453
|| (x)==PIX_FMT_ARGB \
454
|| (x)==PIX_FMT_RGB24 \
456
#define isBGRinBytes(x) ( \
457
(x)==PIX_FMT_BGR48BE \
458
|| (x)==PIX_FMT_BGR48LE \
459
|| (x)==PIX_FMT_BGRA \
460
|| (x)==PIX_FMT_ABGR \
461
|| (x)==PIX_FMT_BGR24 \
463
#define isAnyRGB(x) ( \
467
#define isALPHA(x) ( \
469
|| (x)==PIX_FMT_BGR32_1 \
470
|| (x)==PIX_FMT_RGB32 \
471
|| (x)==PIX_FMT_RGB32_1 \
472
|| (x)==PIX_FMT_Y400A \
473
|| (x)==PIX_FMT_YUVA420P \
475
#define isPacked(x) ( \
477
|| (x)==PIX_FMT_YUYV422 \
478
|| (x)==PIX_FMT_UYVY422 \
479
|| (x)==PIX_FMT_Y400A \
546
(av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15)
548
#define is9_OR_10BPS(x) \
549
(av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 8 || \
550
av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 9)
553
(av_pix_fmt_descriptors[x].flags & PIX_FMT_BE)
556
(!(av_pix_fmt_descriptors[x].flags & PIX_FMT_RGB) && \
557
av_pix_fmt_descriptors[x].nb_components >= 2)
559
#define isPlanarYUV(x) \
560
((av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR) && \
564
(av_pix_fmt_descriptors[x].flags & PIX_FMT_RGB)
568
(!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) && \
569
av_pix_fmt_descriptors[x].nb_components <= 2)
572
((x) == PIX_FMT_GRAY8 || \
573
(x) == PIX_FMT_Y400A || \
574
(x) == PIX_FMT_GRAY16BE || \
575
(x) == PIX_FMT_GRAY16LE)
578
#define isRGBinInt(x) \
579
((x) == PIX_FMT_RGB48BE || \
580
(x) == PIX_FMT_RGB48LE || \
581
(x) == PIX_FMT_RGB32 || \
582
(x) == PIX_FMT_RGB32_1 || \
583
(x) == PIX_FMT_RGB24 || \
584
(x) == PIX_FMT_RGB565BE || \
585
(x) == PIX_FMT_RGB565LE || \
586
(x) == PIX_FMT_RGB555BE || \
587
(x) == PIX_FMT_RGB555LE || \
588
(x) == PIX_FMT_RGB444BE || \
589
(x) == PIX_FMT_RGB444LE || \
590
(x) == PIX_FMT_RGB8 || \
591
(x) == PIX_FMT_RGB4 || \
592
(x) == PIX_FMT_RGB4_BYTE || \
593
(x) == PIX_FMT_MONOBLACK || \
594
(x) == PIX_FMT_MONOWHITE)
596
#define isBGRinInt(x) \
597
((x) == PIX_FMT_BGR48BE || \
598
(x) == PIX_FMT_BGR48LE || \
599
(x) == PIX_FMT_BGR32 || \
600
(x) == PIX_FMT_BGR32_1 || \
601
(x) == PIX_FMT_BGR24 || \
602
(x) == PIX_FMT_BGR565BE || \
603
(x) == PIX_FMT_BGR565LE || \
604
(x) == PIX_FMT_BGR555BE || \
605
(x) == PIX_FMT_BGR555LE || \
606
(x) == PIX_FMT_BGR444BE || \
607
(x) == PIX_FMT_BGR444LE || \
608
(x) == PIX_FMT_BGR8 || \
609
(x) == PIX_FMT_BGR4 || \
610
(x) == PIX_FMT_BGR4_BYTE || \
611
(x) == PIX_FMT_MONOBLACK || \
612
(x) == PIX_FMT_MONOWHITE)
614
#define isAnyRGB(x) \
619
(av_pix_fmt_descriptors[x].nb_components == 2 || \
620
av_pix_fmt_descriptors[x].nb_components == 4)
622
#define isPacked(x) \
623
((av_pix_fmt_descriptors[x].nb_components >= 2 && \
624
!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR)) || \
627
#define isPlanar(x) \
628
(av_pix_fmt_descriptors[x].nb_components >= 2 && \
629
(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR))
482
631
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_Y400A)
484
633
extern const uint64_t ff_dither4[2];