21 #ifndef SWSCALE_SWSCALE_INTERNAL_H
22 #define SWSCALE_SWSCALE_INTERNAL_H
35 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
37 #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
39 #define MAX_FILTER_SIZE 256
42 #define ALT32_CORR (-1)
60 int srcStride[],
int srcSliceY,
int srcSliceH,
61 uint8_t *dst[],
int dstStride[]);
76 const uint8_t *
dither,
int offset);
92 const int16_t **src, uint8_t *dest,
int dstW,
93 const uint8_t *
dither,
int offset);
111 const int16_t *chrFilter,
113 const int16_t **chrUSrc,
114 const int16_t **chrVSrc,
115 uint8_t *dest,
int dstW);
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);
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);
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,
336 #define RED_DITHER "0*8"
337 #define GREEN_DITHER "1*8"
338 #define BLUE_DITHER "2*8"
339 #define Y_COEFF "3*8"
340 #define VR_COEFF "4*8"
341 #define UB_COEFF "5*8"
342 #define VG_COEFF "6*8"
343 #define UG_COEFF "7*8"
344 #define Y_OFFSET "8*8"
345 #define U_OFFSET "9*8"
346 #define V_OFFSET "10*8"
347 #define LUM_MMX_FILTER_OFFSET "11*8"
348 #define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
349 #define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM
350 #define ESP_OFFSET "11*8+4*4*256*2+8"
351 #define VROUNDER_OFFSET "11*8+4*4*256*2+16"
352 #define U_TEMP "11*8+4*4*256*2+24"
353 #define V_TEMP "11*8+4*4*256*2+32"
354 #define Y_TEMP "11*8+4*4*256*2+40"
355 #define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
356 #define UV_OFF_PX "11*8+4*4*256*3+48"
357 #define UV_OFF_BYTE "11*8+4*4*256*3+56"
358 #define DITHER16 "11*8+4*4*256*3+64"
359 #define DITHER32 "11*8+4*4*256*3+80"
393 vector
signed short CY;
394 vector
signed short CRV;
395 vector
signed short CBU;
396 vector
signed short CGU;
397 vector
signed short CGV;
398 vector
signed short OY;
399 vector
unsigned short CSHIFT;
400 vector
signed short *vYCoeffsBank, *vCCoeffsBank;
431 int width, uint32_t *pal);
434 int width, uint32_t *pal);
437 const uint8_t *src1,
const uint8_t *src2,
438 int width, uint32_t *pal);
470 int16_t *dst,
int dstWidth,
471 const uint8_t *src,
int srcW,
int xInc);
473 int16_t *dst1, int16_t *dst2,
int dstWidth,
474 const uint8_t *src1,
const uint8_t *src2,
510 const uint8_t *src,
const int16_t *
filter,
511 const int32_t *filterPos,
int filterSize);
513 const uint8_t *src,
const int16_t *
filter,
514 const int32_t *filterPos,
int filterSize);
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))
631 #define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_Y400A)