23 #define _DEFAULT_SOURCE
24 #define _SVID_SOURCE // needed for MAP_ANONYMOUS
25 #define _DARWIN_C_SOURCE // needed for MAP_ANON
32 #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
33 #define MAP_ANONYMOUS MAP_ANON
37 #define WIN32_LEAN_AND_MEAN
59 #undef attribute_deprecated
60 #define attribute_deprecated
66 #if !FF_API_SWS_VECTOR
83 return FFMPEG_CONFIGURATION;
88 #define LICENSE_PREFIX "libswscale license: "
287 return ((d * dist + c) * dist + b) * dist +
a;
290 b + 2.0 * c + 3.0 * d,
292 -b - 3.0 * c - 6.0 * d,
298 if (pos == -1 || pos <= -513) {
299 pos = (128 << chr_subsample) - 128;
302 return pos >> chr_subsample;
319 {
SWS_POINT,
"nearest neighbor / point", -1 },
322 {
SWS_X,
"experimental", 8 },
326 int *outFilterSize,
int xInc,
int srcW,
327 int dstW,
int filterAlign,
int one,
330 double param[2],
int srcPos,
int dstPos)
337 int64_t *filter2 =
NULL;
338 const int64_t fone = 1LL << (54 -
FFMIN(
av_log2(srcW/dstW), 8));
346 if (
FFABS(xInc - 0x10000) < 10 && srcPos == dstPos) {
350 dstW,
sizeof(*filter) * filterSize,
fail);
352 for (i = 0; i < dstW; i++) {
353 filter[i * filterSize] = fone;
361 dstW,
sizeof(*filter) * filterSize,
fail);
363 xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
364 for (i = 0; i < dstW; i++) {
365 int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
367 (*filterPos)[i] = xx;
371 }
else if ((xInc <= (1 << 16) && (flags &
SWS_AREA)) ||
377 dstW,
sizeof(*filter) * filterSize,
fail);
379 xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
380 for (i = 0; i < dstW; i++) {
381 int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
384 (*filterPos)[i] = xx;
386 for (j = 0; j < filterSize; j++) {
387 int64_t
coeff= fone -
FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16);
390 filter[i * filterSize + j] =
coeff;
400 if (flags & scale_algorithms[i].
flag && scale_algorithms[i].size_factor > 0) {
410 filterSize = 1 + sizeFactor;
412 filterSize = 1 + (sizeFactor * srcW + dstW - 1) / dstW;
414 filterSize =
FFMIN(filterSize, srcW - 2);
415 filterSize =
FFMAX(filterSize, 1);
418 dstW,
sizeof(*filter) * filterSize,
fail);
420 xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
421 for (i = 0; i < dstW; i++) {
422 int xx = (xDstInSrc - (filterSize - 2) * (1LL<<16)) / (1 << 17);
424 (*filterPos)[i] = xx;
425 for (j = 0; j < filterSize; j++) {
426 int64_t d = (
FFABS(((int64_t)xx * (1 << 17)) - xDstInSrc)) << 13;
432 floatd = d * (1.0 / (1 << 30));
438 if (d >= 1LL << 31) {
441 int64_t dd = (d * d) >> 30;
442 int64_t ddd = (dd * d) >> 30;
445 coeff = (12 * (1 << 24) - 9 * B - 6 * C) * ddd +
446 (-18 * (1 << 24) + 12 * B + 6 * C) * dd +
447 (6 * (1 << 24) - 2 * B) * (1 << 30);
449 coeff = (-B - 6 *
C) * ddd +
450 (6 * B + 30 * C) * dd +
451 (-12 * B - 48 *
C) * d +
452 (8 * B + 24 * C) * (1 << 30);
454 coeff /= (1LL<<54)/fone;
455 }
else if (flags &
SWS_X) {
460 c = cos(floatd *
M_PI);
467 coeff = (c * 0.5 + 0.5) * fone;
469 int64_t d2 = d - (1 << 29);
470 if (d2 * xInc < -(1LL << (29 + 16)))
471 coeff = 1.0 * (1LL << (30 + 16));
472 else if (d2 * xInc < (1LL << (29 + 16)))
473 coeff = -d2 * xInc + (1LL << (29 + 16));
476 coeff *= fone >> (30 + 16);
479 coeff =
exp2(-p * floatd * floatd) * fone;
481 coeff = (d ? sin(floatd *
M_PI) / (floatd *
M_PI) : 1.0) * fone;
482 }
else if (flags & SWS_LANCZOS) {
484 coeff = (d ? sin(floatd *
M_PI) * sin(floatd * M_PI / p) /
485 (floatd * floatd * M_PI * M_PI / p) : 1.0) * fone;
489 coeff = (1 << 30) - d;
494 double p = -2.196152422706632;
500 filter[i * filterSize + j] =
coeff;
503 xDstInSrc += 2 * xInc;
511 filter2Size = filterSize;
513 filter2Size += srcFilter->
length - 1;
515 filter2Size += dstFilter->
length - 1;
519 for (i = 0; i < dstW; i++) {
523 for (k = 0; k < srcFilter->
length; k++) {
524 for (j = 0; j < filterSize; j++)
525 filter2[i * filter2Size + k + j] +=
526 srcFilter->
coeff[k] * filter[i * filterSize + j];
529 for (j = 0; j < filterSize; j++)
530 filter2[i * filter2Size + j] = filter[i * filterSize + j];
534 (*filterPos)[i] += (filterSize - 1) / 2 - (filter2Size - 1) / 2;
541 for (i = dstW - 1; i >= 0; i--) {
542 int min = filter2Size;
544 int64_t cutOff = 0.0;
547 for (j = 0; j < filter2Size; j++) {
549 cutOff +=
FFABS(filter2[i * filter2Size]);
556 if (i < dstW - 1 && (*filterPos)[i] >= (*filterPos)[i + 1])
560 for (k = 1; k < filter2Size; k++)
561 filter2[i * filter2Size + k - 1] = filter2[i * filter2Size + k];
562 filter2[i * filter2Size + k - 1] = 0;
568 for (j = filter2Size - 1; j > 0; j--) {
569 cutOff +=
FFABS(filter2[i * filter2Size + j]);
576 if (min > minFilterSize)
582 if (minFilterSize < 5)
588 if (minFilterSize < 3)
594 if (minFilterSize == 1 && filterAlign == 2)
599 filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1));
609 *outFilterSize = filterSize;
613 "SwScaler: reducing / aligning filtersize %d -> %d\n",
614 filter2Size, filterSize);
616 for (i = 0; i < dstW; i++) {
619 for (j = 0; j < filterSize; j++) {
620 if (j >= filter2Size)
621 filter[i * filterSize + j] = 0;
623 filter[i * filterSize + j] = filter2[i * filter2Size + j];
625 filter[i * filterSize + j] = 0;
632 for (i = 0; i < dstW; i++) {
634 if ((*filterPos)[i] < 0) {
636 for (j = 1; j < filterSize; j++) {
637 int left =
FFMAX(j + (*filterPos)[i], 0);
638 filter[i * filterSize + left] += filter[i * filterSize + j];
639 filter[i * filterSize + j] = 0;
644 if ((*filterPos)[i] + filterSize > srcW) {
645 int shift = (*filterPos)[i] +
FFMIN(filterSize - srcW, 0);
648 for (j = filterSize - 1; j >= 0; j--) {
649 if ((*filterPos)[i] + j >= srcW) {
650 acc += filter[i * filterSize + j];
651 filter[i * filterSize + j] = 0;
654 for (j = filterSize - 1; j >= 0; j--) {
656 filter[i * filterSize + j] = 0;
658 filter[i * filterSize + j] = filter[i * filterSize + j -
shift];
662 (*filterPos)[i]-=
shift;
663 filter[i * filterSize + srcW - 1 - (*filterPos)[i]] +=
acc;
667 if ((*filterPos)[i] + filterSize > srcW) {
668 for (j = 0; j < filterSize; j++) {
669 av_assert0((*filterPos)[i] + j < srcW || !filter[i * filterSize + j]);
677 (dstW + 3), *outFilterSize *
sizeof(int16_t),
fail);
680 for (i = 0; i < dstW; i++) {
685 for (j = 0; j < filterSize; j++) {
686 sum += filter[i * filterSize + j];
688 sum = (sum + one / 2) / one;
693 for (j = 0; j < *outFilterSize; j++) {
694 int64_t v = filter[i * filterSize + j] +
error;
696 (*outFilter)[i * (*outFilterSize) + j] = intV;
697 error = v - intV * sum;
701 (*filterPos)[dstW + 0] =
702 (*filterPos)[dstW + 1] =
703 (*filterPos)[dstW + 2] = (*filterPos)[dstW - 1];
705 for (i = 0; i < *outFilterSize; i++) {
706 int k = (dstW - 1) * (*outFilterSize) + i;
707 (*outFilter)[k + 1 * (*outFilterSize)] =
708 (*outFilter)[k + 2 * (*outFilterSize)] =
709 (*outFilter)[k + 3 * (*outFilterSize)] = (*outFilter)[k];
724 int64_t
W,
V, Z, Cy, Cu, Cv;
725 int64_t vr = table[0];
726 int64_t ub = table[1];
727 int64_t ug = -table[2];
728 int64_t vg = -table[3];
733 static const int8_t
map[] = {
758 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
759 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
760 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
761 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
762 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
763 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
764 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
765 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
813 AV_WL16(p + 16*4 + 2*i,
map[i] >= 0 ?
c->input_rgb2yuv_table[
map[i]] : 0);
823 static const int16_t xyz2rgb_matrix[3][4] = {
824 {13270, -6295, -2041},
826 { 228, -835, 4329} };
827 static const int16_t rgb2xyz_matrix[3][4] = {
831 static int16_t xyzgamma_tab[4096], rgbgamma_tab[4096], xyzgammainv_tab[4096], rgbgammainv_tab[4096];
840 if (rgbgamma_tab[4095])
844 for (i = 0; i < 4096; i++) {
845 xyzgamma_tab[i] =
lrint(pow(i / 4095.0, xyzgamma) * 4095.0);
846 rgbgamma_tab[i] =
lrint(pow(i / 4095.0, rgbgamma) * 4095.0);
847 xyzgammainv_tab[i] =
lrint(pow(i / 4095.0, xyzgammainv) * 4095.0);
848 rgbgammainv_tab[i] =
lrint(pow(i / 4095.0, rgbgammainv) * 4095.0);
853 int srcRange,
const int table[4],
int dstRange,
854 int brightness,
int contrast,
int saturation)
909 int tmp_width, tmp_height;
915 av_log(c,
AV_LOG_VERBOSE,
"YUV color matrix differs for YUV->YUV, using intermediate RGB to convert\n");
931 if (srcW*srcH > dstW*dstH) {
940 tmp_width, tmp_height, tmp_format, 64);
945 tmp_width, tmp_height, tmp_format,
956 srcRange, table, dstRange,
957 brightness, contrast, saturation);
965 srcRange, table, dstRange,
966 0, 1 << 16, 1 << 16);
974 contrast, saturation);
979 contrast, saturation);
988 int *srcRange,
int **
table,
int *dstRange,
989 int *brightness,
int *contrast,
int *saturation)
1091 tbl = (uint16_t*)
av_malloc(
sizeof(uint16_t) * 1 << 16);
1095 for (i = 0; i < 65536; ++i) {
1096 tbl[i] = pow(i / 65535.0, e) * 65535.0;
1163 int usesVFilter, usesHFilter;
1170 int dst_stride =
FFALIGN(dstW *
sizeof(int16_t) + 66, 16);
1178 static const float float_mult = 1.0f / 255.0f;
1186 unscaled = (srcW == dstW && srcH == dstH);
1192 av_log(c,
AV_LOG_WARNING,
"deprecated pixel format used, make sure you did set range correctly\n");
1238 if (dstW < srcW && dstH < srcH)
1240 else if (dstW > srcW && dstH > srcH)
1245 }
else if (i & (i - 1)) {
1247 "Exactly one scaler algorithm must be chosen, got %X\n", i);
1251 if (srcW < 1 || srcH < 1 || dstW < 1 || dstH < 1) {
1255 srcW, srcH, dstW, dstH);
1259 if (srcW < 8 || dstW < 8) {
1266 dstFilter = &dummyFilter;
1268 srcFilter = &dummyFilter;
1270 c->
lumXInc = (((int64_t)srcW << 16) + (dstW >> 1)) / dstW;
1271 c->
lumYInc = (((int64_t)srcH << 16) + (dstH >> 1)) / dstH;
1274 c->
vRounder = 4 * 0x0001000100010001ULL;
1276 usesVFilter = (srcFilter->
lumV && srcFilter->
lumV->
length > 1) ||
1280 usesHFilter = (srcFilter->
lumH && srcFilter->
lumH->
length > 1) ||
1298 && !(c->
flags & SWS_FAST_BILINEAR)
1300 av_log(c,
AV_LOG_DEBUG,
"Forcing full internal H chroma due to input having non subsampled chroma\n");
1317 if (!(flags & SWS_FULL_CHR_H_INT)) {
1320 "Desired dithering only supported in full chroma interpolation for destination format '%s'\n",
1326 if (flags & SWS_FULL_CHR_H_INT) {
1329 "Ordered dither is not supported in full chroma interpolation for destination format '%s'\n",
1336 if (!(flags & SWS_FULL_CHR_H_INT)) {
1338 "%s output is not supported with half chroma resolution, switching to full\n",
1347 if (flags & SWS_FULL_CHR_H_INT &&
1370 "full chroma interpolation for destination format '%s' not yet implemented\n",
1372 flags &= ~SWS_FULL_CHR_H_INT;
1375 if (
isAnyRGB(dstFormat) && !(flags & SWS_FULL_CHR_H_INT))
1398 (flags & SWS_FAST_BILINEAR)))
1429 "output width is not a multiple of 32 -> no MMXEXT scaler\n");
1446 if (flags & SWS_FAST_BILINEAR) {
1453 c->
lumXInc = ((int64_t)(srcW - 2) << 16) / (dstW - 2) - 20;
1463 if (!unscaled && c->
gamma_flag && (srcFormat != tmpFmt || dstFormat != tmpFmt)) {
1468 srcW, srcH, tmpFmt, 64);
1481 flags, srcFilter, dstFilter, c->
param);
1503 if (dstFormat != tmpFmt) {
1505 dstW, dstH, tmpFmt, 64);
1510 dstW, dstH, dstFormat,
1524 srcW, srcH, tmpFormat, 64);
1529 srcW, srcH, tmpFormat,
1535 dstW, dstH, dstFormat,
1544 for (i = 0; i < 256; ++i){
1551 (!unscaled || unscaled && dstFormat != srcFormat && (srcFormat !=
AV_PIX_FMT_GRAYF32 ||
1556 if (CONFIG_SWSCALE_ALPHA &&
isALPHA(srcFormat) && !
isALPHA(dstFormat)) {
1561 dstFormat != tmpFormat ||
1562 usesHFilter || usesVFilter ||
1567 srcW, srcH, tmpFormat, 64);
1572 srcW, srcH, tmpFormat,
1582 dstW, dstH, dstFormat,
1597 #if HAVE_MMAP && HAVE_MPROTECT && defined(MAP_ANONYMOUS)
1605 #if HAVE_MMXEXT_INLINE
1615 PROT_READ | PROT_WRITE,
1616 MAP_PRIVATE | MAP_ANONYMOUS,
1619 PROT_READ | PROT_WRITE,
1620 MAP_PRIVATE | MAP_ANONYMOUS,
1622 #elif HAVE_VIRTUALALLOC
1626 PAGE_EXECUTE_READWRITE);
1630 PAGE_EXECUTE_READWRITE);
1636 #ifdef MAP_ANONYMOUS
1666 const int filterAlign =
X86_MMX(cpu_flags) ? 4 :
1672 srcW, dstW, filterAlign, 1 << 14,
1674 cpu_flags, srcFilter->
lumH, dstFilter->
lumH,
1682 (flags & SWS_BICUBLIN) ? (flags |
SWS_BILINEAR) : flags,
1683 cpu_flags, srcFilter->
chrH, dstFilter->
chrH,
1693 const int filterAlign =
X86_MMX(cpu_flags) ? 2 :
1698 c->
lumYInc, srcH, dstH, filterAlign, (1 << 12),
1700 cpu_flags, srcFilter->
lumV, dstFilter->
lumV,
1707 filterAlign, (1 << 12),
1708 (flags & SWS_BICUBLIN) ? (flags |
SWS_BILINEAR) : flags,
1709 cpu_flags, srcFilter->
chrV, dstFilter->
chrV,
1722 short *p = (
short *)&c->vYCoeffsBank[i];
1723 for (j = 0; j < 8; j++)
1729 short *p = (
short *)&c->vCCoeffsBank[i];
1730 for (j = 0; j < 8; j++)
1736 for (i = 0; i < 4; i++)
1748 const char *scaler =
NULL, *cpucaps;
1751 if (flags & scale_algorithms[i].
flag) {
1757 scaler =
"ehh flags invalid?!";
1778 cpucaps =
"AltiVec";
1786 "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
1789 "chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
1795 if (unscaled && !usesHFilter && !usesVFilter &&
1803 if (flags & SWS_PRINT_INFO)
1805 "using alpha blendaway %s -> %s special converter\n",
1811 if (unscaled && !usesHFilter && !usesVFilter &&
1817 if (flags & SWS_PRINT_INFO)
1819 "using unscaled %s -> %s special converter\n",
1829 int tmpW = sqrt(srcW * (int64_t)dstW);
1830 int tmpH = sqrt(srcH * (int64_t)dstH);
1836 if (srcW*(int64_t)srcH <= 4LL*dstW*dstH)
1840 tmpW, tmpH, tmpFormat, 64);
1845 tmpW, tmpH, tmpFormat,
1851 dstW, dstH, dstFormat,
1862 int flags,
const double *param)
1878 c->
param[0] = param[0];
1879 c->
param[1] = param[1];
1888 SwsFilter *dstFilter,
const double *param)
1893 dstW, dstH, dstFormat,
1909 for (i=0; i<a->
length; i++)
1918 for (i=0; i<a->
length; i++)
1923 float lumaSharpen,
float chromaSharpen,
1924 float chromaHShift,
float chromaVShift,
1931 if (lumaGBlur != 0.0) {
1939 if (chromaGBlur != 0.0) {
1950 if (chromaSharpen != 0.0) {
1961 if (lumaSharpen != 0.0) {
1972 if (chromaHShift != 0.0)
1975 if (chromaVShift != 0.0)
2024 const int length = (
int)(variance * quality + 0.5) | 1;
2026 double middle = (length - 1) * 0.5;
2029 if(variance < 0 || quality < 0)
2037 for (i = 0; i <
length; i++) {
2038 double dist = i - middle;
2039 vec->
coeff[i] =
exp(-dist * dist / (2 * variance * variance)) /
2040 sqrt(2 * variance *
M_PI);
2052 #if !FF_API_SWS_VECTOR
2063 for (i = 0; i <
length; i++)
2073 #if !FF_API_SWS_VECTOR
2086 for (i = 0; i < a->
length; i++)
2096 for (i = 0; i < a->
length; i++)
2097 a->
coeff[i] *= scalar;
2105 #if FF_API_SWS_VECTOR
2115 for (i = 0; i < a->
length; i++) {
2116 for (j = 0; j < b->
length; j++) {
2134 for (i = 0; i < a->
length; i++)
2142 #if FF_API_SWS_VECTOR
2152 for (i = 0; i < a->
length; i++)
2171 for (i = 0; i < a->
length; i++) {
2172 vec->
coeff[i + (length - 1) / 2 -
2179 #if !FF_API_SWS_VECTOR
2195 #if !FF_API_SWS_VECTOR
2211 #if FF_API_SWS_VECTOR
2255 #if !FF_API_SWS_VECTOR
2265 for (i = 0; i < a->
length; i++)
2266 if (a->
coeff[i] > max)
2269 for (i = 0; i < a->
length; i++)
2270 if (a->
coeff[i] < min)
2275 for (i = 0; i < a->
length; i++) {
2276 int x = (
int)((a->
coeff[i] - min) * 60.0 / range + 0.5);
2277 av_log(log_ctx, log_level,
"%1.3f ", a->
coeff[i]);
2279 av_log(log_ctx, log_level,
" ");
2280 av_log(log_ctx, log_level,
"|\n");
2311 for (i = 0; i < 4; i++)
2334 #elif HAVE_VIRTUALALLOC
2371 const double *
param)
2379 param = default_param;
2382 (context->
srcW != srcW ||
2383 context->
srcH != srcH ||
2385 context->
dstW != dstW ||
2386 context->
dstH != dstH ||
2388 context->
flags != flags ||
2389 context->
param[0] != param[0] ||
2390 context->
param[1] != param[1])) {
2410 context->
param[0] = param[0];
2411 context->
param[1] = param[1];
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
IEEE-754 single precision Y, 32bpp, big-endian.
planar GBR 4:4:4:4 40bpp, little-endian
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported output format, 0 otherwise.
static const FormatEntry format_entries[AV_PIX_FMT_NB]
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
static enum AVPixelFormat pix_fmt
static SwsVector * sws_sumVec(SwsVector *a, SwsVector *b)
av_cold void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation)
static int shift(int a, int b)
static int handle_0alpha(enum AVPixelFormat *format)
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
#define SWS_SRC_V_CHR_DROP_MASK
static const char * format[]
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int chrSrcH
Height of source chroma planes.
#define FF_ALLOCZ_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)
int ff_free_filters(SwsContext *c)
static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt)
#define LIBSWSCALE_VERSION_MICRO
uint8_t * chrMmxextFilterCode
Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
static void fill_rgb2yuv_table(SwsContext *c, const int table[4], int dstRange)
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
static int conv(int samples, float **pcm, char *buf, int channels)
8 bits gray, 8 bits alpha
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
uint8_t * lumMmxextFilterCode
Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
packed RGB 8:8:8, 24bpp, RGBRGB...
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
static av_cold int get_local_pos(SwsContext *s, int chr_subsample, int pos, int dir)
int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
int av_image_alloc(uint8_t *pointers[4], int linesizes[4], int w, int h, enum AVPixelFormat pix_fmt, int align)
Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordi...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
SwsVector * sws_getGaussianVec(double variance, double quality)
Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality, lower is lower quality.
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
int vChrDrop
Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user...
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */
int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
static double getSplineCoeff(double a, double b, double c, double d, double dist)
#define AV_PIX_FMT_GBRP10
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
int dstFormatBpp
Number of bits per pixel of the destination pixel format.
#define AV_PIX_FMT_BGRA64
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
Convenience header that includes libavutil's core.
static int handle_jpeg(enum AVPixelFormat *format)
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
static int isnan_vec(SwsVector *a)
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
#define SWS_SRC_V_CHR_DROP_SHIFT
const char * swscale_configuration(void)
Return the libswscale build-time configuration.
planar GBR 4:4:4 36bpp, little-endian
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
static atomic_int cpu_flags
const int32_t ff_yuv2rgb_coeffs[11][4]
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
int srcRange
0 = MPG YUV range, 1 = JPG YUV range (source image).
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
Y , 12bpp, little-endian.
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
planar GBR 4:4:4 36bpp, big-endian
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Macro definitions for various function/variable attributes.
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
int srcH
Height of source luma/alpha planes.
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
void sws_convVec(SwsVector *a, SwsVector *b)
planar GBRA 4:4:4:4 64bpp, big-endian
#define av_assert0(cond)
assert() equivalent, that is always enabled.
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
static uint16_t * alloc_gamma_tbl(double e)
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
int chrDstVSubSample
Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination i...
ptrdiff_t uv_off
offset (in pixels) between u and v planes
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
int length
number of coefficients in the vector
av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
8 bits with AV_PIX_FMT_RGB32 palette
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
SwsVector * sws_cloneVec(SwsVector *a)
int vChrFilterSize
Vertical filter size for chroma pixels.
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined ...
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define SWS_FULL_CHR_H_INT
int cascaded_tmpStride[4]
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
#define SWS_FAST_BILINEAR
SwsVector * sws_getConstVec(double c, int length)
Allocate and return a vector with length coefficients, all with the same value c. ...
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
planar GBR 4:4:4 48bpp, big-endian
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
SwsContext * sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Allocate and return an SwsContext.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
#define AV_LOG_VERBOSE
Detailed information.
int16_t rgb2xyz_matrix[3][4]
#define AV_PIX_FMT_YUV444P16
Y , 10bpp, little-endian.
enum AVPixelFormat dstFormat
Destination pixel format.
int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */
int chrSrcHSubSample
Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source imag...
static av_always_inline int isYUV(enum AVPixelFormat pix_fmt)
float uint2float_lut[256]
static SwsVector * sws_getShiftedVec(SwsVector *a, int shift)
static const uint16_t table[]
#define ROUNDED_DIV(a, b)
int32_t * vChrFilterPos
Array of vertical filter starting positions for each dst[i] for chroma planes.
int dstH
Height of destination luma/alpha planes.
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
SwsFilter * sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose)
planar GBR 4:4:4 27bpp, big-endian
#define INLINE_MMX(flags)
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
16 bits gray, 16 bits alpha (big-endian)
like NV12, with 16bpp per component, big-endian
int32_t * hChrFilterPos
Array of horizontal filter starting positions for each dst[i] for chroma planes.
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
int hLumFilterSize
Horizontal filter size for luma/alpha pixels.
SwsFunc ff_getSwsFunc(SwsContext *c)
Return function pointer to fastest main scaler path function depending on architecture and available ...
const char * description
human-readable description
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
#define PPC_ALTIVEC(flags)
#define SWS_MAX_REDUCE_CUTOFF
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
void sws_subVec(SwsVector *a, SwsVector *b)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level)
Print with av_log() a textual representation of the vector a if log_level <= av_log_level.
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
simple assert() macros that are a bit more flexible than ISO C assert().
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
like NV12, with 16bpp per component, little-endian
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
#define AV_PIX_FMT_YUV444P10
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
void sws_scaleVec(SwsVector *a, double scalar)
Scale all the coefficients of a by the scalar value.
int chrDstW
Width of destination chroma planes.
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
uint8_t * cascaded1_tmp[4]
void sws_normalizeVec(SwsVector *a, double height)
Scale all the coefficients of a so that their sum equals height.
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
struct SwsContext * sws_getCachedContext(struct SwsContext *context, int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Check if context can be reused, otherwise reallocate a new one.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define RETCODE_USE_CASCADE
static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt)
int32_t * hLumFilterPos
Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.
void sws_freeFilter(SwsFilter *filter)
int hChrFilterSize
Horizontal filter size for chroma pixels.
SwsVector * sws_allocVec(int length)
Allocate and return an uninitialized vector with length coefficients.
#define AV_PIX_FMT_YUV422P9
as above, but U and V bytes are swapped
int dstRange
0 = MPG YUV range, 1 = JPG YUV range (destination image).
planar GBR 4:4:4:4 48bpp, big-endian
ptrdiff_t uv_offx2
offset (in bytes) between u and v planes
planar GBR 4:4:4:4 40bpp, big-endian
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GRAY16
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
uint8_t * formatConvBuffer
#define INLINE_AMD3DNOW(flags)
static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
av_cold void ff_sws_rgb2rgb_init(void)
void sws_shiftVec(SwsVector *a, int shift)
void sws_freeContext(SwsContext *c)
Free the swscaler context swsContext.
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
packed RGB 8:8:8, 24bpp, BGRBGR...
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big...
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
av_cold void ff_sws_init_range_convert(SwsContext *c)
SwsContext * sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, const double *param)
Allocate and return an SwsContext.
unsigned swscale_version(void)
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation)
int srcColorspaceTable[4]
int dstW
Width of destination luma/alpha planes.
#define AV_PIX_FMT_YUV444P9
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
static void error(const char *err)
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
uint8_t * cascaded_tmp[4]
#define FF_ARRAY_ELEMS(a)
static const ScaleAlgorithm scale_algorithms[]
int cascaded1_tmpStride[4]
planar GBR 4:4:4:4 48bpp, little-endian
#define AV_PIX_FMT_YUV420P16
int32_t * vLumFilterPos
Array of vertical filter starting positions for each dst[i] for luma/alpha planes.
#define AV_PIX_FMT_BGR555
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
double * coeff
pointer to the list of coefficients
int flag
flag associated to the algorithm
#define AV_LOG_INFO
Standard information.
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
int dstColorspaceTable[4]
#define AV_PIX_FMT_GRAYF32
static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2], int srcPos, int dstPos)
void(* rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
const AVClass * av_class
info on struct for av_log
int16_t xyz2rgb_matrix[3][4]
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */
void sws_freeVec(SwsVector *a)
planar GBR 4:4:4 30bpp, big-endian
#define AV_CPU_FLAG_MMX
standard MMX
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
int chrDstH
Height of destination chroma planes.
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
planar GBR 4:4:4 42bpp, little-endian
#define SWS_ERROR_DIFFUSION
Replacements for frequently missing libm functions.
#define AV_PIX_FMT_YUV420P10
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
static SwsVector * sws_diffVec(SwsVector *a, SwsVector *b)
int lumMmxextFilterCodeSize
Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes...
Describe the class of an AVClass context structure.
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
int ff_init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode, int16_t *filter, int32_t *filterPos, int numSplits)
int vLumFilterSize
Vertical filter size for luma/alpha pixels.
static void handle_formats(SwsContext *c)
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
int chrMmxextFilterCodeSize
Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
planar GBR 4:4:4 42bpp, big-endian
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
#define AV_PIX_FMT_YUV420P9
const VDPAUPixFmtMap * map
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined ...
int16_t * vChrFilter
Array of vertical filter coefficients for chroma planes.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
int ff_init_filters(SwsContext *c)
Y , 14bpp, little-endian.
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */
int16_t * hLumFilter
Array of horizontal filter coefficients for luma/alpha planes.
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext.
#define AV_PIX_FMT_BGR565
#define AV_PIX_FMT_GBRP12
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
#define flags(name, subs,...)
#define AV_PIX_FMT_YUV422P10
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
static int handle_xyz(enum AVPixelFormat *format)
#define FF_ALLOC_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
void sws_addVec(SwsVector *a, SwsVector *b)
#define INLINE_MMXEXT(flags)
static double sws_dcVec(SwsVector *a)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
double param[2]
Input parameters for scaling algorithms that need them.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
planar GBRA 4:4:4:4 32bpp
#define FF_ALLOC_OR_GOTO(ctx, p, size, label)
planar GBR 4:4:4 27bpp, little-endian
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
enum AVPixelFormat srcFormat
Source pixel format.
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
struct SwsContext * cascaded_context[3]
#define SWS_PARAM_DEFAULT
#define SWS_FULL_CHR_H_INP
SwsFunc swscale
Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be fre...
static av_always_inline int diff(const uint32_t a, const uint32_t b)
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as lit...
int size_factor
size factor used when initing the filters
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
int srcFormatBpp
Number of bits per pixel of the source pixel format.
const AVClass ff_sws_context_class
Y , 16bpp, little-endian.
uint8_t is_supported_endianness
static const double coeff[2][5]
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
16 bits gray, 16 bits alpha (little-endian)
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported input format, 0 otherwise.
SwsVector * sws_getIdentityVec(void)
Allocate and return a vector with just one coefficient, with value 1.0.
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
int32_t input_rgb2yuv_table[16+40 *4]
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
int16_t * vLumFilter
Array of vertical filter coefficients for luma/alpha planes.
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar GBR 4:4:4 48bpp, little-endian
static void makenan_vec(SwsVector *a)
int16_t * hChrFilter
Array of horizontal filter coefficients for chroma planes.
#define av_malloc_array(a, b)
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined ...
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
int chrDstHSubSample
Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination...
int chrSrcW
Width of source chroma planes.
static av_always_inline int isFloat(enum AVPixelFormat pix_fmt)
int depth
Number of bits in the component.
IEEE-754 single precision Y, 32bpp, little-endian.
void ff_get_unscaled_swscale(SwsContext *c)
Set c->swscale to an unscaled converter if one exists for the specific source and destination formats...
planar GBRA 4:4:4:4 64bpp, little-endian
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
int srcW
Width of source luma/alpha planes.
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
static void fill_xyztables(struct SwsContext *c)
int chrSrcVSubSample
Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image...
int flags
Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
AVPixelFormat
Pixel format.
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
#define AV_PIX_FMT_YUV422P16
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
#define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)
planar GBR 4:4:4 30bpp, little-endian
static SwsVector * sws_getConvVec(SwsVector *a, SwsVector *b)
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
#define LIBSWSCALE_VERSION_INT
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
#define AV_CEIL_RSHIFT(a, b)
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
const char * swscale_license(void)
Return the libswscale license.