21 #ifndef SWSCALE_SWSCALE_INTERNAL_H
22 #define SWSCALE_SWSCALE_INTERNAL_H
38 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
40 #define YUVRGB_TABLE_HEADROOM 128
42 #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
44 #define MAX_FILTER_SIZE 256
49 #define ALT32_CORR (-1)
67 int srcStride[],
int srcSliceY,
int srcSliceH,
118 const int16_t *chrFilter,
120 const int16_t **chrUSrc,
121 const int16_t **chrVSrc,
154 const int16_t *chrUSrc[2],
155 const int16_t *chrVSrc[2],
156 const int16_t *alpSrc,
uint8_t *dest,
157 int dstW,
int uvalpha,
int y);
187 const int16_t *chrUSrc[2],
188 const int16_t *chrVSrc[2],
189 const int16_t *alpSrc[2],
191 int dstW,
int yalpha,
int uvalpha,
int y);
219 const int16_t **lumSrc,
int lumFilterSize,
220 const int16_t *chrFilter,
221 const int16_t **chrUSrc,
222 const int16_t **chrVSrc,
int chrFilterSize,
223 const int16_t **alpSrc,
uint8_t *dest,
345 #define RED_DITHER "0*8"
346 #define GREEN_DITHER "1*8"
347 #define BLUE_DITHER "2*8"
348 #define Y_COEFF "3*8"
349 #define VR_COEFF "4*8"
350 #define UB_COEFF "5*8"
351 #define VG_COEFF "6*8"
352 #define UG_COEFF "7*8"
353 #define Y_OFFSET "8*8"
354 #define U_OFFSET "9*8"
355 #define V_OFFSET "10*8"
356 #define LUM_MMX_FILTER_OFFSET "11*8"
357 #define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
358 #define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM
359 #define ESP_OFFSET "11*8+4*4*256*2+8"
360 #define VROUNDER_OFFSET "11*8+4*4*256*2+16"
361 #define U_TEMP "11*8+4*4*256*2+24"
362 #define V_TEMP "11*8+4*4*256*2+32"
363 #define Y_TEMP "11*8+4*4*256*2+40"
364 #define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
365 #define UV_OFF_PX "11*8+4*4*256*3+48"
366 #define UV_OFF_BYTE "11*8+4*4*256*3+56"
367 #define DITHER16 "11*8+4*4*256*3+64"
368 #define DITHER32 "11*8+4*4*256*3+80"
402 vector
signed short CY;
403 vector
signed short CRV;
404 vector
signed short CBU;
405 vector
signed short CGU;
406 vector
signed short CGV;
407 vector
signed short OY;
408 vector
unsigned short CSHIFT;
409 vector
signed short *vYCoeffsBank, *vCCoeffsBank;
441 int width, uint32_t *pal);
444 int width, uint32_t *pal);
448 int width, uint32_t *pal);
480 int16_t *
dst,
int dstWidth,
483 int16_t *dst1, int16_t *dst2,
int dstWidth,
521 const int32_t *filterPos,
int filterSize);
524 const int32_t *filterPos,
int filterSize);
552 #if FF_API_SWS_FORMAT_NAME
574 #define isNBPS(x) is9_OR_10BPS(x)
606 (!(av_pix_fmt_desc_get(x)->flags & PIX_FMT_PAL) && \
607 av_pix_fmt_desc_get(x)->nb_components <= 2)
610 ((x) == AV_PIX_FMT_GRAY8 || \
611 (x) == AV_PIX_FMT_Y400A || \
612 (x) == AV_PIX_FMT_GRAY16BE || \
613 (x) == AV_PIX_FMT_GRAY16LE)
616 #define isRGBinInt(x) \
618 (x) == AV_PIX_FMT_RGB48BE || \
619 (x) == AV_PIX_FMT_RGB48LE || \
620 (x) == AV_PIX_FMT_RGBA64BE || \
621 (x) == AV_PIX_FMT_RGBA64LE || \
622 (x) == AV_PIX_FMT_RGB32 || \
623 (x) == AV_PIX_FMT_RGB32_1 || \
624 (x) == AV_PIX_FMT_RGB24 || \
625 (x) == AV_PIX_FMT_RGB565BE || \
626 (x) == AV_PIX_FMT_RGB565LE || \
627 (x) == AV_PIX_FMT_RGB555BE || \
628 (x) == AV_PIX_FMT_RGB555LE || \
629 (x) == AV_PIX_FMT_RGB444BE || \
630 (x) == AV_PIX_FMT_RGB444LE || \
631 (x) == AV_PIX_FMT_RGB8 || \
632 (x) == AV_PIX_FMT_RGB4 || \
633 (x) == AV_PIX_FMT_RGB4_BYTE || \
634 (x) == AV_PIX_FMT_MONOBLACK || \
635 (x) == AV_PIX_FMT_MONOWHITE \
637 #define isBGRinInt(x) \
639 (x) == AV_PIX_FMT_BGR48BE || \
640 (x) == AV_PIX_FMT_BGR48LE || \
641 (x) == AV_PIX_FMT_BGRA64BE || \
642 (x) == AV_PIX_FMT_BGRA64LE || \
643 (x) == AV_PIX_FMT_BGR32 || \
644 (x) == AV_PIX_FMT_BGR32_1 || \
645 (x) == AV_PIX_FMT_BGR24 || \
646 (x) == AV_PIX_FMT_BGR565BE || \
647 (x) == AV_PIX_FMT_BGR565LE || \
648 (x) == AV_PIX_FMT_BGR555BE || \
649 (x) == AV_PIX_FMT_BGR555LE || \
650 (x) == AV_PIX_FMT_BGR444BE || \
651 (x) == AV_PIX_FMT_BGR444LE || \
652 (x) == AV_PIX_FMT_BGR8 || \
653 (x) == AV_PIX_FMT_BGR4 || \
654 (x) == AV_PIX_FMT_BGR4_BYTE || \
655 (x) == AV_PIX_FMT_MONOBLACK || \
656 (x) == AV_PIX_FMT_MONOWHITE \
659 #define isRGBinBytes(x) ( \
660 (x) == AV_PIX_FMT_RGB48BE \
661 || (x) == AV_PIX_FMT_RGB48LE \
662 || (x) == AV_PIX_FMT_RGBA64BE \
663 || (x) == AV_PIX_FMT_RGBA64LE \
664 || (x) == AV_PIX_FMT_RGBA \
665 || (x) == AV_PIX_FMT_ARGB \
666 || (x) == AV_PIX_FMT_RGB24 \
668 #define isBGRinBytes(x) ( \
669 (x) == AV_PIX_FMT_BGR48BE \
670 || (x) == AV_PIX_FMT_BGR48LE \
671 || (x) == AV_PIX_FMT_BGRA64BE \
672 || (x) == AV_PIX_FMT_BGRA64LE \
673 || (x) == AV_PIX_FMT_BGRA \
674 || (x) == AV_PIX_FMT_ABGR \
675 || (x) == AV_PIX_FMT_BGR24 \
678 #define isAnyRGB(x) \
682 (x)==AV_PIX_FMT_GBR24P \
693 #define isPacked(x) ( \
694 (x)==AV_PIX_FMT_PAL8 \
695 || (x)==AV_PIX_FMT_YUYV422 \
696 || (x)==AV_PIX_FMT_UYVY422 \
697 || (x)==AV_PIX_FMT_Y400A \
774 int alpha,
int bits,
const int big_endian)
777 uint8_t *ptr = plane + stride * y;
778 int v = alpha ? 0xFFFF>>(15-
bits) : (1<<bits);
779 for (i = 0; i <
height; i++) {
780 #define FILL(wfunc) \
781 for (j = 0; j < width; j++) {\