21 #ifndef SWSCALE_SWSCALE_INTERNAL_H
22 #define SWSCALE_SWSCALE_INTERNAL_H
40 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
42 #define YUVRGB_TABLE_HEADROOM 128
44 #define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
49 #define ALT32_CORR (-1)
77 int srcStride[],
int srcSliceY,
int srcSliceH,
78 uint8_t *dst[],
int dstStride[]);
128 const int16_t *chrFilter,
130 const int16_t **chrUSrc,
131 const int16_t **chrVSrc,
164 const int16_t *chrUSrc[2],
165 const int16_t *chrVSrc[2],
166 const int16_t *alpSrc,
uint8_t *dest,
167 int dstW,
int uvalpha,
int y);
197 const int16_t *chrUSrc[2],
198 const int16_t *chrVSrc[2],
199 const int16_t *alpSrc[2],
201 int dstW,
int yalpha,
int uvalpha,
int y);
229 const int16_t **lumSrc,
int lumFilterSize,
230 const int16_t *chrFilter,
231 const int16_t **chrUSrc,
232 const int16_t **chrVSrc,
int chrFilterSize,
233 const int16_t **alpSrc,
uint8_t *dest,
263 const int16_t **lumSrc,
int lumFilterSize,
264 const int16_t *chrFilter,
265 const int16_t **chrUSrc,
266 const int16_t **chrVSrc,
int chrFilterSize,
267 const int16_t **alpSrc,
uint8_t **dest,
385 #define RGB2YUV_SHIFT 15
410 #define RED_DITHER "0*8"
411 #define GREEN_DITHER "1*8"
412 #define BLUE_DITHER "2*8"
413 #define Y_COEFF "3*8"
414 #define VR_COEFF "4*8"
415 #define UB_COEFF "5*8"
416 #define VG_COEFF "6*8"
417 #define UG_COEFF "7*8"
418 #define Y_OFFSET "8*8"
419 #define U_OFFSET "9*8"
420 #define V_OFFSET "10*8"
421 #define LUM_MMX_FILTER_OFFSET "11*8"
422 #define CHR_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)
423 #define DSTW_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2"
424 #define ESP_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+8"
425 #define VROUNDER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+16"
426 #define U_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+24"
427 #define V_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+32"
428 #define Y_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+40"
429 #define ALP_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+48"
430 #define UV_OFF_PX "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+48"
431 #define UV_OFF_BYTE "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+56"
432 #define DITHER16 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+64"
433 #define DITHER32 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+80"
434 #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
468 vector
signed short CY;
469 vector
signed short CRV;
470 vector
signed short CBU;
471 vector
signed short CGU;
472 vector
signed short CGV;
473 vector
signed short OY;
474 vector
unsigned short CSHIFT;
475 vector
signed short *vYCoeffsBank, *vCCoeffsBank;
481 #define XYZ_GAMMA (2.6f)
482 #define RGB_GAMMA (2.2f)
501 int width, uint32_t *pal);
504 int width, uint32_t *pal);
508 int width, uint32_t *pal);
541 int16_t *dst,
int dstWidth,
544 int16_t *dst1, int16_t *dst2,
int dstWidth,
582 const int32_t *filterPos,
int filterSize);
585 const int32_t *filterPos,
int filterSize);
614 #if FF_API_SWS_FORMAT_NAME
636 #define isNBPS(x) is9_OR_10BPS(x)
668 (!(av_pix_fmt_desc_get(x)->flags & AV_PIX_FMT_FLAG_PAL) && \
669 av_pix_fmt_desc_get(x)->nb_components <= 2)
672 ((x) == AV_PIX_FMT_GRAY8 || \
673 (x) == AV_PIX_FMT_YA8 || \
674 (x) == AV_PIX_FMT_GRAY16BE || \
675 (x) == AV_PIX_FMT_GRAY16LE || \
676 (x) == AV_PIX_FMT_YA16BE || \
677 (x) == AV_PIX_FMT_YA16LE)
680 #define isRGBinInt(x) \
682 (x) == AV_PIX_FMT_RGB48BE || \
683 (x) == AV_PIX_FMT_RGB48LE || \
684 (x) == AV_PIX_FMT_RGB32 || \
685 (x) == AV_PIX_FMT_RGB32_1 || \
686 (x) == AV_PIX_FMT_RGB24 || \
687 (x) == AV_PIX_FMT_RGB565BE || \
688 (x) == AV_PIX_FMT_RGB565LE || \
689 (x) == AV_PIX_FMT_RGB555BE || \
690 (x) == AV_PIX_FMT_RGB555LE || \
691 (x) == AV_PIX_FMT_RGB444BE || \
692 (x) == AV_PIX_FMT_RGB444LE || \
693 (x) == AV_PIX_FMT_RGB8 || \
694 (x) == AV_PIX_FMT_RGB4 || \
695 (x) == AV_PIX_FMT_RGB4_BYTE || \
696 (x) == AV_PIX_FMT_RGBA64BE || \
697 (x) == AV_PIX_FMT_RGBA64LE || \
698 (x) == AV_PIX_FMT_MONOBLACK || \
699 (x) == AV_PIX_FMT_MONOWHITE \
701 #define isBGRinInt(x) \
703 (x) == AV_PIX_FMT_BGR48BE || \
704 (x) == AV_PIX_FMT_BGR48LE || \
705 (x) == AV_PIX_FMT_BGR32 || \
706 (x) == AV_PIX_FMT_BGR32_1 || \
707 (x) == AV_PIX_FMT_BGR24 || \
708 (x) == AV_PIX_FMT_BGR565BE || \
709 (x) == AV_PIX_FMT_BGR565LE || \
710 (x) == AV_PIX_FMT_BGR555BE || \
711 (x) == AV_PIX_FMT_BGR555LE || \
712 (x) == AV_PIX_FMT_BGR444BE || \
713 (x) == AV_PIX_FMT_BGR444LE || \
714 (x) == AV_PIX_FMT_BGR8 || \
715 (x) == AV_PIX_FMT_BGR4 || \
716 (x) == AV_PIX_FMT_BGR4_BYTE || \
717 (x) == AV_PIX_FMT_BGRA64BE || \
718 (x) == AV_PIX_FMT_BGRA64LE || \
719 (x) == AV_PIX_FMT_MONOBLACK || \
720 (x) == AV_PIX_FMT_MONOWHITE \
723 #define isRGBinBytes(x) ( \
724 (x) == AV_PIX_FMT_RGB48BE \
725 || (x) == AV_PIX_FMT_RGB48LE \
726 || (x) == AV_PIX_FMT_RGBA64BE \
727 || (x) == AV_PIX_FMT_RGBA64LE \
728 || (x) == AV_PIX_FMT_RGBA \
729 || (x) == AV_PIX_FMT_ARGB \
730 || (x) == AV_PIX_FMT_RGB24 \
732 #define isBGRinBytes(x) ( \
733 (x) == AV_PIX_FMT_BGR48BE \
734 || (x) == AV_PIX_FMT_BGR48LE \
735 || (x) == AV_PIX_FMT_BGRA64BE \
736 || (x) == AV_PIX_FMT_BGRA64LE \
737 || (x) == AV_PIX_FMT_BGRA \
738 || (x) == AV_PIX_FMT_ABGR \
739 || (x) == AV_PIX_FMT_BGR24 \
742 #define isBayer(x) ( \
743 (x)==AV_PIX_FMT_BAYER_BGGR8 \
744 || (x)==AV_PIX_FMT_BAYER_BGGR16LE \
745 || (x)==AV_PIX_FMT_BAYER_BGGR16BE \
746 || (x)==AV_PIX_FMT_BAYER_RGGB8 \
747 || (x)==AV_PIX_FMT_BAYER_RGGB16LE \
748 || (x)==AV_PIX_FMT_BAYER_RGGB16BE \
749 || (x)==AV_PIX_FMT_BAYER_GBRG8 \
750 || (x)==AV_PIX_FMT_BAYER_GBRG16LE \
751 || (x)==AV_PIX_FMT_BAYER_GBRG16BE \
752 || (x)==AV_PIX_FMT_BAYER_GRBG8 \
753 || (x)==AV_PIX_FMT_BAYER_GRBG16LE \
754 || (x)==AV_PIX_FMT_BAYER_GRBG16BE \
757 #define isAnyRGB(x) \
775 #define isPacked(x) ( \
776 (x)==AV_PIX_FMT_PAL8 \
777 || (x)==AV_PIX_FMT_YUYV422 \
778 || (x)==AV_PIX_FMT_YVYU422 \
779 || (x)==AV_PIX_FMT_UYVY422 \
780 || (x)==AV_PIX_FMT_YA8 \
781 || (x)==AV_PIX_FMT_YA16LE \
782 || (x)==AV_PIX_FMT_YA16BE \
869 int dstWidth,
const uint8_t *src1,
878 int dstWidth,
const uint8_t *src1,
882 int alpha,
int bits,
const int big_endian)
886 int v = alpha ? 0xFFFF>>(15-
bits) : (1<<bits);
887 for (i = 0; i <
height; i++) {
888 #define FILL(wfunc) \
889 for (j = 0; j < width; j++) {\