73 int X,
int Y,
int D,
int P);
76 #define OFFSET(x) offsetof(VectorscopeContext, x)
77 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
200 int depth, rgb, i, ret;
210 if ((s->
x == 1 && s->
y == 2) || (s->
x == 2 && s->
y == 1))
229 if (rgb && depth == 8)
231 else if (rgb && depth == 9)
233 else if (rgb && depth == 10)
235 else if (rgb && depth == 12)
241 else if (depth == 10)
243 else if (depth == 12)
259 outlink->
h = outlink->
w = s->
size;
270 for (i = 0; i < s->
size; i++)
278 const int dlinesize = out->
linesize[0] / 2;
280 const int max = s->
size - 1;
283 for (i = 0; i < out->
height; i++) {
284 for (j = 0; j < out->
width; j++) {
285 const int pos = i * dlinesize + j;
286 const int poa = (i - 1) * dlinesize + j;
287 const int pob = (i + 1) * dlinesize + j;
289 if (dpd[pos] && (((!j || !dpd[pos - 1]) || ((j == (out->
width - 1)) || !dpd[pos + 1]))
290 || ((!i || !dpd[poa]) || ((i == (out->
height - 1)) || !dpd[pob])))) {
299 const int dlinesize = out->
linesize[0] / 2;
301 const int max = s->
size - 1;
304 for (i = 0; i < out->
height; i++) {
305 for (j = 0; j < out->
width; j++) {
306 const int pos = i * dlinesize + j;
316 for (i = 0; i < out->
height; i++) {
317 for (j = 0; j < out->
width; j++) {
318 const int pos = i * dlinesize + j;
320 if (s->
peak[i][j] && (((!j || !s->
peak[i][j-1]) || ((j == (out->
width - 1)) || !s->
peak[i][j + 1]))
321 || ((!i || !s->
peak[i-1][j]) || ((i == (out->
height - 1)) || !s->
peak[i + 1][j])))) {
330 const int dlinesize = out->
linesize[0];
334 for (i = 0; i < out->
height; i++) {
335 for (j = 0; j < out->
width; j++) {
336 const int pos = i * dlinesize + j;
337 const int poa = (i - 1) * dlinesize + j;
338 const int pob = (i + 1) * dlinesize + j;
340 if (dpd[pos] && (((!j || !dpd[pos - 1]) || ((j == (out->
width - 1)) || !dpd[pos + 1]))
341 || ((!i || !dpd[poa]) || ((i == (out->
height - 1)) || !dpd[pob])))) {
350 const int dlinesize = out->
linesize[0];
354 for (i = 0; i < out->
height; i++) {
355 for (j = 0; j < out->
width; j++) {
356 const int pos = i * dlinesize + j;
366 for (i = 0; i < out->
height; i++) {
367 for (j = 0; j < out->
width; j++) {
368 const int pos = i * dlinesize + j;
370 if (s->
peak[i][j] && (((!j || !s->
peak[i][j-1]) || ((j == (out->
width - 1)) || !s->
peak[i][j + 1]))
371 || ((!i || !s->
peak[i-1][j]) || ((i == (out->
height - 1)) || !s->
peak[i + 1][j])))) {
402 const uint16_t *
const *
src = (
const uint16_t *
const *)in->
data;
403 const int slinesizex = in->
linesize[s->
x] / 2;
404 const int slinesizey = in->
linesize[s->
y] / 2;
405 const int slinesized = in->
linesize[pd] / 2;
406 const int dlinesize = out->
linesize[0] / 2;
408 const int px = s->
x, py = s->
y;
411 const uint16_t *spx = src[px];
412 const uint16_t *spy = src[py];
413 const uint16_t *spd = src[pd];
416 uint16_t **dst = (uint16_t **)out->
data;
417 uint16_t *dpx = dst[px];
418 uint16_t *dpy = dst[py];
419 uint16_t *dpd = dst[
pd];
420 const int max = s->
size - 1;
421 const int mid = s->
size / 2;
426 for (k = 0; k < 4 && dst[k]; k++) {
427 for (i = 0; i < out->
height ; i++)
428 for (j = 0; j < out->
width; j++)
438 for (i = 0; i <
h; i++) {
439 const int iwx = i * slinesizex;
440 const int iwy = i * slinesizey;
441 const int iwd = i * slinesized;
442 for (j = 0; j <
w; j++) {
443 const int x =
FFMIN(spx[iwx + j], max);
444 const int y =
FFMIN(spy[iwy + j], max);
445 const int z = spd[iwd + j];
446 const int pos = y * dlinesize +
x;
448 if (z < tmin || z > tmax)
455 for (i = 0; i <
h; i++) {
456 const int iwx = i * slinesizex;
457 const int iwy = i * slinesizey;
458 const int iwd = i * slinesized;
459 for (j = 0; j <
w; j++) {
460 const int x =
FFMIN(spx[iwx + j], max);
461 const int y =
FFMIN(spy[iwy + j], max);
462 const int z = spd[iwd + j];
463 const int pos = y * dlinesize +
x;
465 if (z < tmin || z > tmax)
477 for (i = 0; i <
h; i++) {
478 const int iw1 = i * slinesizex;
479 const int iw2 = i * slinesizey;
480 const int iwd = i * slinesized;
481 for (j = 0; j <
w; j++) {
482 const int x =
FFMIN(spx[iw1 + j], max);
483 const int y =
FFMIN(spy[iw2 + j], max);
484 const int z = spd[iwd + j];
485 const int pos = y * dlinesize +
x;
487 if (z < tmin || z > tmax)
497 for (i = 0; i <
h; i++) {
498 const int iw1 = i * slinesizex;
499 const int iw2 = i * slinesizey;
500 const int iwd = i * slinesized;
501 for (j = 0; j <
w; j++) {
502 const int x =
FFMIN(spx[iw1 + j], max);
503 const int y =
FFMIN(spy[iw2 + j], max);
504 const int z = spd[iwd + j];
505 const int pos = y * dlinesize +
x;
507 if (z < tmin || z > tmax)
511 dpd[pos] =
FFMIN(x + y, max);
519 for (i = 0; i <
h; i++) {
520 const int iw1 = i * slinesizex;
521 const int iw2 = i * slinesizey;
522 const int iwd = i * slinesized;
523 for (j = 0; j <
w; j++) {
524 const int x =
FFMIN(spx[iw1 + j], max);
525 const int y =
FFMIN(spy[iw2 + j], max);
526 const int z = spd[iwd + j];
527 const int pos = y * dlinesize +
x;
529 if (z < tmin || z > tmax)
539 for (i = 0; i < in->
height; i++) {
540 const int iwx = (i >>
vsub) * slinesizex;
541 const int iwy = (i >>
vsub) * slinesizey;
542 const int iwd = i * slinesized;
543 for (j = 0; j < in->
width; j++) {
544 const int x =
FFMIN(spx[iwx + (j >>
hsub)], max);
545 const int y =
FFMIN(spy[iwy + (j >>
hsub)], max);
546 const int z = spd[iwd + j];
547 const int pos = y * dlinesize +
x;
549 if (z < tmin || z > tmax)
552 dpd[pos] =
FFMAX(z, dpd[pos]);
565 for (i = 0; i < out->
height; i++) {
566 for (j = 0; j < out->
width; j++) {
567 int pos = i * dlinesize + j;
576 for (i = 0; i < out->
height; i++) {
577 for (j = 0; j < out->
width; j++) {
578 if (!dpd[i * dlinesize + j]) {
579 dpx[i * dlinesize + j] = j;
580 dpy[i * dlinesize + j] = i;
581 dpd[i * dlinesize + j] = mid;
586 for (i = 0; i < out->
height; i++) {
587 for (j = 0; j < out->
width; j++) {
588 if (!dpd[i * dlinesize + j]) {
589 dpx[i * dlinesize + j] = j;
590 dpy[i * dlinesize + j] = i;
591 dpd[i * dlinesize + j] = mid *
M_SQRT2 -
hypot(i - mid, j - mid);
601 const int slinesizex = in->
linesize[s->
x];
602 const int slinesizey = in->
linesize[s->
y];
603 const int slinesized = in->
linesize[pd];
604 const int dlinesize = out->
linesize[0];
606 const int px = s->
x, py = s->
y;
622 for (k = 0; k < 4 && dst[k]; k++)
623 for (i = 0; i < out->
height ; i++)
624 memset(dst[k] + i * out->
linesize[k],
632 for (i = 0; i <
h; i++) {
633 const int iwx = i * slinesizex;
634 const int iwy = i * slinesizey;
635 const int iwd = i * slinesized;
636 for (j = 0; j <
w; j++) {
637 const int x = spx[iwx + j];
638 const int y = spy[iwy + j];
639 const int z = spd[iwd + j];
640 const int pos = y * dlinesize +
x;
642 if (z < tmin || z >
tmax)
649 for (i = 0; i <
h; i++) {
650 const int iwx = i * slinesizex;
651 const int iwy = i * slinesizey;
652 const int iwd = i * slinesized;
653 for (j = 0; j <
w; j++) {
654 const int x = spx[iwx + j];
655 const int y = spy[iwy + j];
656 const int z = spd[iwd + j];
657 const int pos = y * dlinesize +
x;
659 if (z < tmin || z >
tmax)
671 for (i = 0; i <
h; i++) {
672 const int iw1 = i * slinesizex;
673 const int iw2 = i * slinesizey;
674 const int iwd = i * slinesized;
675 for (j = 0; j <
w; j++) {
676 const int x = spx[iw1 + j];
677 const int y = spy[iw2 + j];
678 const int z = spd[iwd + j];
679 const int pos = y * dlinesize +
x;
681 if (z < tmin || z >
tmax)
691 for (i = 0; i <
h; i++) {
692 const int iw1 = i * slinesizex;
693 const int iw2 = i * slinesizey;
694 const int iwd = i * slinesized;
695 for (j = 0; j <
w; j++) {
696 const int x = spx[iw1 + j];
697 const int y = spy[iw2 + j];
698 const int z = spd[iwd + j];
699 const int pos = y * dlinesize +
x;
701 if (z < tmin || z >
tmax)
705 dpd[pos] =
FFMIN(x + y, 255);
713 for (i = 0; i <
h; i++) {
714 const int iw1 = i * slinesizex;
715 const int iw2 = i * slinesizey;
716 const int iwd = i * slinesized;
717 for (j = 0; j <
w; j++) {
718 const int x = spx[iw1 + j];
719 const int y = spy[iw2 + j];
720 const int z = spd[iwd + j];
721 const int pos = y * dlinesize +
x;
723 if (z < tmin || z >
tmax)
733 for (i = 0; i < in->
height; i++) {
734 const int iwx = (i >>
vsub) * slinesizex;
735 const int iwy = (i >>
vsub) * slinesizey;
736 const int iwd = i * slinesized;
737 for (j = 0; j < in->
width; j++) {
738 const int x = spx[iwx + (j >>
hsub)];
739 const int y = spy[iwy + (j >>
hsub)];
740 const int z = spd[iwd + j];
741 const int pos = y * dlinesize +
x;
743 if (z < tmin || z >
tmax)
746 dpd[pos] =
FFMAX(z, dpd[pos]);
759 for (i = 0; i < out->
height; i++) {
760 for (j = 0; j < out->
width; j++) {
761 int pos = i * dlinesize + j;
770 for (i = 0; i < out->
height; i++) {
771 for (j = 0; j < out->
width; j++) {
772 if (!dpd[i * out->
linesize[pd] + j]) {
780 for (i = 0; i < out->
height; i++) {
781 for (j = 0; j < out->
width; j++) {
782 if (!dpd[i * out->
linesize[pd] + j]) {
793 "R",
"B",
"Cy",
"Yl",
"G",
"Mg",
798 { 81, 90, 240 }, { 41, 240, 110 }, { 170, 166, 16 },
799 { 210, 16, 146 }, { 145, 54, 34 }, { 106, 202, 222 },
800 { 162, 44, 142 }, { 131, 156, 44 }, { 112, 72, 58 },
801 { 84, 184, 198 }, { 65, 100, 212 }, { 35, 212, 114 },
802 { 235, 128, 128 }, { 16, 128, 128 } },
803 { { 63, 102, 240 }, { 32, 240, 118 }, { 188, 154, 16 },
804 { 219, 16, 138 }, { 173, 42, 26 }, { 78, 214, 230 },
805 { 28, 212, 120 }, { 51, 109, 212 }, { 63, 193, 204 },
806 { 133, 63, 52 }, { 145, 147, 44 }, { 168, 44, 136 },
807 { 235, 128, 128 }, { 16, 128, 128 } },
808 { { 81*2, 90*2, 240*2 }, { 41*2, 240*2, 110*2 }, { 170*2, 166*2, 16*2 },
809 { 210*2, 16*2, 146*2 }, { 145*2, 54*2, 34*2 }, { 106*2, 202*2, 222*2 },
810 { 162*2, 44*2, 142*2 }, { 131*2, 156*2, 44*2 }, { 112*2, 72*2, 58*2 },
811 { 84*2, 184*2, 198*2 }, { 65*2, 100*2, 212*2 }, { 35*2, 212*2, 114*2 },
812 { 470, 256, 256 }, { 32, 256, 256 } },
813 { { 63*2, 102*2, 240*2 }, { 32*2, 240*2, 118*2 }, { 188*2, 154*2, 16*2 },
814 { 219*2, 16*2, 138*2 }, { 173*2, 42*2, 26*2 }, { 78*2, 214*2, 230*2 },
815 { 28*2, 212*2, 120*2 }, { 51*2, 109*2, 212*2 }, { 63*2, 193*2, 204*2 },
816 { 133*2, 63*2, 52*2 }, { 145*2, 147*2, 44*2 }, { 168*2, 44*2, 136*2 },
817 { 470, 256, 256 }, { 32, 256, 256 } },
818 { { 81*4, 90*4, 240*4 }, { 41*4, 240*4, 110*4 }, { 170*4, 166*4, 16*4 },
819 { 210*4, 16*4, 146*4 }, { 145*4, 54*4, 34*4 }, { 106*4, 202*4, 222*4 },
820 { 162*4, 44*4, 142*4 }, { 131*4, 156*4, 44*4 }, { 112*4, 72*4, 58*4 },
821 { 84*4, 184*4, 198*4 }, { 65*4, 100*4, 212*4 }, { 35*4, 212*4, 114*4 },
822 { 940, 512, 512 }, { 64, 512, 512 } },
823 { { 63*4, 102*4, 240*4 }, { 32*4, 240*4, 118*4 }, { 188*4, 154*4, 16*4 },
824 { 219*4, 16*4, 138*4 }, { 173*4, 42*4, 26*4 }, { 78*4, 214*4, 230*4 },
825 { 28*4, 212*4, 120*4 }, { 51*4, 109*4, 212*4 }, { 63*4, 193*4, 204*4 },
826 { 133*4, 63*4, 52*4 }, { 145*4, 147*4, 44*4 }, { 168*4, 44*4, 136*4 },
827 { 940, 512, 512 }, { 64, 512, 512 } },
828 { { 81*8, 90*4, 240*8 }, { 41*8, 240*8, 110*8 }, { 170*8, 166*8, 16*8 },
829 { 210*8, 16*4, 146*8 }, { 145*8, 54*8, 34*8 }, { 106*8, 202*8, 222*8 },
830 { 162*8, 44*4, 142*8 }, { 131*8, 156*8, 44*8 }, { 112*8, 72*8, 58*8 },
831 { 84*8, 184*4, 198*8 }, { 65*8, 100*8, 212*8 }, { 35*8, 212*8, 114*8 },
832 { 1880, 1024, 1024 }, { 128, 1024, 1024 } },
833 { { 63*8, 102*8, 240*8 }, { 32*8, 240*8, 118*8 }, { 188*8, 154*8, 16*8 },
834 { 219*8, 16*8, 138*8 }, { 173*8, 42*8, 26*8 }, { 78*8, 214*8, 230*8 },
835 { 28*8, 212*8, 120*8 }, { 51*8, 109*8, 212*8 }, { 63*8, 193*8, 204*8 },
836 { 133*8, 63*8, 52*8 }, { 145*8, 147*8, 44*8 }, { 168*8, 44*8, 136*8 },
837 { 1880, 1024, 1024 }, { 128, 1024, 1024 } },
838 { { 81*16, 90*16, 240*16 }, { 41*16, 240*16, 110*16 }, { 170*16, 166*16, 16*16 },
839 { 210*16, 16*16, 146*16 }, { 145*16, 54*16, 34*16 }, { 106*16, 202*16, 222*16 },
840 { 162*16, 44*16, 142*16 }, { 131*16, 156*16, 44*16 }, { 112*16, 72*16, 58*16 },
841 { 84*16, 184*16, 198*16 }, { 65*16, 100*16, 212*16 }, { 35*16, 212*16, 114*16 },
842 { 3760, 2048, 2048 }, { 256, 2048, 2048 } },
843 { { 63*16, 102*16, 240*16 }, { 32*16, 240*16, 118*16 }, { 188*16, 154*16, 16*16 },
844 { 219*16, 16*16, 138*16 }, { 173*16, 42*16, 26*16 }, { 78*16, 214*16, 230*16 },
845 { 28*16, 212*16, 120*16 }, { 51*16, 109*16, 212*16 }, { 63*16, 193*16, 204*16 },
846 { 133*16, 63*16, 52*16 }, { 145*16, 147*16, 44*16 }, { 168*16, 44*16, 136*16 },
847 { 3760, 2048, 2048 }, { 256, 2048, 2048 } },
852 const float f = 1. - o;
853 const float V = o * v;
856 dst[ l - 3] = dst[ l - 3] * f +
V;
857 dst[ l + 3] = dst[ l + 3] * f +
V;
858 dst[-l - 3] = dst[-l - 3] * f +
V;
859 dst[-l + 3] = dst[-l + 3] * f +
V;
863 dst[ l - 3] = dst[ l - 3] * f +
V;
864 dst[ l + 3] = dst[ l + 3] * f +
V;
865 dst[ l - 2] = dst[ l - 2] * f +
V;
866 dst[ l + 2] = dst[ l + 2] * f +
V;
867 dst[-l - 3] = dst[-l - 3] * f +
V;
868 dst[-l + 3] = dst[-l + 3] * f +
V;
869 dst[-l - 2] = dst[-l - 2] * f +
V;
870 dst[-l + 2] = dst[-l + 2] * f +
V;
875 const float f = 1. - o;
876 const float V = o * v;
879 dst[ l - 3] = dst[ l - 3] * f +
V;
880 dst[ l + 3] = dst[ l + 3] * f +
V;
881 dst[-l - 3] = dst[-l - 3] * f +
V;
882 dst[-l + 3] = dst[-l + 3] * f +
V;
886 dst[ l - 3] = dst[ l - 3] * f +
V;
887 dst[ l + 3] = dst[ l + 3] * f +
V;
888 dst[ l - 2] = dst[ l - 2] * f +
V;
889 dst[ l + 2] = dst[ l + 2] * f +
V;
890 dst[-l - 3] = dst[-l - 3] * f +
V;
891 dst[-l + 3] = dst[-l + 3] * f +
V;
892 dst[-l - 2] = dst[-l - 2] * f +
V;
893 dst[-l + 2] = dst[-l + 2] * f +
V;
908 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
909 for (i = 0; txt[i]; i++) {
911 int v = color[
plane];
914 for (char_y = font_height - 1; char_y >= 0; char_y--) {
915 for (mask = 0x80;
mask; mask >>= 1) {
916 if (font[txt[i] * font_height + char_y] & mask)
917 p[0] = p[0] * o2 + v * o1;
934 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
935 for (i = 0; txt[i]; i++) {
937 int v = color[
plane];
939 uint16_t *p = (uint16_t *)(out->
data[plane] + y * out->
linesize[plane]) + (x + i * 8);
940 for (char_y = font_height - 1; char_y >= 0; char_y--) {
941 for (mask = 0x80;
mask; mask >>= 1) {
942 if (font[txt[i] * font_height + char_y] & mask)
943 p[0] = p[0] * o2 + v * o1;
954 const int max = s->
size - 1;
958 for (i = 0; i < 12; i++) {
994 for (i = 0; i < 6 && s->
flags & 4; i++) {
995 uint16_t
color[4] = { 0, 0, 0, 0 };
1014 x = av_clip(x, 0, out->
width - 9);
1015 y = av_clip(y, 0, out->
height - 9);
1025 for (i = 0; i < 12; i++) {
1061 for (i = 0; i < 6 && s->
flags & 4; i++) {
1080 x = av_clip(x, 0, out->
width - 9);
1081 y = av_clip(y, 0, out->
height - 9);
1088 const int max = s->
size - 1;
1090 const int m = s->
mult;
1093 for (i = 0; i < 12; i++) {
1126 for (i = 0; i < 6 && s->
flags & 4; i++) {
1127 const uint16_t
color[4] = { 128 * m, 0, 0, max };
1140 x = av_clip(x, 0, out->
width - 9);
1141 y = av_clip(y, 0, out->
height - 9);
1151 for (i = 0; i < 12; i++) {
1184 for (i = 0; i < 6 && s->
flags & 4; i++) {
1198 x = av_clip(x, 0, out->
width - 9);
1199 y = av_clip(y, 0, out->
height - 9);
1218 s->
cs = (s->
depth - 8) * 2 + 0;
1222 s->
cs = (s->
depth - 8) * 2 + 1;
1236 for (plane = 0; plane < 4; plane++) {
1237 if (out->
data[plane]) {
1268 if ((s->
x == 1 && s->
y == 2) || (s->
x == 2 && s->
y == 1))
1270 else if ((s->
x == 0 && s->
y == 2) || (s->
x == 2 && s->
y == 0))
1272 else if ((s->
x == 0 && s->
y == 1) || (s->
x == 1 && s->
y == 0))
1297 switch (inlink->
format) {
1351 .
name =
"vectorscope",
1354 .priv_class = &vectorscope_class,
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
static int config_input(AVFilterLink *inlink)
#define AV_PIX_FMT_YUVA422P9
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
AVFILTER_DEFINE_CLASS(vectorscope)
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA422P10
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Main libavfilter public API header.
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
int h
agreed upon image height
static void envelope_peak(VectorscopeContext *s, AVFrame *out)
#define AV_PIX_FMT_GBRP10
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
#define AV_PIX_FMT_YUV420P12
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
static void envelope_instant16(VectorscopeContext *s, AVFrame *out)
static enum AVPixelFormat out_yuv8_pix_fmts[]
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
static enum AVPixelFormat out_rgb12_pix_fmts[]
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
static enum AVPixelFormat in2_pix_fmts[]
#define AV_PIX_FMT_YUVA420P9
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_YUV422P12
A filter pad used for either input or output.
static const AVOption vectorscope_options[]
A link between two filters.
static enum AVPixelFormat out_rgb8_pix_fmts[]
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.
const uint8_t avpriv_cga_font[2048]
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
static const uint16_t mask[17]
static const uint16_t positions[][14][3]
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
static const AVFilterPad inputs[]
enum AVColorSpace colorspace
YUV colorspace type.
#define AV_PIX_FMT_GBRAP12
simple assert() macros that are a bit more flexible than ISO C assert().
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
#define AV_PIX_FMT_YUV444P10
static void draw_dots16(uint16_t *dst, int L, int v, float o)
static enum AVPixelFormat in_pix_fmts[]
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVFilter ff_vf_vectorscope
static enum AVPixelFormat out_yuv10_pix_fmts[]
int w
agreed upon image width
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
static enum AVPixelFormat out_rgb9_pix_fmts[]
#define AV_PIX_FMT_YUV422P9
static av_const double hypot(double x, double y)
static void envelope(VectorscopeContext *s, AVFrame *out)
static enum AVPixelFormat in1_pix_fmts[]
static void none_graticule(VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
static enum AVPixelFormat out_rgb10_pix_fmts[]
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static void green_graticule16(VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
static void vectorscope16(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static void draw_dots(uint8_t *dst, int L, int v, float o)
AVFilterContext * src
source filter
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV444P9
static void color_graticule(VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
static enum AVPixelFormat out_yuv12_pix_fmts[]
int format
agreed upon media format
static void envelope_peak16(VectorscopeContext *s, AVFrame *out)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
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...
static const AVFilterPad outputs[]
static int config_output(AVFilterLink *outlink)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
static av_cold void uninit(AVFilterContext *ctx)
#define AV_PIX_FMT_YUV420P10
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
static int query_formats(AVFilterContext *ctx)
static void draw_htext(AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint8_t color[4])
Rational number (pair of numerator and denominator).
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
const char * name
Filter name.
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV420P9
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterLink ** outputs
array of pointers to output links
#define AV_PIX_FMT_GBRP12
static void envelope_instant(VectorscopeContext *s, AVFrame *out)
#define flags(name, subs,...)
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static const char * positions_name[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_YUVA444P9
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static enum AVPixelFormat out_pix_fmts[]
static enum AVPixelFormat out_yuv9_pix_fmts[]
AVFilterContext * dst
dest filter
static void envelope16(VectorscopeContext *s, AVFrame *out)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
static void green_graticule(VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
void(* vectorscope)(struct VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
static void vectorscope8(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
static void draw_htext16(AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint16_t color[4])
int depth
Number of bits in the component.
void(* graticulef)(struct VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
AVPixelFormat
Pixel format.
mode
Use these values in ebur128_init (or'ed).
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
CGA/EGA/VGA ROM font data.
AVFilterFormats * out_formats
#define AV_CEIL_RSHIFT(a, b)
static void color_graticule16(VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)