23 #define _SVID_SOURCE // needed for MAP_ANONYMOUS
24 #define _DARWIN_C_SOURCE // needed for MAP_ANON
31 #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
32 #define MAP_ANONYMOUS MAP_ANON
36 #define WIN32_LEAN_AND_MEAN
66 return FFMPEG_CONFIGURATION;
71 #define LICENSE_PREFIX "libswscale license: "
75 #define RET 0xC3 // near return opcode for x86
230 #if FF_API_SWS_FORMAT_NAME
237 return "Unknown format";
245 return ((d * dist + c) * dist + b) * dist +
a;
248 b + 2.0 * c + 3.0 * d,
250 -b - 3.0 * c - 6.0 * d,
257 pos = (128 << chr_subsample) - 128;
260 return pos >> chr_subsample;
264 int *outFilterSize,
int xInc,
int srcW,
265 int dstW,
int filterAlign,
int one,
268 double param[2],
int srcPos,
int dstPos)
275 int64_t *filter2 = NULL;
276 const int64_t fone = 1LL << (54 -
FFMIN(
av_log2(srcW/dstW), 8));
284 if (
FFABS(xInc - 0x10000) < 10 && srcPos == dstPos) {
288 dstW *
sizeof(*filter) * filterSize, fail);
290 for (i = 0; i < dstW; i++) {
291 filter[i * filterSize] = fone;
299 dstW *
sizeof(*filter) * filterSize, fail);
301 xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
302 for (i = 0; i < dstW; i++) {
303 int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
305 (*filterPos)[i] = xx;
309 }
else if ((xInc <= (1 << 16) && (flags &
SWS_AREA)) ||
315 dstW *
sizeof(*filter) * filterSize, fail);
317 xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
318 for (i = 0; i < dstW; i++) {
319 int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
322 (*filterPos)[i] = xx;
324 for (j = 0; j < filterSize; j++) {
325 int64_t
coeff= fone -
FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16);
328 filter[i * filterSize + j] =
coeff;
339 else if (flags &
SWS_X)
358 filterSize = 1 + sizeFactor;
360 filterSize = 1 + (sizeFactor * srcW + dstW - 1) / dstW;
362 filterSize =
FFMIN(filterSize, srcW - 2);
363 filterSize =
FFMAX(filterSize, 1);
366 dstW *
sizeof(*filter) * filterSize, fail);
368 xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
369 for (i = 0; i < dstW; i++) {
370 int xx = (xDstInSrc - ((filterSize - 2) << 16)) / (1 << 17);
372 (*filterPos)[i] = xx;
373 for (j = 0; j < filterSize; j++) {
374 int64_t d = (
FFABS(((int64_t)xx << 17) - xDstInSrc)) << 13;
380 floatd = d * (1.0 / (1 << 30));
382 if (flags & SWS_BICUBIC) {
386 if (d >= 1LL << 31) {
389 int64_t dd = (d * d) >> 30;
390 int64_t ddd = (dd * d) >> 30;
393 coeff = (12 * (1 << 24) - 9 * B - 6 * C) * ddd +
394 (-18 * (1 << 24) + 12 * B + 6 * C) * dd +
395 (6 * (1 << 24) - 2 * B) * (1 << 30);
397 coeff = (-B - 6 * C) * ddd +
398 (6 * B + 30 * C) * dd +
399 (-12 * B - 48 * C) * d +
400 (8 * B + 24 * C) * (1 << 30);
402 coeff /= (1LL<<54)/fone;
405 else if (flags & SWS_X) {
406 double p = param ? param * 0.01 : 0.3;
407 coeff = d ? sin(d *
M_PI) / (d *
M_PI) : 1.0;
408 coeff *= pow(2.0, -p * d * d);
411 else if (flags & SWS_X) {
416 c = cos(floatd *
M_PI);
423 coeff = (c * 0.5 + 0.5) * fone;
424 }
else if (flags & SWS_AREA) {
425 int64_t d2 = d - (1 << 29);
426 if (d2 * xInc < -(1LL << (29 + 16)))
427 coeff = 1.0 * (1LL << (30 + 16));
428 else if (d2 * xInc < (1LL << (29 + 16)))
429 coeff = -d2 * xInc + (1LL << (29 + 16));
432 coeff *= fone >> (30 + 16);
433 }
else if (flags & SWS_GAUSS) {
435 coeff = (pow(2.0, -p * floatd * floatd)) * fone;
436 }
else if (flags & SWS_SINC) {
437 coeff = (d ? sin(floatd *
M_PI) / (floatd *
M_PI) : 1.0) * fone;
438 }
else if (flags & SWS_LANCZOS) {
440 coeff = (d ? sin(floatd *
M_PI) * sin(floatd * M_PI / p) /
441 (floatd * floatd * M_PI * M_PI / p) : 1.0) * fone;
444 }
else if (flags & SWS_BILINEAR) {
445 coeff = (1 << 30) - d;
449 }
else if (flags & SWS_SPLINE) {
450 double p = -2.196152422706632;
456 filter[i * filterSize + j] =
coeff;
459 xDstInSrc += 2 * xInc;
467 filter2Size = filterSize;
469 filter2Size += srcFilter->
length - 1;
471 filter2Size += dstFilter->
length - 1;
475 for (i = 0; i < dstW; i++) {
479 for (k = 0; k < srcFilter->
length; k++) {
480 for (j = 0; j < filterSize; j++)
481 filter2[i * filter2Size + k + j] +=
482 srcFilter->
coeff[k] * filter[i * filterSize + j];
485 for (j = 0; j < filterSize; j++)
486 filter2[i * filter2Size + j] = filter[i * filterSize + j];
490 (*filterPos)[i] += (filterSize - 1) / 2 - (filter2Size - 1) / 2;
497 for (i = dstW - 1; i >= 0; i--) {
498 int min = filter2Size;
500 int64_t cutOff = 0.0;
503 for (j = 0; j < filter2Size; j++) {
505 cutOff +=
FFABS(filter2[i * filter2Size]);
512 if (i < dstW - 1 && (*filterPos)[i] >= (*filterPos)[i + 1])
516 for (k = 1; k < filter2Size; k++)
517 filter2[i * filter2Size + k - 1] = filter2[i * filter2Size + k];
518 filter2[i * filter2Size + k - 1] = 0;
524 for (j = filter2Size - 1; j > 0; j--) {
525 cutOff +=
FFABS(filter2[i * filter2Size + j]);
532 if (min > minFilterSize)
538 if (minFilterSize < 5)
544 if (minFilterSize < 3)
550 if (minFilterSize == 1 && filterAlign == 2)
555 filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1));
557 filter =
av_malloc(filterSize * dstW *
sizeof(*filter));
560 av_log(NULL,
AV_LOG_ERROR,
"sws: filterSize %d is too large, try less extreem scaling or increase MAX_FILTER_SIZE and recompile\n", filterSize);
563 *outFilterSize = filterSize;
567 "SwScaler: reducing / aligning filtersize %d -> %d\n",
568 filter2Size, filterSize);
570 for (i = 0; i < dstW; i++) {
573 for (j = 0; j < filterSize; j++) {
574 if (j >= filter2Size)
575 filter[i * filterSize + j] = 0;
577 filter[i * filterSize + j] = filter2[i * filter2Size + j];
579 filter[i * filterSize + j] = 0;
586 for (i = 0; i < dstW; i++) {
588 if ((*filterPos)[i] < 0) {
590 for (j = 1; j < filterSize; j++) {
591 int left =
FFMAX(j + (*filterPos)[i], 0);
592 filter[i * filterSize + left] += filter[i * filterSize + j];
593 filter[i * filterSize + j] = 0;
598 if ((*filterPos)[i] + filterSize > srcW) {
599 int shift = (*filterPos)[i] + filterSize - srcW;
601 for (j = filterSize - 2; j >= 0; j--) {
602 int right =
FFMIN(j + shift, filterSize - 1);
603 filter[i * filterSize + right] += filter[i * filterSize + j];
604 filter[i * filterSize + j] = 0;
606 (*filterPos)[i]= srcW - filterSize;
613 *outFilterSize * (dstW + 3) *
sizeof(int16_t), fail);
616 for (i = 0; i < dstW; i++) {
621 for (j = 0; j < filterSize; j++) {
622 sum += filter[i * filterSize + j];
624 sum = (sum + one / 2) / one;
629 for (j = 0; j < *outFilterSize; j++) {
630 int64_t
v = filter[i * filterSize + j] + error;
632 (*outFilter)[i * (*outFilterSize) + j] = intV;
633 error = v - intV * sum;
637 (*filterPos)[dstW + 0] =
638 (*filterPos)[dstW + 1] =
639 (*filterPos)[dstW + 2] = (*filterPos)[dstW - 1];
641 for (i = 0; i < *outFilterSize; i++) {
642 int k = (dstW - 1) * (*outFilterSize) + i;
643 (*outFilter)[k + 1 * (*outFilterSize)] =
644 (*outFilter)[k + 2 * (*outFilterSize)] =
645 (*outFilter)[k + 3 * (*outFilterSize)] = (*outFilter)[k];
658 #if HAVE_MMXEXT_INLINE
659 static av_cold int init_hscaler_mmxext(
int dstW,
int xInc,
uint8_t *filterCode,
688 "movq (%%"REG_d
", %%"REG_a
"), %%mm3 \n\t"
689 "movd (%%"REG_c
", %%"REG_S
"), %%mm0 \n\t"
690 "movd 1(%%"REG_c
", %%"REG_S
"), %%mm1 \n\t"
691 "punpcklbw %%mm7, %%mm1 \n\t"
692 "punpcklbw %%mm7, %%mm0 \n\t"
693 "pshufw $0xFF, %%mm1, %%mm1 \n\t"
695 "pshufw $0xFF, %%mm0, %%mm0 \n\t"
697 "psubw %%mm1, %%mm0 \n\t"
698 "movl 8(%%"REG_b
", %%"REG_a
"), %%esi \n\t"
699 "pmullw %%mm3, %%mm0 \n\t"
700 "psllw $7, %%mm1 \n\t"
701 "paddw %%mm1, %%mm0 \n\t"
703 "movq %%mm0, (%%"REG_D
", %%"REG_a
") \n\t"
705 "add $8, %%"REG_a
" \n\t"
720 :
"=r" (fragmentA),
"=r" (imm8OfPShufW1A),
"=r" (imm8OfPShufW2A),
721 "=r" (fragmentLengthA)
728 "movq (%%"REG_d
", %%"REG_a
"), %%mm3 \n\t"
729 "movd (%%"REG_c
", %%"REG_S
"), %%mm0 \n\t"
730 "punpcklbw %%mm7, %%mm0 \n\t"
731 "pshufw $0xFF, %%mm0, %%mm1 \n\t"
733 "pshufw $0xFF, %%mm0, %%mm0 \n\t"
735 "psubw %%mm1, %%mm0 \n\t"
736 "movl 8(%%"REG_b
", %%"REG_a
"), %%esi \n\t"
737 "pmullw %%mm3, %%mm0 \n\t"
738 "psllw $7, %%mm1 \n\t"
739 "paddw %%mm1, %%mm0 \n\t"
741 "movq %%mm0, (%%"REG_D
", %%"REG_a
") \n\t"
743 "add $8, %%"REG_a
" \n\t"
758 :
"=r" (fragmentB),
"=r" (imm8OfPShufW1B),
"=r" (imm8OfPShufW2B),
759 "=r" (fragmentLengthB)
765 for (i = 0; i < dstW / numSplits; i++) {
770 int b = ((xpos + xInc) >> 16) - xx;
771 int c = ((xpos + xInc * 2) >> 16) - xx;
772 int d = ((xpos + xInc * 3) >> 16) - xx;
773 int inc = (d + 1 < 4);
774 uint8_t *fragment = (d + 1 < 4) ? fragmentB : fragmentA;
775 x86_reg imm8OfPShufW1 = (d + 1 < 4) ? imm8OfPShufW1B : imm8OfPShufW1A;
776 x86_reg imm8OfPShufW2 = (d + 1 < 4) ? imm8OfPShufW2B : imm8OfPShufW2A;
777 x86_reg fragmentLength = (d + 1 < 4) ? fragmentLengthB : fragmentLengthA;
778 int maxShift = 3 - (d + inc);
782 filter[i] = ((xpos & 0xFFFF) ^ 0xFFFF) >> 9;
783 filter[i + 1] = (((xpos + xInc) & 0xFFFF) ^ 0xFFFF) >> 9;
784 filter[i + 2] = (((xpos + xInc * 2) & 0xFFFF) ^ 0xFFFF) >> 9;
785 filter[i + 3] = (((xpos + xInc * 3) & 0xFFFF) ^ 0xFFFF) >> 9;
786 filterPos[i / 2] = xx;
788 memcpy(filterCode + fragmentPos, fragment, fragmentLength);
790 filterCode[fragmentPos + imm8OfPShufW1] = (a + inc) |
794 filterCode[fragmentPos + imm8OfPShufW2] = a | (b << 2) |
798 if (i + 4 - inc >= dstW)
800 else if ((filterPos[i / 2] & 3) <= maxShift)
801 shift = filterPos[i / 2] & 3;
803 if (shift && i >= shift) {
804 filterCode[fragmentPos + imm8OfPShufW1] += 0x55 *
shift;
805 filterCode[fragmentPos + imm8OfPShufW2] += 0x55 *
shift;
806 filterPos[i / 2] -=
shift;
810 fragmentPos += fragmentLength;
813 filterCode[fragmentPos] =
RET;
818 filterPos[((i / 2) + 1) & (~1)] = xpos >> 16;
820 return fragmentPos + 1;
826 int64_t
W,
V, Z, Cy, Cu, Cv;
827 int64_t vr = table[0];
828 int64_t ub = table[1];
829 int64_t ug = -table[2];
830 int64_t vg = -table[3];
835 static const int8_t map[] = {
860 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
861 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
862 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
863 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
864 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
865 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
866 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
867 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
904 c->input_rgb2yuv_table[
BY_IDX] = ((int)(0.114 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
905 c->input_rgb2yuv_table[
BV_IDX] = (-(int)(0.081 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
906 c->input_rgb2yuv_table[
BU_IDX] = ((int)(0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
907 c->input_rgb2yuv_table[
GY_IDX] = ((int)(0.587 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
908 c->input_rgb2yuv_table[
GV_IDX] = (-(int)(0.419 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
909 c->input_rgb2yuv_table[
GU_IDX] = (-(int)(0.331 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
910 c->input_rgb2yuv_table[
RY_IDX] = ((int)(0.299 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
911 c->input_rgb2yuv_table[
RV_IDX] = ((int)(0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
912 c->input_rgb2yuv_table[
RU_IDX] = (-(int)(0.169 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5));
915 AV_WL16(p + 16*4 + 2*i, map[i] >= 0 ? c->input_rgb2yuv_table[map[i]] : 0);
925 static const int16_t xyz2rgb_matrix[3][4] = {
926 {13270, -6295, -2041},
928 { 228, -835, 4329} };
929 static const int16_t rgb2xyz_matrix[3][4] = {
933 static int16_t xyzgamma_tab[4096], rgbgamma_tab[4096], xyzgammainv_tab[4096], rgbgammainv_tab[4096];
942 if (rgbgamma_tab[4095])
946 for (i = 0; i < 4096; i++) {
947 xyzgamma_tab[i] =
lrint(pow(i / 4095.0, xyzgamma) * 4095.0);
948 rgbgamma_tab[i] =
lrint(pow(i / 4095.0, rgbgamma) * 4095.0);
949 xyzgammainv_tab[i] =
lrint(pow(i / 4095.0, xyzgammainv) * 4095.0);
950 rgbgammainv_tab[i] =
lrint(pow(i / 4095.0, rgbgammainv) * 4095.0);
955 int srcRange,
const int table[4],
int dstRange,
956 int brightness,
int contrast,
int saturation)
986 contrast, saturation);
991 contrast, saturation);
1000 int *srcRange,
int **
table,
int *dstRange,
1001 int *brightness,
int *contrast,
int *saturation)
1088 int usesVFilter, usesHFilter;
1090 SwsFilter dummyFilter = { NULL, NULL, NULL, NULL };
1095 int dst_stride =
FFALIGN(dstW *
sizeof(int16_t) + 66, 16);
1108 unscaled = (srcW == dstW && srcH == dstH);
1119 av_log(c,
AV_LOG_WARNING,
"deprecated pixel format used, make sure you did set range correctly\n");
1154 if (dstW < srcW && dstH < srcH)
1156 else if (dstW > srcW && dstH > srcH)
1161 }
else if (i & (i - 1)) {
1163 "Exactly one scaler algorithm must be chosen, got %X\n", i);
1167 if (srcW < 1 || srcH < 1 || dstW < 1 || dstH < 1) {
1171 srcW, srcH, dstW, dstH);
1176 dstFilter = &dummyFilter;
1178 srcFilter = &dummyFilter;
1180 c->
lumXInc = (((int64_t)srcW << 16) + (dstW >> 1)) / dstW;
1181 c->
lumYInc = (((int64_t)srcH << 16) + (dstH >> 1)) / dstH;
1184 c->
vRounder = 4 * 0x0001000100010001ULL;
1186 usesVFilter = (srcFilter->
lumV && srcFilter->
lumV->
length > 1) ||
1190 usesHFilter = (srcFilter->
lumH && srcFilter->
lumH->
length > 1) ||
1210 av_log(c,
AV_LOG_DEBUG,
"Forcing full internal H chroma due to input having non subsampled chroma\n");
1227 if (!(flags & SWS_FULL_CHR_H_INT)) {
1230 "Desired dithering only supported in full chroma interpolation for destination format '%s'\n",
1236 if (flags & SWS_FULL_CHR_H_INT) {
1239 "Ordered dither is not supported in full chroma interpolation for destination format '%s'\n",
1246 if (!(flags & SWS_FULL_CHR_H_INT)) {
1248 "%s output is not supported with half chroma resolution, switching to full\n",
1257 if (flags & SWS_FULL_CHR_H_INT &&
1272 "full chroma interpolation for destination format '%s' not yet implemented\n",
1274 flags &= ~SWS_FULL_CHR_H_INT;
1277 if (
isAnyRGB(dstFormat) && !(flags & SWS_FULL_CHR_H_INT))
1309 if (unscaled && !usesHFilter && !usesVFilter &&
1316 "using unscaled %s -> %s special converter\n",
1342 "output width is not a multiple of 32 -> no MMXEXT scaler\n");
1359 if (flags & SWS_FAST_BILINEAR) {
1366 c->
lumXInc = ((int64_t)(srcW - 2) << 16) / (dstW - 2) - 20;
1371 #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
1375 #if HAVE_MMXEXT_INLINE
1381 NULL, NULL, NULL, 4);
1385 PROT_READ | PROT_WRITE,
1386 MAP_PRIVATE | MAP_ANONYMOUS,
1389 PROT_READ | PROT_WRITE,
1390 MAP_PRIVATE | MAP_ANONYMOUS,
1392 #elif HAVE_VIRTUALALLOC
1396 PAGE_EXECUTE_READWRITE);
1400 PAGE_EXECUTE_READWRITE);
1406 #ifdef MAP_ANONYMOUS
1436 const int filterAlign =
X86_MMX(cpu_flags) ? 4 :
1441 srcW, dstW, filterAlign, 1 << 14,
1443 cpu_flags, srcFilter->
lumH, dstFilter->
lumH,
1451 (flags & SWS_BICUBLIN) ? (flags |
SWS_BILINEAR) : flags,
1452 cpu_flags, srcFilter->
chrH, dstFilter->
chrH,
1462 const int filterAlign =
X86_MMX(cpu_flags) ? 2 :
1466 c->
lumYInc, srcH, dstH, filterAlign, (1 << 12),
1468 cpu_flags, srcFilter->
lumV, dstFilter->
lumV,
1475 filterAlign, (1 << 12),
1476 (flags & SWS_BICUBLIN) ? (flags |
SWS_BILINEAR) : flags,
1477 cpu_flags, srcFilter->
chrV, dstFilter->
chrV,
1490 short *p = (
short *)&c->vYCoeffsBank[i];
1491 for (j = 0; j < 8; j++)
1497 short *p = (
short *)&c->vCCoeffsBank[i];
1498 for (j = 0; j < 8; j++)
1507 for (i = 0; i < dstH; i++) {
1508 int chrI = (int64_t)i * c->
chrDstH / dstH;
1523 for (i = 0; i < 4; i++)
1538 dst_stride + 16, fail);
1546 dst_stride * 2 + 32, fail);
1551 if (CONFIG_SWSCALE_ALPHA && c->
alpPixBuf)
1554 dst_stride + 16, fail);
1562 for(j=0; j<dst_stride/2+1; j++)
1565 for(j=0; j<dst_stride+1; j++)
1571 const char *scaler, *cpucaps;
1572 if (flags & SWS_FAST_BILINEAR)
1573 scaler =
"FAST_BILINEAR scaler";
1575 scaler =
"BILINEAR scaler";
1577 scaler =
"BICUBIC scaler";
1578 else if (flags &
SWS_X)
1579 scaler =
"Experimental scaler";
1581 scaler =
"Nearest Neighbor / POINT scaler";
1583 scaler =
"Area Averaging scaler";
1585 scaler =
"luma BICUBIC / chroma BILINEAR scaler";
1587 scaler =
"Gaussian scaler";
1589 scaler =
"Sinc scaler";
1591 scaler =
"Lanczos scaler";
1593 scaler =
"Bicubic spline scaler";
1595 scaler =
"ehh flags invalid?!";
1617 cpucaps =
"AltiVec";
1625 "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
1628 "chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
1639 #if FF_API_SWS_GETCONTEXT
1643 SwsFilter *dstFilter,
const double *param)
1659 c->
param[0] = param[0];
1660 c->
param[1] = param[1];
1673 float lumaSharpen,
float chromaSharpen,
1674 float chromaHShift,
float chromaVShift,
1681 if (lumaGBlur != 0.0) {
1689 if (chromaGBlur != 0.0) {
1697 if (chromaSharpen != 0.0) {
1706 if (lumaSharpen != 0.0) {
1715 if (chromaHShift != 0.0)
1718 if (chromaVShift != 0.0)
1738 if(length <= 0 || length > INT_MAX/
sizeof(
double))
1753 const int length = (int)(variance * quality + 0.5) | 1;
1755 double middle = (length - 1) * 0.5;
1758 if(variance < 0 || quality < 0)
1766 for (i = 0; i <
length; i++) {
1767 double dist = i - middle;
1768 vec->
coeff[i] = exp(-dist * dist / (2 * variance * variance)) /
1769 sqrt(2 * variance *
M_PI);
1785 for (i = 0; i <
length; i++)
1801 for (i = 0; i < a->
length; i++)
1811 for (i = 0; i < a->
length; i++)
1812 a->
coeff[i] *= scalar;
1829 for (i = 0; i < a->
length; i++) {
1830 for (j = 0; j < b->
length; j++) {
1847 for (i = 0; i < a->
length; i++)
1864 for (i = 0; i < a->
length; i++)
1882 for (i = 0; i < a->
length; i++) {
1883 vec->
coeff[i + (length - 1) / 2 -
1945 for (i = 0; i < a->
length; i++)
1946 if (a->
coeff[i] > max)
1949 for (i = 0; i < a->
length; i++)
1950 if (a->
coeff[i] < min)
1955 for (i = 0; i < a->
length; i++) {
1956 int x = (int)((a->
coeff[i] - min) * 60.0 / range + 0.5);
1957 av_log(log_ctx, log_level,
"%1.3f ", a->
coeff[i]);
1959 av_log(log_ctx, log_level,
" ");
1960 av_log(log_ctx, log_level,
"|\n");
2004 if (CONFIG_SWSCALE_ALPHA && c->
alpPixBuf) {
2010 for (i = 0; i < 4; i++)
2033 #elif HAVE_VIRTUALALLOC
2058 const double *
param)
2064 param = default_param;
2067 (context->
srcW != srcW ||
2068 context->
srcH != srcH ||
2070 context->
dstW != dstW ||
2071 context->
dstH != dstH ||
2073 context->
flags != flags ||
2074 context->
param[0] != param[0] ||
2075 context->
param[1] != param[1])) {
2090 context->
param[0] = param[0];
2091 context->
param[1] = param[1];