120 int jobnr,
int nb_jobs);
125 float o1,
float o2,
const char *txt,
131 #define OFFSET(x) offsetof(WaveformContext, x)
132 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
314 int depth, depth2,
rgb,
i, ret,
ncomp, ncomp2;
316 if (!
ctx->inputs[0]->incfg.formats ||
317 !
ctx->inputs[0]->incfg.formats->nb_formats) {
333 if (!
ctx->inputs[0]->outcfg.formats) {
338 avff =
ctx->inputs[0]->incfg.formats;
339 avff2 =
ctx->inputs[0]->outcfg.formats;
345 depth =
desc->comp[0].depth;
347 if (
ncomp != ncomp2 || depth != depth2)
352 depth !=
desc->comp[0].depth)
364 else if (
rgb && depth == 8 &&
ncomp > 2)
366 else if (
rgb && depth == 9 &&
ncomp > 2)
368 else if (
rgb && depth == 10 &&
ncomp > 2)
370 else if (
rgb && depth == 12 &&
ncomp > 2)
372 else if (depth == 8 &&
ncomp > 2)
374 else if (depth == 9 &&
ncomp > 2)
376 else if (depth == 10 &&
ncomp > 2)
378 else if (depth == 12 &&
ncomp > 2)
390 const int dst_linesize =
out->linesize[component] / 2;
391 const int bg =
s->bg_color[component] * (
s->max / 256);
392 const int limit =
s->max - 1;
393 const int dst_h =
s->display ==
PARADE ?
out->height /
s->acomp :
out->height;
394 const int dst_w =
s->display ==
PARADE ?
out->width /
s->acomp :
out->width;
395 const int start =
s->estart[plane];
396 const int end =
s->eend[plane];
402 for (y = start; y < end; y++) {
403 dst = (uint16_t *)
out->data[component] + y * dst_linesize + x;
409 for (y = end - 1; y >= start; y--) {
410 dst = (uint16_t *)
out->data[component] + y * dst_linesize + x;
419 dst = (uint16_t *)
out->data[component] + y * dst_linesize;
420 for (x = start; x < end; x++) {
426 for (x = end - 1; x >= start; x--) {
438 const int dst_linesize =
out->linesize[component];
439 const uint8_t bg =
s->bg_color[component];
440 const int dst_h =
s->display ==
PARADE ?
out->height /
s->acomp :
out->height;
441 const int dst_w =
s->display ==
PARADE ?
out->width /
s->acomp :
out->width;
442 const int start =
s->estart[plane];
443 const int end =
s->eend[plane];
449 for (y = start; y < end; y++) {
450 dst =
out->data[component] + y * dst_linesize + x;
456 for (y = end - 1; y >= start; y--) {
457 dst =
out->data[component] + y * dst_linesize + x;
466 dst =
out->data[component] + y * dst_linesize;
467 for (x = start; x < end; x++) {
473 for (x = end - 1; x >= start; x--) {
485 const int dst_linesize =
out->linesize[component] / 2;
486 const int bg =
s->bg_color[component] * (
s->max / 256);
487 const int limit =
s->max - 1;
488 const int dst_h =
s->display ==
PARADE ?
out->height /
s->acomp :
out->height;
489 const int dst_w =
s->display ==
PARADE ?
out->width /
s->acomp :
out->width;
490 const int start =
s->estart[plane];
491 const int end =
s->eend[plane];
492 int *
emax =
s->emax[plane][component];
493 int *
emin =
s->emin[plane][component];
499 for (y = start; y < end && y <
emin[x -
offset]; y++) {
500 dst = (uint16_t *)
out->data[component] + y * dst_linesize + x;
506 for (y = end - 1; y >= start && y >=
emax[x -
offset]; y--) {
507 dst = (uint16_t *)
out->data[component] + y * dst_linesize + x;
515 if (
s->envelope == 3)
519 dst = (uint16_t *)
out->data[component] +
emin[x -
offset] * dst_linesize + x;
521 dst = (uint16_t *)
out->data[component] +
emax[x -
offset] * dst_linesize + x;
526 dst = (uint16_t *)
out->data[component] + y * dst_linesize;
533 for (x = end - 1; x >= start && x >=
emax[y -
offset]; x--) {
541 if (
s->envelope == 3)
545 dst = (uint16_t *)
out->data[component] + y * dst_linesize +
emin[y -
offset];
547 dst = (uint16_t *)
out->data[component] + y * dst_linesize +
emax[y -
offset];
555 const int dst_linesize =
out->linesize[component];
556 const int bg =
s->bg_color[component];
557 const int dst_h =
s->display ==
PARADE ?
out->height /
s->acomp :
out->height;
558 const int dst_w =
s->display ==
PARADE ?
out->width /
s->acomp :
out->width;
559 const int start =
s->estart[plane];
560 const int end =
s->eend[plane];
561 int *
emax =
s->emax[plane][component];
562 int *
emin =
s->emin[plane][component];
568 for (y = start; y < end && y <
emin[x -
offset]; y++) {
569 dst =
out->data[component] + y * dst_linesize + x;
575 for (y = end - 1; y >= start && y >=
emax[x -
offset]; y--) {
576 dst =
out->data[component] + y * dst_linesize + x;
584 if (
s->envelope == 3)
588 dst =
out->data[component] +
emin[x -
offset] * dst_linesize + x;
590 dst =
out->data[component] +
emax[x -
offset] * dst_linesize + x;
595 dst =
out->data[component] + y * dst_linesize;
596 for (x = start; x < end && x <
emin[y -
offset]; x++) {
602 for (x = end - 1; x >= start && x >=
emax[y -
offset]; x--) {
610 if (
s->envelope == 3)
614 dst =
out->data[component] + y * dst_linesize +
emin[y -
offset];
616 dst =
out->data[component] + y * dst_linesize +
emax[y -
offset];
624 if (
s->envelope == 0) {
626 }
else if (
s->envelope == 1) {
635 if (
s->envelope == 0) {
637 }
else if (
s->envelope == 1) {
679 int offset_y,
int offset_x,
681 int jobnr,
int nb_jobs)
683 const int plane =
s->desc->comp[component].plane;
684 const int dplane = (
s->rgb ||
s->display ==
OVERLAY) ? plane : 0;
685 const int shift_w =
s->shift_w[component];
686 const int shift_h =
s->shift_h[component];
687 const int src_linesize =
in->linesize[plane] / 2;
688 const int dst_linesize =
out->linesize[dplane] / 2;
689 const int dst_signed_linesize = dst_linesize * (
mirror == 1 ? -1 : 1);
690 const int limit =
s->max - 1;
694 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
695 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
696 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
697 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
699 const uint16_t *src_data = (
const uint16_t *)
in->data[plane] + sliceh_start * src_linesize;
700 uint16_t *dst_data = (uint16_t *)
out->data[dplane] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
701 uint16_t *
const dst_bottom_line = dst_data + dst_linesize * (
s->size - 1);
702 uint16_t *
const dst_line = (
mirror ? dst_bottom_line : dst_data);
709 for (y = sliceh_start; y < sliceh_end; y++) {
710 const uint16_t *src_data_end = src_data + slicew_end;
711 uint16_t *dst = dst_line + slicew_start * step;
713 for (p = src_data + slicew_start; p < src_data_end; p++) {
715 int i = 0, v =
FFMIN(*p, limit);
719 target = dst++ + dst_signed_linesize * v;
721 }
while (++
i < step);
723 uint16_t *row = dst_data;
726 target = row - v - 1;
731 }
while (++
i < step);
734 src_data += src_linesize;
735 dst_data += dst_linesize * step;
738 if (
s->display !=
OVERLAY && column && !
s->rgb) {
739 const int mult =
s->max / 256;
740 const int bg =
s->bg_color[0] *
mult;
741 const int t0 =
s->tint[0];
742 const int t1 =
s->tint[1];
743 uint16_t *dst0, *dst1;
747 src = (
const uint16_t *)(
out->data[0]) + offset_y * dst_linesize + offset_x;
748 dst0 = (uint16_t *)(
out->data[1]) + offset_y * dst_linesize + offset_x;
749 dst1 = (uint16_t *)(
out->data[2]) + offset_y * dst_linesize + offset_x;
750 for (y = 0; y <
s->max; y++) {
751 for (x = slicew_start * step; x < slicew_end * step; x++) {
759 dst0 += dst_linesize;
760 dst1 += dst_linesize;
762 }
else if (
s->display !=
OVERLAY && !
s->rgb) {
763 const int mult =
s->max / 256;
764 const int bg =
s->bg_color[0] *
mult;
765 const int t0 =
s->tint[0];
766 const int t1 =
s->tint[1];
767 uint16_t *dst0, *dst1;
771 src = (
const uint16_t *)
out->data[0] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
772 dst0 = (uint16_t *)(
out->data[1]) + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
773 dst1 = (uint16_t *)(
out->data[2]) + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
774 for (y = sliceh_start * step; y < sliceh_end * step; y++) {
775 for (x = 0; x <
s->max; x++) {
783 dst0 += dst_linesize;
784 dst1 += dst_linesize;
789 #define LOWPASS16_FUNC(name, column, mirror) \
790 static int lowpass16_##name(AVFilterContext *ctx, \
791 void *arg, int jobnr, \
794 WaveformContext *s = ctx->priv; \
795 ThreadData *td = arg; \
796 AVFrame *in = td->in; \
797 AVFrame *out = td->out; \
798 int component = td->component; \
799 int offset_y = td->offset_y; \
800 int offset_x = td->offset_x; \
802 lowpass16(s, in, out, component, s->intensity, \
803 offset_y, offset_x, column, mirror, \
817 int offset_y,
int offset_x,
819 int jobnr,
int nb_jobs)
821 const int plane =
s->desc->comp[component].plane;
822 const int dplane = (
s->rgb ||
s->display ==
OVERLAY) ? plane : 0;
823 const int shift_w =
s->shift_w[component];
824 const int shift_h =
s->shift_h[component];
825 const int src_linesize =
in->linesize[plane];
826 const int dst_linesize =
out->linesize[dplane];
827 const int dst_signed_linesize = dst_linesize * (
mirror == 1 ? -1 : 1);
831 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
832 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
833 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
834 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
836 const uint8_t *src_data =
in->data[plane] + sliceh_start * src_linesize;
837 uint8_t *dst_data =
out->data[dplane] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
838 uint8_t *
const dst_bottom_line = dst_data + dst_linesize * (
s->size - 1);
839 uint8_t *
const dst_line = (
mirror ? dst_bottom_line : dst_data);
846 for (y = sliceh_start; y < sliceh_end; y++) {
847 const uint8_t *src_data_end = src_data + slicew_end;
848 uint8_t *dst = dst_line + slicew_start * step;
850 for (p = src_data + slicew_start; p < src_data_end; p++) {
856 target = dst++ + dst_signed_linesize * *p;
858 }
while (++
i < step);
863 target = row - *p - 1;
868 }
while (++
i < step);
871 src_data += src_linesize;
872 dst_data += dst_linesize * step;
875 if (
s->display !=
OVERLAY && column && !
s->rgb) {
876 const int bg =
s->bg_color[0];
877 const int dst_h = 256;
878 const int t0 =
s->tint[0];
879 const int t1 =
s->tint[1];
884 src =
out->data[0] + offset_y * dst_linesize + offset_x;
885 dst0 =
out->data[1] + offset_y * dst_linesize + offset_x;
886 dst1 =
out->data[2] + offset_y * dst_linesize + offset_x;
887 for (y = 0; y < dst_h; y++) {
888 for (x = slicew_start * step; x < slicew_end * step; x++) {
896 dst0 += dst_linesize;
897 dst1 += dst_linesize;
899 }
else if (
s->display !=
OVERLAY && !
s->rgb) {
900 const int bg =
s->bg_color[0];
901 const int dst_w = 256;
902 const int t0 =
s->tint[0];
903 const int t1 =
s->tint[1];
908 src =
out->data[0] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
909 dst0 =
out->data[1] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
910 dst1 =
out->data[2] + (offset_y + sliceh_start * step) * dst_linesize + offset_x;
911 for (y = sliceh_start * step; y < sliceh_end * step; y++) {
912 for (x = 0; x < dst_w; x++) {
920 dst0 += dst_linesize;
921 dst1 += dst_linesize;
926 #define LOWPASS_FUNC(name, column, mirror) \
927 static int lowpass_##name(AVFilterContext *ctx, \
928 void *arg, int jobnr, \
931 WaveformContext *s = ctx->priv; \
932 ThreadData *td = arg; \
933 AVFrame *in = td->in; \
934 AVFrame *out = td->out; \
935 int component = td->component; \
936 int offset_y = td->offset_y; \
937 int offset_x = td->offset_x; \
939 lowpass(s, in, out, component, s->intensity, \
940 offset_y, offset_x, column, mirror, \
954 int offset_y,
int offset_x,
956 int jobnr,
int nb_jobs)
958 const int plane =
s->desc->comp[component].plane;
959 const int c0_linesize =
in->linesize[ plane + 0 ] / 2;
960 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp] / 2;
961 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp] / 2;
962 const int c0_shift_w =
s->shift_w[ component + 0 ];
963 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
964 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
965 const int c0_shift_h =
s->shift_h[ component + 0 ];
966 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
967 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
968 const int d0_linesize =
out->linesize[ plane + 0 ] / 2;
969 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp] / 2;
970 const int limit =
s->max - 1;
972 const int mid =
s->max / 2;
973 const int src_h =
in->height;
974 const int src_w =
in->width;
975 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
976 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
977 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
978 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
982 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
983 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
985 for (x = slicew_start; x < slicew_end; x++) {
986 const uint16_t *c0_data = (uint16_t *)
in->data[plane + 0];
987 const uint16_t *c1_data = (uint16_t *)
in->data[(plane + 1) %
s->ncomp];
988 const uint16_t *c2_data = (uint16_t *)
in->data[(plane + 2) %
s->ncomp];
989 uint16_t *d0_data = (uint16_t *)(
out->data[plane]) + offset_y * d0_linesize + offset_x;
990 uint16_t *d1_data = (uint16_t *)(
out->data[(plane + 1) %
s->ncomp]) + offset_y * d1_linesize + offset_x;
991 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
992 uint16_t *
const d0 = (
mirror ? d0_bottom_line : d0_data);
993 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
994 uint16_t *
const d1 = (
mirror ? d1_bottom_line : d1_data);
996 for (y = 0; y < src_h; y++) {
997 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit) +
s->max;
998 const int c1 =
FFMIN(
FFABS(c1_data[x >> c1_shift_w] - mid) +
FFABS(c2_data[x >> c2_shift_w] - mid), limit);
1001 target = d0 + x + d0_signed_linesize * c0;
1003 target = d1 + x + d1_signed_linesize * (c0 -
c1);
1005 target = d1 + x + d1_signed_linesize * (c0 +
c1);
1008 if (!c0_shift_h || (y & c0_shift_h))
1009 c0_data += c0_linesize;
1010 if (!c1_shift_h || (y & c1_shift_h))
1011 c1_data += c1_linesize;
1012 if (!c2_shift_h || (y & c2_shift_h))
1013 c2_data += c2_linesize;
1014 d0_data += d0_linesize;
1015 d1_data += d1_linesize;
1019 const uint16_t *c0_data = (uint16_t *)(
in->data[plane]) + (sliceh_start >> c0_shift_h) * c0_linesize;
1020 const uint16_t *c1_data = (uint16_t *)(
in->data[(plane + 1) %
s->ncomp]) + (sliceh_start >> c1_shift_h) * c1_linesize;
1021 const uint16_t *c2_data = (uint16_t *)(
in->data[(plane + 2) %
s->ncomp]) + (sliceh_start >> c2_shift_h) * c2_linesize;
1022 uint16_t *d0_data = (uint16_t *)(
out->data[plane]) + (offset_y + sliceh_start) * d0_linesize + offset_x;
1023 uint16_t *d1_data = (uint16_t *)(
out->data[(plane + 1) %
s->ncomp]) + (offset_y + sliceh_start) * d1_linesize + offset_x;
1026 d0_data +=
s->size - 1;
1027 d1_data +=
s->size - 1;
1030 for (y = sliceh_start; y < sliceh_end; y++) {
1031 for (x = 0; x < src_w; x++) {
1032 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit) +
s->max;
1033 const int c1 =
FFMIN(
FFABS(c1_data[x >> c1_shift_w] - mid) +
FFABS(c2_data[x >> c2_shift_w] - mid), limit);
1037 target = d0_data - c0;
1039 target = d1_data - (c0 -
c1);
1041 target = d1_data - (c0 +
c1);
1044 target = d0_data + c0;
1046 target = d1_data + (c0 -
c1);
1048 target = d1_data + (c0 +
c1);
1053 if (!c0_shift_h || (y & c0_shift_h))
1054 c0_data += c0_linesize;
1055 if (!c1_shift_h || (y & c1_shift_h))
1056 c1_data += c1_linesize;
1057 if (!c2_shift_h || (y & c2_shift_h))
1058 c2_data += c2_linesize;
1059 d0_data += d0_linesize;
1060 d1_data += d1_linesize;
1065 #define FLAT16_FUNC(name, column, mirror) \
1066 static int flat16_##name(AVFilterContext *ctx, \
1067 void *arg, int jobnr, \
1070 WaveformContext *s = ctx->priv; \
1071 ThreadData *td = arg; \
1072 AVFrame *in = td->in; \
1073 AVFrame *out = td->out; \
1074 int component = td->component; \
1075 int offset_y = td->offset_y; \
1076 int offset_x = td->offset_x; \
1078 flat16(s, in, out, component, s->intensity, \
1079 offset_y, offset_x, column, mirror, \
1093 int offset_y,
int offset_x,
1095 int jobnr,
int nb_jobs)
1097 const int plane =
s->desc->comp[component].plane;
1098 const int c0_linesize =
in->linesize[ plane + 0 ];
1099 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp];
1100 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp];
1101 const int c0_shift_w =
s->shift_w[ component + 0 ];
1102 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
1103 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
1104 const int c0_shift_h =
s->shift_h[ component + 0 ];
1105 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
1106 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
1107 const int d0_linesize =
out->linesize[ plane + 0 ];
1108 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp];
1110 const int src_h =
in->height;
1111 const int src_w =
in->width;
1112 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
1113 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
1114 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
1115 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
1119 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
1120 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
1122 for (x = slicew_start; x < slicew_end; x++) {
1123 const uint8_t *c0_data =
in->data[plane + 0];
1124 const uint8_t *c1_data =
in->data[(plane + 1) %
s->ncomp];
1125 const uint8_t *c2_data =
in->data[(plane + 2) %
s->ncomp];
1126 uint8_t *d0_data =
out->data[plane] + offset_y * d0_linesize + offset_x;
1127 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + offset_y * d1_linesize + offset_x;
1128 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
1130 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
1133 for (y = 0; y < src_h; y++) {
1134 const int c0 = c0_data[x >> c0_shift_w] + 256;
1135 const int c1 =
FFABS(c1_data[x >> c1_shift_w] - 128) +
FFABS(c2_data[x >> c2_shift_w] - 128);
1138 target = d0 + x + d0_signed_linesize * c0;
1140 target = d1 + x + d1_signed_linesize * (c0 -
c1);
1142 target = d1 + x + d1_signed_linesize * (c0 +
c1);
1145 if (!c0_shift_h || (y & c0_shift_h))
1146 c0_data += c0_linesize;
1147 if (!c1_shift_h || (y & c1_shift_h))
1148 c1_data += c1_linesize;
1149 if (!c2_shift_h || (y & c2_shift_h))
1150 c2_data += c2_linesize;
1151 d0_data += d0_linesize;
1152 d1_data += d1_linesize;
1156 const uint8_t *c0_data =
in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize;
1157 const uint8_t *c1_data =
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1158 const uint8_t *c2_data =
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1159 uint8_t *d0_data =
out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
1160 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
1163 d0_data +=
s->size - 1;
1164 d1_data +=
s->size - 1;
1167 for (y = sliceh_start; y < sliceh_end; y++) {
1168 for (x = 0; x < src_w; x++) {
1169 const int c0 = c0_data[x >> c0_shift_w] + 256;
1170 const int c1 =
FFABS(c1_data[x >> c1_shift_w] - 128) +
FFABS(c2_data[x >> c2_shift_w] - 128);
1174 target = d0_data - c0;
1176 target = d1_data - (c0 -
c1);
1178 target = d1_data - (c0 +
c1);
1181 target = d0_data + c0;
1183 target = d1_data + (c0 -
c1);
1185 target = d1_data + (c0 +
c1);
1190 if (!c0_shift_h || (y & c0_shift_h))
1191 c0_data += c0_linesize;
1192 if (!c1_shift_h || (y & c1_shift_h))
1193 c1_data += c1_linesize;
1194 if (!c2_shift_h || (y & c2_shift_h))
1195 c2_data += c2_linesize;
1196 d0_data += d0_linesize;
1197 d1_data += d1_linesize;
1202 #define FLAT_FUNC(name, column, mirror) \
1203 static int flat_##name(AVFilterContext *ctx, \
1204 void *arg, int jobnr, \
1207 WaveformContext *s = ctx->priv; \
1208 ThreadData *td = arg; \
1209 AVFrame *in = td->in; \
1210 AVFrame *out = td->out; \
1211 int component = td->component; \
1212 int offset_y = td->offset_y; \
1213 int offset_x = td->offset_x; \
1215 flat(s, in, out, component, s->intensity, \
1216 offset_y, offset_x, column, mirror, \
1227 #define AFLAT16(name, update_cb, update_cr, column, mirror) \
1228 static int name(AVFilterContext *ctx, \
1229 void *arg, int jobnr, \
1232 WaveformContext *s = ctx->priv; \
1233 ThreadData *td = arg; \
1234 AVFrame *in = td->in; \
1235 AVFrame *out = td->out; \
1236 int component = td->component; \
1237 int offset_y = td->offset_y; \
1238 int offset_x = td->offset_x; \
1239 const int intensity = s->intensity; \
1240 const int plane = s->desc->comp[component].plane; \
1241 const int c0_linesize = in->linesize[ plane + 0 ] / 2; \
1242 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2; \
1243 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2; \
1244 const int c0_shift_w = s->shift_w[ component + 0 ]; \
1245 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp]; \
1246 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp]; \
1247 const int c0_shift_h = s->shift_h[ component + 0 ]; \
1248 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp]; \
1249 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp]; \
1250 const int d0_linesize = out->linesize[ plane + 0 ] / 2; \
1251 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2; \
1252 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp] / 2; \
1253 const int limit = s->max - 1; \
1254 const int max = limit - intensity; \
1255 const int mid = s->max / 2; \
1256 const int src_h = in->height; \
1257 const int src_w = in->width; \
1258 const int sliceh_start = !column ? ff_slice_pos(src_h, jobnr, nb_jobs) : 0; \
1259 const int sliceh_end = !column ? ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h; \
1260 const int slicew_start = column ? ff_slice_pos(src_w, jobnr, nb_jobs) : 0; \
1261 const int slicew_end = column ? ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w; \
1265 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1); \
1266 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1); \
1267 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1); \
1269 for (x = slicew_start; x < slicew_end; x++) { \
1270 const uint16_t *c0_data = (uint16_t *)in->data[plane + 0]; \
1271 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 1) % s->ncomp]; \
1272 const uint16_t *c2_data = (uint16_t *)in->data[(plane + 2) % s->ncomp]; \
1273 uint16_t *d0_data = (uint16_t *)out->data[plane] + offset_y * d0_linesize + offset_x; \
1274 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x; \
1275 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x; \
1276 uint16_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1); \
1277 uint16_t * const d0 = (mirror ? d0_bottom_line : d0_data); \
1278 uint16_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1); \
1279 uint16_t * const d1 = (mirror ? d1_bottom_line : d1_data); \
1280 uint16_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1); \
1281 uint16_t * const d2 = (mirror ? d2_bottom_line : d2_data); \
1283 for (y = 0; y < src_h; y++) { \
1284 const int c0 = FFMIN(c0_data[x >> c0_shift_w], limit) + mid; \
1285 const int c1 = FFMIN(c1_data[x >> c1_shift_w], limit) - mid; \
1286 const int c2 = FFMIN(c2_data[x >> c2_shift_w], limit) - mid; \
1289 target = d0 + x + d0_signed_linesize * c0; \
1290 update16(target, max, intensity, limit); \
1292 target = d1 + x + d1_signed_linesize * (c0 + c1); \
1293 update_cb(target, max, intensity, limit); \
1295 target = d2 + x + d2_signed_linesize * (c0 + c2); \
1296 update_cr(target, max, intensity, limit); \
1298 if (!c0_shift_h || (y & c0_shift_h)) \
1299 c0_data += c0_linesize; \
1300 if (!c1_shift_h || (y & c1_shift_h)) \
1301 c1_data += c1_linesize; \
1302 if (!c2_shift_h || (y & c2_shift_h)) \
1303 c2_data += c2_linesize; \
1304 d0_data += d0_linesize; \
1305 d1_data += d1_linesize; \
1306 d2_data += d2_linesize; \
1310 const uint16_t *c0_data = (uint16_t *)in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize; \
1311 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize; \
1312 const uint16_t *c2_data = (uint16_t *)in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize; \
1313 uint16_t *d0_data = (uint16_t *)out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x; \
1314 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x; \
1315 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x; \
1318 d0_data += s->size - 1; \
1319 d1_data += s->size - 1; \
1320 d2_data += s->size - 1; \
1323 for (y = sliceh_start; y < sliceh_end; y++) { \
1324 for (x = 0; x < src_w; x++) { \
1325 const int c0 = FFMIN(c0_data[x >> c0_shift_w], limit) + mid; \
1326 const int c1 = FFMIN(c1_data[x >> c1_shift_w], limit) - mid; \
1327 const int c2 = FFMIN(c2_data[x >> c2_shift_w], limit) - mid; \
1331 target = d0_data - c0; \
1332 update16(target, max, intensity, limit); \
1333 target = d1_data - (c0 + c1); \
1334 update_cb(target, max, intensity, limit); \
1335 target = d2_data - (c0 + c2); \
1336 update_cr(target, max, intensity, limit); \
1338 target = d0_data + c0; \
1339 update16(target, max, intensity, limit); \
1340 target = d1_data + (c0 + c1); \
1341 update_cb(target, max, intensity, limit); \
1342 target = d2_data + (c0 + c2); \
1343 update_cr(target, max, intensity, limit); \
1347 if (!c0_shift_h || (y & c0_shift_h)) \
1348 c0_data += c0_linesize; \
1349 if (!c1_shift_h || (y & c1_shift_h)) \
1350 c1_data += c1_linesize; \
1351 if (!c2_shift_h || (y & c2_shift_h)) \
1352 c2_data += c2_linesize; \
1353 d0_data += d0_linesize; \
1354 d1_data += d1_linesize; \
1355 d2_data += d2_linesize; \
1361 #define AFLAT(name, update_cb, update_cr, column, mirror) \
1362 static int name(AVFilterContext *ctx, \
1363 void *arg, int jobnr, \
1366 WaveformContext *s = ctx->priv; \
1367 ThreadData *td = arg; \
1368 AVFrame *in = td->in; \
1369 AVFrame *out = td->out; \
1370 int component = td->component; \
1371 int offset_y = td->offset_y; \
1372 int offset_x = td->offset_x; \
1373 const int src_h = in->height; \
1374 const int src_w = in->width; \
1375 const int sliceh_start = !column ? ff_slice_pos(src_h, jobnr, nb_jobs) : 0; \
1376 const int sliceh_end = !column ? ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h; \
1377 const int slicew_start = column ? ff_slice_pos(src_w, jobnr, nb_jobs) : 0; \
1378 const int slicew_end = column ? ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w; \
1379 const int intensity = s->intensity; \
1380 const int plane = s->desc->comp[component].plane; \
1381 const int c0_linesize = in->linesize[ plane + 0 ]; \
1382 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp]; \
1383 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp]; \
1384 const int c0_shift_w = s->shift_w[ component + 0 ]; \
1385 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp]; \
1386 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp]; \
1387 const int c0_shift_h = s->shift_h[ component + 0 ]; \
1388 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp]; \
1389 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp]; \
1390 const int d0_linesize = out->linesize[ plane + 0 ]; \
1391 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp]; \
1392 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp]; \
1393 const int max = 255 - intensity; \
1397 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1); \
1398 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1); \
1399 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1); \
1401 for (x = slicew_start; x < slicew_end; x++) { \
1402 const uint8_t *c0_data = in->data[plane + 0]; \
1403 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp]; \
1404 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp]; \
1405 uint8_t *d0_data = out->data[plane] + offset_y * d0_linesize + offset_x; \
1406 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x; \
1407 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x; \
1408 uint8_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1); \
1409 uint8_t * const d0 = (mirror ? d0_bottom_line : d0_data); \
1410 uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1); \
1411 uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data); \
1412 uint8_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1); \
1413 uint8_t * const d2 = (mirror ? d2_bottom_line : d2_data); \
1415 for (y = 0; y < src_h; y++) { \
1416 const int c0 = c0_data[x >> c0_shift_w] + 128; \
1417 const int c1 = c1_data[x >> c1_shift_w] - 128; \
1418 const int c2 = c2_data[x >> c2_shift_w] - 128; \
1421 target = d0 + x + d0_signed_linesize * c0; \
1422 update(target, max, intensity); \
1424 target = d1 + x + d1_signed_linesize * (c0 + c1); \
1425 update_cb(target, max, intensity); \
1427 target = d2 + x + d2_signed_linesize * (c0 + c2); \
1428 update_cr(target, max, intensity); \
1430 if (!c0_shift_h || (y & c0_shift_h)) \
1431 c0_data += c0_linesize; \
1432 if (!c1_shift_h || (y & c1_shift_h)) \
1433 c1_data += c1_linesize; \
1434 if (!c2_shift_h || (y & c2_shift_h)) \
1435 c2_data += c2_linesize; \
1436 d0_data += d0_linesize; \
1437 d1_data += d1_linesize; \
1438 d2_data += d2_linesize; \
1442 const uint8_t *c0_data = in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize; \
1443 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize; \
1444 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize; \
1445 uint8_t *d0_data = out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x; \
1446 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x; \
1447 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x; \
1450 d0_data += s->size - 1; \
1451 d1_data += s->size - 1; \
1452 d2_data += s->size - 1; \
1455 for (y = sliceh_start; y < sliceh_end; y++) { \
1456 for (x = 0; x < src_w; x++) { \
1457 const int c0 = c0_data[x >> c0_shift_w] + 128; \
1458 const int c1 = c1_data[x >> c1_shift_w] - 128; \
1459 const int c2 = c2_data[x >> c2_shift_w] - 128; \
1463 target = d0_data - c0; \
1464 update(target, max, intensity); \
1465 target = d1_data - (c0 + c1); \
1466 update_cb(target, max, intensity); \
1467 target = d2_data - (c0 + c2); \
1468 update_cr(target, max, intensity); \
1470 target = d0_data + c0; \
1471 update(target, max, intensity); \
1472 target = d1_data + (c0 + c1); \
1473 update_cb(target, max, intensity); \
1474 target = d2_data + (c0 + c2); \
1475 update_cr(target, max, intensity); \
1479 if (!c0_shift_h || (y & c0_shift_h)) \
1480 c0_data += c0_linesize; \
1481 if (!c1_shift_h || (y & c1_shift_h)) \
1482 c1_data += c1_linesize; \
1483 if (!c2_shift_h || (y & c2_shift_h)) \
1484 c2_data += c2_linesize; \
1485 d0_data += d0_linesize; \
1486 d1_data += d1_linesize; \
1487 d2_data += d2_linesize; \
1522 int offset_y,
int offset_x,
1524 int jobnr,
int nb_jobs)
1526 const int plane =
s->desc->comp[component].plane;
1527 const int c0_linesize =
in->linesize[(plane + 1) %
s->ncomp] / 2;
1528 const int c1_linesize =
in->linesize[(plane + 2) %
s->ncomp] / 2;
1529 const int dst_linesize =
out->linesize[plane] / 2;
1530 const int limit =
s->max - 1;
1532 const int mid =
s->max / 2;
1533 const int c0_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
1534 const int c1_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
1535 const int c0_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
1536 const int c1_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
1537 const int src_h =
in->height;
1538 const int src_w =
in->width;
1539 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
1540 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
1541 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
1542 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
1546 const int dst_signed_linesize = dst_linesize * (
mirror == 1 ? -1 : 1);
1548 for (x = slicew_start; x < slicew_end; x++) {
1549 const uint16_t *c0_data = (uint16_t *)
in->data[(plane + 1) %
s->ncomp];
1550 const uint16_t *c1_data = (uint16_t *)
in->data[(plane + 2) %
s->ncomp];
1551 uint16_t *dst_data = (uint16_t *)
out->data[plane] + offset_y * dst_linesize + offset_x;
1552 uint16_t *
const dst_bottom_line = dst_data + dst_linesize * (
s->size - 1);
1553 uint16_t *
const dst_line = (
mirror ? dst_bottom_line : dst_data);
1554 uint16_t *dst = dst_line;
1556 for (y = 0; y < src_h; y++) {
1557 const int sum =
FFMIN(
FFABS(c0_data[x >> c0_shift_w] - mid) +
FFABS(c1_data[x >> c1_shift_w] - mid - 1), limit);
1560 target = dst + x + dst_signed_linesize * sum;
1563 if (!c0_shift_h || (y & c0_shift_h))
1564 c0_data += c0_linesize;
1565 if (!c1_shift_h || (y & c1_shift_h))
1566 c1_data += c1_linesize;
1567 dst_data += dst_linesize;
1571 const uint16_t *c0_data = (uint16_t *)
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c0_shift_h) * c0_linesize;
1572 const uint16_t *c1_data = (uint16_t *)
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1573 uint16_t *dst_data = (uint16_t *)
out->data[plane] + (offset_y + sliceh_start) * dst_linesize + offset_x;
1576 dst_data +=
s->size - 1;
1577 for (y = sliceh_start; y < sliceh_end; y++) {
1578 for (x = 0; x < src_w; x++) {
1579 const int sum =
FFMIN(
FFABS(c0_data[x >> c0_shift_w] - mid) +
FFABS(c1_data[x >> c1_shift_w] - mid - 1), limit);
1583 target = dst_data - sum;
1586 target = dst_data + sum;
1591 if (!c0_shift_h || (y & c0_shift_h))
1592 c0_data += c0_linesize;
1593 if (!c1_shift_h || (y & c1_shift_h))
1594 c1_data += c1_linesize;
1595 dst_data += dst_linesize;
1600 #define CHROMA16_FUNC(name, column, mirror) \
1601 static int chroma16_##name(AVFilterContext *ctx, \
1602 void *arg, int jobnr, \
1605 WaveformContext *s = ctx->priv; \
1606 ThreadData *td = arg; \
1607 AVFrame *in = td->in; \
1608 AVFrame *out = td->out; \
1609 int component = td->component; \
1610 int offset_y = td->offset_y; \
1611 int offset_x = td->offset_x; \
1613 chroma16(s, in, out, component, s->intensity,\
1614 offset_y, offset_x, column, mirror, \
1628 int offset_y,
int offset_x,
1630 int jobnr,
int nb_jobs)
1632 const int plane =
s->desc->comp[component].plane;
1633 const int src_h =
in->height;
1634 const int src_w =
in->width;
1635 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
1636 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
1637 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
1638 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
1639 const int c0_linesize =
in->linesize[(plane + 1) %
s->ncomp];
1640 const int c1_linesize =
in->linesize[(plane + 2) %
s->ncomp];
1641 const int dst_linesize =
out->linesize[plane];
1643 const int c0_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
1644 const int c1_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
1645 const int c0_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
1646 const int c1_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
1650 const int dst_signed_linesize = dst_linesize * (
mirror == 1 ? -1 : 1);
1652 for (x = slicew_start; x < slicew_end; x++) {
1653 const uint8_t *c0_data =
in->data[(plane + 1) %
s->ncomp];
1654 const uint8_t *c1_data =
in->data[(plane + 2) %
s->ncomp];
1655 uint8_t *dst_data =
out->data[plane] + offset_y * dst_linesize + offset_x;
1656 uint8_t *
const dst_bottom_line = dst_data + dst_linesize * (
s->size - 1);
1657 uint8_t *
const dst_line = (
mirror ? dst_bottom_line : dst_data);
1660 for (y = 0; y < src_h; y++) {
1661 const int sum =
FFABS(c0_data[x >> c0_shift_w] - 128) +
FFABS(c1_data[x >> c1_shift_w] - 127);
1664 target = dst + x + dst_signed_linesize * sum;
1667 if (!c0_shift_h || (y & c0_shift_h))
1668 c0_data += c0_linesize;
1669 if (!c1_shift_h || (y & c1_shift_h))
1670 c1_data += c1_linesize;
1671 dst_data += dst_linesize;
1675 const uint8_t *c0_data =
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c0_shift_h) * c0_linesize;
1676 const uint8_t *c1_data =
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1677 uint8_t *dst_data =
out->data[plane] + (offset_y + sliceh_start) * dst_linesize + offset_x;
1680 dst_data +=
s->size - 1;
1681 for (y = sliceh_start; y < sliceh_end; y++) {
1682 for (x = 0; x < src_w; x++) {
1683 const int sum =
FFABS(c0_data[x >> c0_shift_w] - 128) +
FFABS(c1_data[x >> c1_shift_w] - 127);
1687 target = dst_data - sum;
1690 target = dst_data + sum;
1695 if (!c0_shift_h || (y & c0_shift_h))
1696 c0_data += c0_linesize;
1697 if (!c1_shift_h || (y & c1_shift_h))
1698 c1_data += c1_linesize;
1699 dst_data += dst_linesize;
1704 #define CHROMA_FUNC(name, column, mirror) \
1705 static int chroma_##name(AVFilterContext *ctx, \
1706 void *arg, int jobnr, \
1709 WaveformContext *s = ctx->priv; \
1710 ThreadData *td = arg; \
1711 AVFrame *in = td->in; \
1712 AVFrame *out = td->out; \
1713 int component = td->component; \
1714 int offset_y = td->offset_y; \
1715 int offset_x = td->offset_x; \
1717 chroma(s, in, out, component, s->intensity, \
1718 offset_y, offset_x, column, mirror, \
1732 int offset_y,
int offset_x,
1734 int jobnr,
int nb_jobs)
1736 const int plane =
s->desc->comp[component].plane;
1737 const int limit =
s->max - 1;
1738 const int src_h =
in->height;
1739 const int src_w =
in->width;
1740 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
1741 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
1742 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
1743 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
1744 const int c0_linesize =
in->linesize[ plane + 0 ] / 2;
1745 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp] / 2;
1746 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp] / 2;
1747 const int c0_shift_h =
s->shift_h[ component + 0 ];
1748 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
1749 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
1750 const uint16_t *c0_data = (
const uint16_t *)
in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
1751 const uint16_t *c1_data = (
const uint16_t *)
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1752 const uint16_t *c2_data = (
const uint16_t *)
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1753 const int d0_linesize =
out->linesize[ plane + 0 ] / 2;
1754 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp] / 2;
1755 const int d2_linesize =
out->linesize[(plane + 2) %
s->ncomp] / 2;
1756 const int c0_shift_w =
s->shift_w[ component + 0 ];
1757 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
1758 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
1762 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
1763 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
1764 const int d2_signed_linesize = d2_linesize * (
mirror == 1 ? -1 : 1);
1765 uint16_t *d0_data = (uint16_t *)
out->data[plane] + offset_y * d0_linesize + offset_x;
1766 uint16_t *d1_data = (uint16_t *)
out->data[(plane + 1) %
s->ncomp] + offset_y * d1_linesize + offset_x;
1767 uint16_t *d2_data = (uint16_t *)
out->data[(plane + 2) %
s->ncomp] + offset_y * d2_linesize + offset_x;
1768 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
1769 uint16_t *
const d0 = (
mirror ? d0_bottom_line : d0_data);
1770 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
1771 uint16_t *
const d1 = (
mirror ? d1_bottom_line : d1_data);
1772 uint16_t *
const d2_bottom_line = d2_data + d2_linesize * (
s->size - 1);
1773 uint16_t *
const d2 = (
mirror ? d2_bottom_line : d2_data);
1775 for (y = 0; y < src_h; y++) {
1776 for (x = slicew_start; x < slicew_end; x++) {
1777 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
1778 const int c1 = c1_data[x >> c1_shift_w];
1779 const int c2 = c2_data[x >> c2_shift_w];
1781 *(d0 + d0_signed_linesize * c0 + x) = c0;
1782 *(d1 + d1_signed_linesize * c0 + x) =
c1;
1783 *(d2 + d2_signed_linesize * c0 + x) =
c2;
1786 if (!c0_shift_h || (y & c0_shift_h))
1787 c0_data += c0_linesize;
1788 if (!c1_shift_h || (y & c1_shift_h))
1789 c1_data += c1_linesize;
1790 if (!c2_shift_h || (y & c2_shift_h))
1791 c2_data += c2_linesize;
1792 d0_data += d0_linesize;
1793 d1_data += d1_linesize;
1794 d2_data += d2_linesize;
1797 uint16_t *d0_data = (uint16_t *)
out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
1798 uint16_t *d1_data = (uint16_t *)
out->data[(plane + 1) %
s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
1799 uint16_t *d2_data = (uint16_t *)
out->data[(plane + 2) %
s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
1802 d0_data +=
s->size - 1;
1803 d1_data +=
s->size - 1;
1804 d2_data +=
s->size - 1;
1807 for (y = sliceh_start; y < sliceh_end; y++) {
1808 for (x = 0; x < src_w; x++) {
1809 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
1810 const int c1 = c1_data[x >> c1_shift_w];
1811 const int c2 = c2_data[x >> c2_shift_w];
1814 *(d0_data - c0) = c0;
1815 *(d1_data - c0) =
c1;
1816 *(d2_data - c0) =
c2;
1818 *(d0_data + c0) = c0;
1819 *(d1_data + c0) =
c1;
1820 *(d2_data + c0) =
c2;
1824 if (!c0_shift_h || (y & c0_shift_h))
1825 c0_data += c0_linesize;
1826 if (!c1_shift_h || (y & c1_shift_h))
1827 c1_data += c1_linesize;
1828 if (!c2_shift_h || (y & c2_shift_h))
1829 c2_data += c2_linesize;
1830 d0_data += d0_linesize;
1831 d1_data += d1_linesize;
1832 d2_data += d2_linesize;
1837 #define COLOR16_FUNC(name, column, mirror) \
1838 static int color16_##name(AVFilterContext *ctx, \
1839 void *arg, int jobnr, \
1842 WaveformContext *s = ctx->priv; \
1843 ThreadData *td = arg; \
1844 AVFrame *in = td->in; \
1845 AVFrame *out = td->out; \
1846 int component = td->component; \
1847 int offset_y = td->offset_y; \
1848 int offset_x = td->offset_x; \
1850 color16(s, in, out, component, s->intensity, \
1851 offset_y, offset_x, column, mirror, \
1865 int offset_y,
int offset_x,
1867 int jobnr,
int nb_jobs)
1869 const int plane =
s->desc->comp[component].plane;
1870 const int src_h =
in->height;
1871 const int src_w =
in->width;
1872 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
1873 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
1874 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
1875 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
1876 const int c0_linesize =
in->linesize[ plane + 0 ];
1877 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp];
1878 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp];
1879 const int c0_shift_h =
s->shift_h[ component + 0 ];
1880 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
1881 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
1882 const uint8_t *c0_data =
in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize;
1883 const uint8_t *c1_data =
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1884 const uint8_t *c2_data =
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1885 const int d0_linesize =
out->linesize[ plane + 0 ];
1886 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp];
1887 const int d2_linesize =
out->linesize[(plane + 2) %
s->ncomp];
1888 const int c0_shift_w =
s->shift_w[ component + 0 ];
1889 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
1890 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
1894 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
1895 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
1896 const int d2_signed_linesize = d2_linesize * (
mirror == 1 ? -1 : 1);
1897 uint8_t *d0_data =
out->data[plane] + offset_y * d0_linesize + offset_x;
1898 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + offset_y * d1_linesize + offset_x;
1899 uint8_t *d2_data =
out->data[(plane + 2) %
s->ncomp] + offset_y * d2_linesize + offset_x;
1900 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
1902 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
1904 uint8_t *
const d2_bottom_line = d2_data + d2_linesize * (
s->size - 1);
1907 for (y = 0; y < src_h; y++) {
1908 for (x = slicew_start; x < slicew_end; x++) {
1909 const int c0 = c0_data[x >> c0_shift_w];
1910 const int c1 = c1_data[x >> c1_shift_w];
1911 const int c2 = c2_data[x >> c2_shift_w];
1913 *(d0 + d0_signed_linesize * c0 + x) = c0;
1914 *(d1 + d1_signed_linesize * c0 + x) =
c1;
1915 *(d2 + d2_signed_linesize * c0 + x) =
c2;
1918 if (!c0_shift_h || (y & c0_shift_h))
1919 c0_data += c0_linesize;
1920 if (!c1_shift_h || (y & c1_shift_h))
1921 c1_data += c1_linesize;
1922 if (!c2_shift_h || (y & c2_shift_h))
1923 c2_data += c2_linesize;
1924 d0_data += d0_linesize;
1925 d1_data += d1_linesize;
1926 d2_data += d2_linesize;
1929 uint8_t *d0_data =
out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
1930 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
1931 uint8_t *d2_data =
out->data[(plane + 2) %
s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
1934 d0_data +=
s->size - 1;
1935 d1_data +=
s->size - 1;
1936 d2_data +=
s->size - 1;
1939 for (y = sliceh_start; y < sliceh_end; y++) {
1940 for (x = 0; x < src_w; x++) {
1941 const int c0 = c0_data[x >> c0_shift_w];
1942 const int c1 = c1_data[x >> c1_shift_w];
1943 const int c2 = c2_data[x >> c2_shift_w];
1946 *(d0_data - c0) = c0;
1947 *(d1_data - c0) =
c1;
1948 *(d2_data - c0) =
c2;
1950 *(d0_data + c0) = c0;
1951 *(d1_data + c0) =
c1;
1952 *(d2_data + c0) =
c2;
1956 if (!c0_shift_h || (y & c0_shift_h))
1957 c0_data += c0_linesize;
1958 if (!c1_shift_h || (y & c1_shift_h))
1959 c1_data += c1_linesize;
1960 if (!c2_shift_h || (y & c2_shift_h))
1961 c2_data += c2_linesize;
1962 d0_data += d0_linesize;
1963 d1_data += d1_linesize;
1964 d2_data += d2_linesize;
1969 #define COLOR_FUNC(name, column, mirror) \
1970 static int color_##name(AVFilterContext *ctx, \
1971 void *arg, int jobnr, \
1974 WaveformContext *s = ctx->priv; \
1975 ThreadData *td = arg; \
1976 AVFrame *in = td->in; \
1977 AVFrame *out = td->out; \
1978 int component = td->component; \
1979 int offset_y = td->offset_y; \
1980 int offset_x = td->offset_x; \
1982 color(s, in, out, component, s->intensity, \
1983 offset_y, offset_x, column, mirror, \
1997 int offset_y,
int offset_x,
1999 int jobnr,
int nb_jobs)
2001 const int plane =
s->desc->comp[component].plane;
2002 const int limit =
s->max - 1;
2004 const int src_h =
in->height;
2005 const int src_w =
in->width;
2006 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
2007 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
2008 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
2009 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
2010 const int c0_shift_h =
s->shift_h[ component + 0 ];
2011 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
2012 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
2013 const int c0_linesize =
in->linesize[ plane + 0 ] / 2;
2014 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp] / 2;
2015 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp] / 2;
2016 const uint16_t *c0_data = (
const uint16_t *)
in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
2017 const uint16_t *c1_data = (
const uint16_t *)
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
2018 const uint16_t *c2_data = (
const uint16_t *)
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
2019 const int d0_linesize =
out->linesize[ plane + 0 ] / 2;
2020 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp] / 2;
2021 const int d2_linesize =
out->linesize[(plane + 2) %
s->ncomp] / 2;
2022 const int c0_shift_w =
s->shift_w[ component + 0 ];
2023 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
2024 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
2028 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
2029 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
2030 const int d2_signed_linesize = d2_linesize * (
mirror == 1 ? -1 : 1);
2031 uint16_t *d0_data = (uint16_t *)
out->data[plane] + offset_y * d0_linesize + offset_x;
2032 uint16_t *d1_data = (uint16_t *)
out->data[(plane + 1) %
s->ncomp] + offset_y * d1_linesize + offset_x;
2033 uint16_t *d2_data = (uint16_t *)
out->data[(plane + 2) %
s->ncomp] + offset_y * d2_linesize + offset_x;
2034 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
2035 uint16_t *
const d0 = (
mirror ? d0_bottom_line : d0_data);
2036 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
2037 uint16_t *
const d1 = (
mirror ? d1_bottom_line : d1_data);
2038 uint16_t *
const d2_bottom_line = d2_data + d2_linesize * (
s->size - 1);
2039 uint16_t *
const d2 = (
mirror ? d2_bottom_line : d2_data);
2041 for (y = 0; y < src_h; y++) {
2042 for (x = slicew_start; x < slicew_end; x++) {
2043 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
2044 const int c1 = c1_data[x >> c1_shift_w];
2045 const int c2 = c2_data[x >> c2_shift_w];
2048 *(d1 + d1_signed_linesize * c0 + x) =
c1;
2049 *(d2 + d2_signed_linesize * c0 + x) =
c2;
2052 if (!c0_shift_h || (y & c0_shift_h))
2053 c0_data += c0_linesize;
2054 if (!c1_shift_h || (y & c1_shift_h))
2055 c1_data += c1_linesize;
2056 if (!c2_shift_h || (y & c2_shift_h))
2057 c2_data += c2_linesize;
2058 d0_data += d0_linesize;
2059 d1_data += d1_linesize;
2060 d2_data += d2_linesize;
2063 uint16_t *d0_data = (uint16_t *)
out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
2064 uint16_t *d1_data = (uint16_t *)
out->data[(plane + 1) %
s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
2065 uint16_t *d2_data = (uint16_t *)
out->data[(plane + 2) %
s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
2068 d0_data +=
s->size - 1;
2069 d1_data +=
s->size - 1;
2070 d2_data +=
s->size - 1;
2073 for (y = sliceh_start; y < sliceh_end; y++) {
2074 for (x = 0; x < src_w; x++) {
2075 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
2076 const int c1 = c1_data[x >> c1_shift_w];
2077 const int c2 = c2_data[x >> c2_shift_w];
2081 *(d1_data - c0) =
c1;
2082 *(d2_data - c0) =
c2;
2085 *(d1_data + c0) =
c1;
2086 *(d2_data + c0) =
c2;
2090 if (!c0_shift_h || (y & c0_shift_h))
2091 c0_data += c0_linesize;
2092 if (!c1_shift_h || (y & c1_shift_h))
2093 c1_data += c1_linesize;
2094 if (!c2_shift_h || (y & c2_shift_h))
2095 c2_data += c2_linesize;
2096 d0_data += d0_linesize;
2097 d1_data += d1_linesize;
2098 d2_data += d2_linesize;
2103 #define ACOLOR16_FUNC(name, column, mirror) \
2104 static int acolor16_##name(AVFilterContext *ctx, \
2105 void *arg, int jobnr, \
2108 WaveformContext *s = ctx->priv; \
2109 ThreadData *td = arg; \
2110 AVFrame *in = td->in; \
2111 AVFrame *out = td->out; \
2112 int component = td->component; \
2113 int offset_y = td->offset_y; \
2114 int offset_x = td->offset_x; \
2116 acolor16(s, in, out, component, s->intensity,\
2117 offset_y, offset_x, column, mirror, \
2131 int offset_y,
int offset_x,
2133 int jobnr,
int nb_jobs)
2135 const int plane =
s->desc->comp[component].plane;
2136 const int src_h =
in->height;
2137 const int src_w =
in->width;
2138 const int sliceh_start = !column ?
ff_slice_pos(src_h, jobnr, nb_jobs) : 0;
2139 const int sliceh_end = !column ?
ff_slice_pos(src_h, jobnr + 1, nb_jobs) : src_h;
2140 const int slicew_start = column ?
ff_slice_pos(src_w, jobnr, nb_jobs) : 0;
2141 const int slicew_end = column ?
ff_slice_pos(src_w, jobnr + 1, nb_jobs) : src_w;
2142 const int c0_shift_w =
s->shift_w[ component + 0 ];
2143 const int c1_shift_w =
s->shift_w[(component + 1) %
s->ncomp];
2144 const int c2_shift_w =
s->shift_w[(component + 2) %
s->ncomp];
2145 const int c0_shift_h =
s->shift_h[ component + 0 ];
2146 const int c1_shift_h =
s->shift_h[(component + 1) %
s->ncomp];
2147 const int c2_shift_h =
s->shift_h[(component + 2) %
s->ncomp];
2148 const int c0_linesize =
in->linesize[ plane + 0 ];
2149 const int c1_linesize =
in->linesize[(plane + 1) %
s->ncomp];
2150 const int c2_linesize =
in->linesize[(plane + 2) %
s->ncomp];
2151 const uint8_t *c0_data =
in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
2152 const uint8_t *c1_data =
in->data[(plane + 1) %
s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
2153 const uint8_t *c2_data =
in->data[(plane + 2) %
s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
2154 const int d0_linesize =
out->linesize[ plane + 0 ];
2155 const int d1_linesize =
out->linesize[(plane + 1) %
s->ncomp];
2156 const int d2_linesize =
out->linesize[(plane + 2) %
s->ncomp];
2161 const int d0_signed_linesize = d0_linesize * (
mirror == 1 ? -1 : 1);
2162 const int d1_signed_linesize = d1_linesize * (
mirror == 1 ? -1 : 1);
2163 const int d2_signed_linesize = d2_linesize * (
mirror == 1 ? -1 : 1);
2164 uint8_t *d0_data =
out->data[plane] + offset_y * d0_linesize + offset_x;
2165 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + offset_y * d1_linesize + offset_x;
2166 uint8_t *d2_data =
out->data[(plane + 2) %
s->ncomp] + offset_y * d2_linesize + offset_x;
2167 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (
s->size - 1);
2169 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (
s->size - 1);
2171 uint8_t *
const d2_bottom_line = d2_data + d2_linesize * (
s->size - 1);
2174 for (y = 0; y < src_h; y++) {
2175 for (x = slicew_start; x < slicew_end; x++) {
2176 const int c0 = c0_data[x >> c0_shift_w];
2177 const int c1 = c1_data[x >> c1_shift_w];
2178 const int c2 = c2_data[x >> c2_shift_w];
2181 *(d1 + d1_signed_linesize * c0 + x) =
c1;
2182 *(d2 + d2_signed_linesize * c0 + x) =
c2;
2185 if (!c0_shift_h || (y & c0_shift_h))
2186 c0_data += c0_linesize;
2187 if (!c1_shift_h || (y & c1_shift_h))
2188 c1_data += c1_linesize;
2189 if (!c2_shift_h || (y & c2_shift_h))
2190 c2_data += c2_linesize;
2191 d0_data += d0_linesize;
2192 d1_data += d1_linesize;
2193 d2_data += d2_linesize;
2196 uint8_t *d0_data =
out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
2197 uint8_t *d1_data =
out->data[(plane + 1) %
s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
2198 uint8_t *d2_data =
out->data[(plane + 2) %
s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
2201 d0_data +=
s->size - 1;
2202 d1_data +=
s->size - 1;
2203 d2_data +=
s->size - 1;
2206 for (y = sliceh_start; y < sliceh_end; y++) {
2207 for (x = 0; x < src_w; x++) {
2208 const int c0 = c0_data[x >> c0_shift_w];
2209 const int c1 = c1_data[x >> c1_shift_w];
2210 const int c2 = c2_data[x >> c2_shift_w];
2214 *(d1_data - c0) =
c1;
2215 *(d2_data - c0) =
c2;
2218 *(d1_data + c0) =
c1;
2219 *(d2_data + c0) =
c2;
2223 if (!c0_shift_h || (y & c0_shift_h))
2224 c0_data += c0_linesize;
2225 if (!c1_shift_h || (y & c1_shift_h))
2226 c1_data += c1_linesize;
2227 if (!c2_shift_h || (y & c2_shift_h))
2228 c2_data += c2_linesize;
2229 d0_data += d0_linesize;
2230 d1_data += d1_linesize;
2231 d2_data += d2_linesize;
2236 #define ACOLOR_FUNC(name, column, mirror) \
2237 static int acolor_##name(AVFilterContext *ctx, \
2238 void *arg, int jobnr, \
2241 WaveformContext *s = ctx->priv; \
2242 ThreadData *td = arg; \
2243 AVFrame *in = td->in; \
2244 AVFrame *out = td->out; \
2245 int component = td->component; \
2246 int offset_y = td->offset_y; \
2247 int offset_x = td->offset_x; \
2249 acolor(s, in, out, component, s->intensity, \
2250 offset_y, offset_x, column, mirror, \
2265 { { {
"16", 16+128 }, {
"16", 16+128 }, {
"16", 16+128 }, {
"0", 0+128 } } },
2266 { { {
"128", 128+128 }, {
"128", 128+128 }, {
"128", 128+128 }, {
"128", 128+128 } } },
2267 { { {
"235", 235+128 }, {
"240", 240+128 }, {
"240", 240+128 }, {
"255", 255+128 } } },
2271 { { {
"32", 32+256 }, {
"32", 32+256 }, {
"32", 32+256 }, {
"0", 0+256 } } },
2272 { { {
"256", 256+256 }, {
"256", 256+256 }, {
"256", 256+256 }, {
"256", 256+256 } } },
2273 { { {
"470", 470+256 }, {
"480", 480+256 }, {
"480", 480+256 }, {
"511", 511+256 } } },
2277 { { {
"64", 64+512 }, {
"64", 64+512 }, {
"64", 64+512 }, {
"0", 0+512 } } },
2278 { { {
"512", 512+512 }, {
"512", 512+512 }, {
"512", 512+512 }, {
"512", 512+512 } } },
2279 { { {
"940", 940+512 }, {
"960", 960+512 }, {
"960", 960+512 }, {
"1023", 1023+512 } } },
2283 { { {
"256", 256+2048 }, {
"256", 256+2048 }, {
"256", 256+2048 }, {
"0", 0+2048 } } },
2284 { { {
"2048", 2048+2048 }, {
"2048", 2048+2048 }, {
"2048", 2048+2048 }, {
"2048", 2048+2048 } } },
2285 { { {
"3760", 3760+2048 }, {
"3840", 3840+2048 }, {
"3840", 3840+2048 }, {
"4095", 4095+2048 } } },
2289 { { {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 0+128 } } },
2290 { { {
"175", 71+128 }, {
"175", 72+128 }, {
"175", 72+128 }, {
"175", 64+128 } } },
2291 { { {
"350", 126+128 }, {
"350", 128+128 }, {
"350", 128+128 }, {
"350", 128+128 } } },
2292 { { {
"525", 180+128 }, {
"525", 184+128 }, {
"525", 184+128 }, {
"525", 192+128 } } },
2293 { { {
"700", 235+128 }, {
"700", 240+128 }, {
"700", 240+128 }, {
"700", 255+128 } } },
2297 { { {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 0+256 } } },
2298 { { {
"175", 142+256 }, {
"175", 144+256 }, {
"175", 144+256 }, {
"175", 128+256 } } },
2299 { { {
"350", 251+256 }, {
"350", 256+256 }, {
"350", 256+256 }, {
"350", 256+256 } } },
2300 { { {
"525", 361+256 }, {
"525", 368+256 }, {
"525", 368+256 }, {
"525", 384+256 } } },
2301 { { {
"700", 470+256 }, {
"700", 480+256 }, {
"700", 480+256 }, {
"700", 511+256 } } },
2305 { { {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 0+512 } } },
2306 { { {
"175", 283+512 }, {
"175", 288+512 }, {
"175", 288+512 }, {
"175", 256+512 } } },
2307 { { {
"350", 502+512 }, {
"350", 512+512 }, {
"350", 512+512 }, {
"350", 512+512 } } },
2308 { { {
"525", 721+512 }, {
"525", 736+512 }, {
"525", 736+512 }, {
"525", 768+512 } } },
2309 { { {
"700", 940+512 }, {
"700", 960+512 }, {
"700", 960+512 }, {
"700", 1023+512 } } },
2313 { { {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 0+2048 } } },
2314 { { {
"175", 1132+2048 }, {
"175", 1152+2048 }, {
"175", 1152+2048 }, {
"175", 1024+2048 } } },
2315 { { {
"350", 2008+2048 }, {
"350", 2048+2048 }, {
"350", 2048+2048 }, {
"350", 2048+2048 } } },
2316 { { {
"525", 2884+2048 }, {
"525", 2944+2048 }, {
"525", 2944+2048 }, {
"525", 3072+2048 } } },
2317 { { {
"700", 3760+2048 }, {
"700", 3840+2048 }, {
"700", 3840+2048 }, {
"700", 4095+2048 } } },
2321 { { {
"-25", -39+128 }, {
"-25", -40+128 }, {
"-25", -40+128 }, {
"-25", -64+128 } } },
2322 { { {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 0+128 } } },
2323 { { {
"25", 71+128 }, {
"25", 72+128 }, {
"25", 72+128 }, {
"25", 64+128 } } },
2324 { { {
"50", 126+128 }, {
"50", 128+128 }, {
"50", 128+128 }, {
"50", 128+128 } } },
2325 { { {
"75", 180+128 }, {
"75", 184+128 }, {
"75", 184+128 }, {
"75", 192+128 } } },
2326 { { {
"100", 235+128 }, {
"100", 240+128 }, {
"100", 240+128 }, {
"100", 256+128 } } },
2327 { { {
"125", 290+128 }, {
"125", 296+128 }, {
"125", 296+128 }, {
"125", 320+128 } } },
2331 { { {
"-25", -78+256 }, {
"-25", -80+256 }, {
"-25", -80+256 }, {
"-25",-128+256 } } },
2332 { { {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 0+256 } } },
2333 { { {
"25", 142+256 }, {
"25", 144+256 }, {
"25", 144+256 }, {
"25", 128+256 } } },
2334 { { {
"50", 251+256 }, {
"50", 256+256 }, {
"50", 256+256 }, {
"50", 256+256 } } },
2335 { { {
"75", 361+256 }, {
"75", 368+256 }, {
"75", 368+256 }, {
"75", 384+256 } } },
2336 { { {
"100", 470+256 }, {
"100", 480+256 }, {
"100", 480+256 }, {
"100", 512+256 } } },
2337 { { {
"125", 580+256 }, {
"125", 592+256 }, {
"125", 592+256 }, {
"125", 640+256 } } },
2341 { { {
"-25",-156+512 }, {
"-25",-160+512 }, {
"-25",-160+512 }, {
"-25", -256+512 } } },
2342 { { {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 0+512 } } },
2343 { { {
"25", 283+512 }, {
"25", 288+512 }, {
"25", 288+512 }, {
"25", 256+512 } } },
2344 { { {
"50", 502+512 }, {
"50", 512+512 }, {
"50", 512+512 }, {
"50", 512+512 } } },
2345 { { {
"75", 721+512 }, {
"75", 736+512 }, {
"75", 736+512 }, {
"75", 768+512 } } },
2346 { { {
"100", 940+512 }, {
"100", 960+512 }, {
"100", 960+512 }, {
"100", 1024+512 } } },
2347 { { {
"125",1160+512 }, {
"125",1184+512 }, {
"125",1184+512 }, {
"125", 1280+512 } } },
2351 { { {
"-25", -624+2048 }, {
"-25", -640+2048 }, {
"-25", -640+2048 }, {
"-25",-1024+2048 } } },
2352 { { {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 0+2048 } } },
2353 { { {
"25", 1132+2048 }, {
"25", 1152+2048 }, {
"25", 1152+2048 }, {
"25", 1024+2048 } } },
2354 { { {
"50", 2008+2048 }, {
"50", 2048+2048 }, {
"50", 2048+2048 }, {
"50", 2048+2048 } } },
2355 { { {
"75", 2884+2048 }, {
"75", 2944+2048 }, {
"75", 2944+2048 }, {
"75", 3072+2048 } } },
2356 { { {
"100", 3760+2048 }, {
"100", 3840+2048 }, {
"100", 3840+2048 }, {
"100", 4096+2048 } } },
2357 { { {
"125", 4640+2048 }, {
"125", 4736+2048 }, {
"125", 4736+2048 }, {
"125", 5120+2048 } } },
2361 { { {
"16", 16+256 }, {
"16", 16+256 }, {
"16", 16+256 }, {
"0", 0+256 } } },
2362 { { {
"128", 128+256 }, {
"128", 128+256 }, {
"128", 128+256 }, {
"128", 128+256 } } },
2363 { { {
"235", 235+256 }, {
"240", 240+256 }, {
"240", 240+256 }, {
"255", 255+256 } } },
2367 { { {
"32", 32+512 }, {
"32", 32+512 }, {
"32", 32+512 }, {
"0", 0+512 } } },
2368 { { {
"256", 256+512 }, {
"256", 256+512 }, {
"256", 256+512 }, {
"256", 256+512 } } },
2369 { { {
"470", 470+512 }, {
"480", 480+512 }, {
"480", 480+512 }, {
"511", 511+512 } } },
2373 { { {
"64", 64+1024 }, {
"64", 64+1024 }, {
"64", 64+1024 }, {
"0", 0+1024 } } },
2374 { { {
"512", 512+1024 }, {
"512", 512+1024 }, {
"512", 512+1024 }, {
"512", 512+1024 } } },
2375 { { {
"940", 940+1024 }, {
"960", 960+1024 }, {
"960", 960+1024 }, {
"1023", 1023+1024 } } },
2379 { { {
"256", 256+4096 }, {
"256", 256+4096 }, {
"256", 256+4096 }, {
"0", 0+4096 } } },
2380 { { {
"2048", 2048+4096 }, {
"2048", 2048+4096 }, {
"2048", 2048+4096 }, {
"2048", 2048+4096 } } },
2381 { { {
"3760", 3760+4096 }, {
"3840", 3840+4096 }, {
"3840", 3840+4096 }, {
"4095", 4095+4096 } } },
2385 { { {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 0+256 } } },
2386 { { {
"175", 71+256 }, {
"175", 72+256 }, {
"175", 72+256 }, {
"175", 64+256 } } },
2387 { { {
"350", 126+256 }, {
"350", 128+256 }, {
"350", 128+256 }, {
"350", 128+256 } } },
2388 { { {
"525", 180+256 }, {
"525", 184+256 }, {
"525", 184+256 }, {
"525", 192+256 } } },
2389 { { {
"700", 235+256 }, {
"700", 240+256 }, {
"700", 240+256 }, {
"700", 255+256 } } },
2393 { { {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 0+512 } } },
2394 { { {
"175", 142+512 }, {
"175", 144+512 }, {
"175", 144+512 }, {
"175", 128+512 } } },
2395 { { {
"350", 251+512 }, {
"350", 256+512 }, {
"350", 256+512 }, {
"350", 256+512 } } },
2396 { { {
"525", 361+512 }, {
"525", 368+512 }, {
"525", 368+512 }, {
"525", 384+512 } } },
2397 { { {
"700", 470+512 }, {
"700", 480+512 }, {
"700", 480+512 }, {
"700", 511+512 } } },
2401 { { {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 0+1024 } } },
2402 { { {
"175", 283+1024 }, {
"175", 288+1024 }, {
"175", 288+1024 }, {
"175", 256+1024 } } },
2403 { { {
"350", 502+1024 }, {
"350", 512+1024 }, {
"350", 512+1024 }, {
"350", 512+1024 } } },
2404 { { {
"525", 721+1024 }, {
"525", 736+1024 }, {
"525", 736+1024 }, {
"525", 768+1024 } } },
2405 { { {
"700", 940+1024 }, {
"700", 960+1024 }, {
"700", 960+1024 }, {
"700", 1023+1024 } } },
2409 { { {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 0+4096 } } },
2410 { { {
"175", 1132+4096 }, {
"175", 1152+4096 }, {
"175", 1152+4096 }, {
"175", 1024+4096 } } },
2411 { { {
"350", 2008+4096 }, {
"350", 2048+4096 }, {
"350", 2048+4096 }, {
"350", 2048+4096 } } },
2412 { { {
"525", 2884+4096 }, {
"525", 2944+4096 }, {
"525", 2944+4096 }, {
"525", 3072+4096 } } },
2413 { { {
"700", 3760+4096 }, {
"700", 3840+4096 }, {
"700", 3840+4096 }, {
"700", 4095+4096 } } },
2417 { { {
"-25", -39+256 }, {
"-25", -40+256 }, {
"-25", -40+256 }, {
"-25", -64+256 } } },
2418 { { {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 0+256 } } },
2419 { { {
"25", 71+256 }, {
"25", 72+256 }, {
"25", 72+256 }, {
"25", 64+256 } } },
2420 { { {
"50", 126+256 }, {
"50", 128+256 }, {
"50", 128+256 }, {
"50", 128+256 } } },
2421 { { {
"75", 180+256 }, {
"75", 184+256 }, {
"75", 184+256 }, {
"75", 192+256 } } },
2422 { { {
"100", 235+256 }, {
"100", 240+256 }, {
"100", 240+256 }, {
"100", 256+256 } } },
2423 { { {
"125", 290+256 }, {
"125", 296+256 }, {
"125", 296+256 }, {
"125", 320+256 } } },
2427 { { {
"-25", -78+512 }, {
"-25", -80+512 }, {
"-25", -80+512 }, {
"-25",-128+512 } } },
2428 { { {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 0+512 } } },
2429 { { {
"25", 142+512 }, {
"25", 144+512 }, {
"25", 144+512 }, {
"25", 128+512 } } },
2430 { { {
"50", 251+512 }, {
"50", 256+512 }, {
"50", 256+512 }, {
"50", 256+512 } } },
2431 { { {
"75", 361+512 }, {
"75", 368+512 }, {
"75", 368+512 }, {
"75", 384+512 } } },
2432 { { {
"100", 470+512 }, {
"100", 480+512 }, {
"100", 480+512 }, {
"100", 512+512 } } },
2433 { { {
"125", 580+512 }, {
"125", 592+512 }, {
"125", 592+512 }, {
"125", 640+512 } } },
2437 { { {
"-25",-156+1024 }, {
"-25",-160+1024 }, {
"-25",-160+1024 }, {
"-25", -256+1024 } } },
2438 { { {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 0+1024 } } },
2439 { { {
"25", 283+1024 }, {
"25", 288+1024 }, {
"25", 288+1024 }, {
"25", 256+1024 } } },
2440 { { {
"50", 502+1024 }, {
"50", 512+1024 }, {
"50", 512+1024 }, {
"50", 512+1024 } } },
2441 { { {
"75", 721+1024 }, {
"75", 736+1024 }, {
"75", 736+1024 }, {
"75", 768+1024 } } },
2442 { { {
"100", 940+1024 }, {
"100", 960+1024 }, {
"100", 960+1024 }, {
"100", 1024+1024 } } },
2443 { { {
"125",1160+1024 }, {
"125",1184+1024 }, {
"125",1184+1024 }, {
"125", 1280+1024 } } },
2447 { { {
"-25", -624+4096 }, {
"-25", -640+4096 }, {
"-25", -640+4096 }, {
"-25",-1024+4096 } } },
2448 { { {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 0+4096 } } },
2449 { { {
"25", 1132+4096 }, {
"25", 1152+4096 }, {
"25", 1152+4096 }, {
"25", 1024+4096 } } },
2450 { { {
"50", 2008+4096 }, {
"50", 2048+4096 }, {
"50", 2048+4096 }, {
"50", 2048+4096 } } },
2451 { { {
"75", 2884+4096 }, {
"75", 2944+4096 }, {
"75", 2944+4096 }, {
"75", 3072+4096 } } },
2452 { { {
"100", 3760+4096 }, {
"100", 3840+4096 }, {
"100", 3840+4096 }, {
"100", 4096+4096 } } },
2453 { { {
"125", 4640+4096 }, {
"125", 4736+4096 }, {
"125", 4736+4096 }, {
"125", 5120+4096 } } },
2457 { { {
"16", 16 }, {
"16", 16 }, {
"16", 16 }, {
"0", 0 } } },
2458 { { {
"128", 128 }, {
"128", 128 }, {
"128", 128 }, {
"128", 128 } } },
2459 { { {
"235", 235 }, {
"240", 240 }, {
"240", 240 }, {
"255", 255 } } },
2463 { { {
"32", 32 }, {
"32", 32 }, {
"32", 32 }, {
"0", 0 } } },
2464 { { {
"256", 256 }, {
"256", 256 }, {
"256", 256 }, {
"256", 256 } } },
2465 { { {
"470", 470 }, {
"480", 480 }, {
"480", 480 }, {
"511", 511 } } },
2469 { { {
"64", 64 }, {
"64", 64 }, {
"64", 64 }, {
"0", 0 } } },
2470 { { {
"512", 512 }, {
"512", 512 }, {
"512", 512 }, {
"512", 512 } } },
2471 { { {
"940", 940 }, {
"960", 960 }, {
"960", 960 }, {
"1023", 1023 } } },
2475 { { {
"256", 256 }, {
"256", 256 }, {
"256", 256 }, {
"0", 0 } } },
2476 { { {
"2048", 2048 }, {
"2048", 2048 }, {
"2048", 2048 }, {
"2048", 2048 } } },
2477 { { {
"3760", 3760 }, {
"3840", 3840 }, {
"3840", 3840 }, {
"4095", 4095 } } },
2481 { { {
"0", 16 }, {
"0", 16 }, {
"0", 16 }, {
"0", 0 } } },
2482 { { {
"175", 71 }, {
"175", 72 }, {
"175", 72 }, {
"175", 64 } } },
2483 { { {
"350", 126 }, {
"350", 128 }, {
"350", 128 }, {
"350", 128 } } },
2484 { { {
"525", 180 }, {
"525", 184 }, {
"525", 184 }, {
"525", 192 } } },
2485 { { {
"700", 235 }, {
"700", 240 }, {
"700", 240 }, {
"700", 255 } } },
2489 { { {
"0", 32 }, {
"0", 32 }, {
"0", 32 }, {
"0", 0 } } },
2490 { { {
"175", 142 }, {
"175", 144 }, {
"175", 144 }, {
"175", 128 } } },
2491 { { {
"350", 251 }, {
"350", 256 }, {
"350", 256 }, {
"350", 256 } } },
2492 { { {
"525", 361 }, {
"525", 368 }, {
"525", 368 }, {
"525", 384 } } },
2493 { { {
"700", 470 }, {
"700", 480 }, {
"700", 480 }, {
"700", 511 } } },
2497 { { {
"0", 64 }, {
"0", 64 }, {
"0", 64 }, {
"0", 0 } } },
2498 { { {
"175", 283 }, {
"175", 288 }, {
"175", 288 }, {
"175", 256 } } },
2499 { { {
"350", 502 }, {
"350", 512 }, {
"350", 512 }, {
"350", 512 } } },
2500 { { {
"525", 721 }, {
"525", 736 }, {
"525", 736 }, {
"525", 768 } } },
2501 { { {
"700", 940 }, {
"700", 960 }, {
"700", 960 }, {
"700", 1023 } } },
2505 { { {
"0", 256 }, {
"0", 256 }, {
"0", 256 }, {
"0", 0 } } },
2506 { { {
"175", 1132 }, {
"175", 1152 }, {
"175", 1152 }, {
"175", 1024 } } },
2507 { { {
"350", 2008 }, {
"350", 2048 }, {
"350", 2048 }, {
"350", 2048 } } },
2508 { { {
"525", 2884 }, {
"525", 2944 }, {
"525", 2944 }, {
"525", 3072 } } },
2509 { { {
"700", 3760 }, {
"700", 3840 }, {
"700", 3840 }, {
"700", 4095 } } },
2513 { { {
"0", 16 }, {
"0", 16 }, {
"0", 16 }, {
"0", 0 } } },
2514 { { {
"25", 71 }, {
"25", 72 }, {
"25", 72 }, {
"25", 64 } } },
2515 { { {
"50", 126 }, {
"50", 128 }, {
"50", 128 }, {
"50", 128 } } },
2516 { { {
"75", 180 }, {
"75", 184 }, {
"75", 184 }, {
"75", 192 } } },
2517 { { {
"100", 235 }, {
"100", 240 }, {
"100", 240 }, {
"100", 255 } } },
2521 { { {
"0", 32 }, {
"0", 32 }, {
"0", 32 }, {
"0", 0 } } },
2522 { { {
"25", 142 }, {
"25", 144 }, {
"25", 144 }, {
"25", 128 } } },
2523 { { {
"50", 251 }, {
"50", 256 }, {
"50", 256 }, {
"50", 256 } } },
2524 { { {
"75", 361 }, {
"75", 368 }, {
"75", 368 }, {
"75", 384 } } },
2525 { { {
"100", 470 }, {
"100", 480 }, {
"100", 480 }, {
"100", 511 } } },
2529 { { {
"0", 64 }, {
"0", 64 }, {
"0", 64 }, {
"0", 0 } } },
2530 { { {
"25", 283 }, {
"25", 288 }, {
"25", 288 }, {
"25", 256 } } },
2531 { { {
"50", 502 }, {
"50", 512 }, {
"50", 512 }, {
"50", 512 } } },
2532 { { {
"75", 721 }, {
"75", 736 }, {
"75", 736 }, {
"75", 768 } } },
2533 { { {
"100", 940 }, {
"100", 960 }, {
"100", 960 }, {
"100", 1023 } } },
2537 { { {
"0", 256 }, {
"0", 256 }, {
"0", 256 }, {
"0", 0 } } },
2538 { { {
"25", 1132 }, {
"25", 1152 }, {
"25", 1152 }, {
"25", 1024 } } },
2539 { { {
"50", 2008 }, {
"50", 2048 }, {
"50", 2048 }, {
"50", 2048 } } },
2540 { { {
"75", 2884 }, {
"75", 2944 }, {
"75", 2944 }, {
"75", 3072 } } },
2541 { { {
"100", 3760 }, {
"100", 3840 }, {
"100", 3840 }, {
"100", 4095 } } },
2545 { { {
"50", 50 }, {
"50", 50 }, {
"50", 50 }, {
"50", 50 } } },
2546 { { {
"100", 100 }, {
"100", 100 }, {
"100", 100 }, {
"100", 100 } } },
2547 { { {
"150", 150 }, {
"150", 150 }, {
"150", 150 }, {
"150", 150 } } },
2548 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2549 { { {
"255", 255 }, {
"255", 255 }, {
"255", 255 }, {
"255", 255 } } },
2553 { { {
"100", 100 }, {
"100", 100 }, {
"100", 100 }, {
"100", 100 } } },
2554 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2555 { { {
"300", 300 }, {
"300", 300 }, {
"300", 300 }, {
"300", 300 } } },
2556 { { {
"400", 400 }, {
"400", 400 }, {
"400", 400 }, {
"400", 400 } } },
2557 { { {
"500", 500 }, {
"500", 500 }, {
"500", 500 }, {
"500", 500 } } },
2561 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2562 { { {
"400", 400 }, {
"400", 400 }, {
"400", 400 }, {
"400", 400 } } },
2563 { { {
"600", 600 }, {
"600", 600 }, {
"600", 600 }, {
"600", 600 } } },
2564 { { {
"800", 800 }, {
"800", 800 }, {
"800", 800 }, {
"800", 800 } } },
2565 { { {
"1000",1000 }, {
"1000",1000 }, {
"1000",1000 }, {
"1000",1000 } } },
2569 { { {
"800", 800 }, {
"800", 800 }, {
"800", 800 }, {
"800", 800 } } },
2570 { { {
"1600", 1600 }, {
"1600", 1600 }, {
"1600", 1600 }, {
"1600", 1600 } } },
2571 { { {
"2400", 2400 }, {
"2400", 2400 }, {
"2400", 2400 }, {
"2400", 2400 } } },
2572 { { {
"3200", 3200 }, {
"3200", 3200 }, {
"3200", 3200 }, {
"3200", 3200 } } },
2573 { { {
"4000", 4000 }, {
"4000", 4000 }, {
"4000", 4000 }, {
"4000", 4000 } } },
2580 for (y = 0; y <
height; y += step) {
2581 dst[0] = v * o1 + dst[0] * o2;
2583 dst += linesize * step;
2589 uint16_t *dst = (uint16_t *)ddst;
2592 for (y = 0; y <
height; y += step) {
2593 dst[0] = v * o1 + dst[0] * o2;
2595 dst += (linesize / 2) * step;
2603 for (x = 0; x <
width; x += step) {
2604 dst[x] = v * o1 + dst[x] * o2;
2610 uint16_t *dst = (uint16_t *)ddst;
2613 for (x = 0; x <
width; x += step) {
2614 dst[x] = v * o1 + dst[x] * o2;
2626 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2627 for (
i = 0; txt[
i];
i++) {
2629 int v =
color[plane];
2631 uint8_t *p =
out->data[plane] + y *
out->linesize[plane] + (x +
i * 8);
2632 for (char_y = 0; char_y < font_height; char_y++) {
2634 if (font[txt[
i] * font_height + char_y] &
mask)
2635 p[0] = p[0] * o2 + v * o1;
2638 p +=
out->linesize[plane] - 8;
2652 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2653 for (
i = 0; txt[
i];
i++) {
2657 uint16_t *p = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]) + (x +
i * 8);
2658 for (char_y = 0; char_y < font_height; char_y++) {
2660 if (font[txt[
i] * font_height + char_y] &
mask)
2661 p[0] = p[0] * o2 + v * o1;
2664 p +=
out->linesize[plane] / 2 - 8;
2678 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2679 for (
i = 0; txt[
i];
i++) {
2681 int v =
color[plane];
2683 for (char_y = font_height - 1; char_y >= 0; char_y--) {
2684 uint8_t *p =
out->data[plane] + (y +
i * 10) *
out->linesize[plane] + x;
2686 if (font[txt[
i] * font_height + font_height - 1 - char_y] &
mask)
2687 p[char_y] = p[char_y] * o2 + v * o1;
2688 p +=
out->linesize[plane];
2703 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2704 for (
i = 0; txt[
i];
i++) {
2708 for (char_y = 0; char_y < font_height; char_y++) {
2709 uint16_t *p = (uint16_t *)(
out->data[plane] + (y +
i * 10) *
out->linesize[plane]) + x;
2711 if (font[txt[
i] * font_height + font_height - 1 - char_y] &
mask)
2712 p[char_y] = p[char_y] * o2 + v * o1;
2713 p +=
out->linesize[plane] / 2;
2724 for (y = 0; y <
height; y += step) {
2725 dst[0] = (v - dst[0]) * o1 + dst[0] * o2;
2727 dst += linesize * step;
2733 uint16_t *dst = (uint16_t *)ddst;
2736 for (y = 0; y <
height; y += step) {
2737 dst[0] = (v - dst[0]) * o1 + dst[0] * o2;
2739 dst += (linesize / 2) * step;
2747 for (x = 0; x <
width; x += step) {
2748 dst[x] = (v - dst[x]) * o1 + dst[x] * o2;
2754 uint16_t *dst = (uint16_t *)ddst;
2757 for (x = 0; x <
width; x += step) {
2758 dst[x] = (v - dst[x]) * o1 + dst[x] * o2;
2770 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2771 for (
i = 0; txt[
i];
i++) {
2773 int v =
color[plane];
2775 uint8_t *p =
out->data[plane] + y *
out->linesize[plane] + (x +
i * 8);
2776 for (char_y = 0; char_y < font_height; char_y++) {
2778 if (font[txt[
i] * font_height + char_y] &
mask)
2779 p[0] = p[0] * o2 + (v - p[0]) * o1;
2782 p +=
out->linesize[plane] - 8;
2796 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2797 for (
i = 0; txt[
i];
i++) {
2801 uint16_t *p = (uint16_t *)(
out->data[plane] + y *
out->linesize[plane]) + (x +
i * 8);
2802 for (char_y = 0; char_y < font_height; char_y++) {
2804 if (font[txt[
i] * font_height + char_y] &
mask)
2805 p[0] = p[0] * o2 + (v - p[0]) * o1;
2808 p +=
out->linesize[plane] / 2 - 8;
2822 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2823 for (
i = 0; txt[
i];
i++) {
2825 int v =
color[plane];
2827 for (char_y = font_height - 1; char_y >= 0; char_y--) {
2828 uint8_t *p =
out->data[plane] + (y +
i * 10) *
out->linesize[plane] + x;
2830 if (font[txt[
i] * font_height + font_height - 1 - char_y] &
mask)
2831 p[char_y] = p[char_y] * o2 + (v - p[char_y]) * o1;
2832 p +=
out->linesize[plane];
2847 for (plane = 0; plane < 4 &&
out->data[plane]; plane++) {
2848 for (
i = 0; txt[
i];
i++) {
2852 for (char_y = 0; char_y < font_height; char_y++) {
2853 uint16_t *p = (uint16_t *)(
out->data[plane] + (y +
i * 10) *
out->linesize[plane]) + x;
2855 if (font[txt[
i] * font_height + font_height - 1 - char_y] &
mask)
2856 p[char_y] = p[char_y] * o2 + (v - p[char_y]) * o1;
2857 p +=
out->linesize[plane] / 2;
2870 const int step = (
s->flags & 2) + 1;
2871 const float o1 =
s->opacity;
2872 const float o2 = 1. - o1;
2874 int C, k = 0,
c, p, l, offset_x = 0, offset_y = 0;
2876 for (
c = 0;
c <
s->ncomp;
c++) {
2877 if (!((1 <<
c) &
s->pcomp) || (!
s->display && k > 0))
2882 for (p = 0; p <
s->ncomp; p++) {
2883 const int v =
s->grat_yuva_color[p];
2884 for (l = 0; l <
s->nb_glines; l++) {
2885 const uint16_t
pos =
s->glines[l].line[
C].pos;
2886 int x = offset_x + (
s->mirror ?
s->size - 1 -
pos :
pos);
2887 uint8_t *dst =
out->data[p] + offset_y *
out->linesize[p] + x;
2889 s->blend_line(dst,
height,
out->linesize[p], o1, o2, v, step);
2893 for (l = 0; l <
s->nb_glines && (
s->flags & 1); l++) {
2894 const char *
name =
s->glines[l].line[
C].name;
2895 const uint16_t
pos =
s->glines[l].line[
C].pos;
2896 int x = offset_x + (
s->mirror ?
s->size - 1 -
pos :
pos) - 10;
2901 s->draw_text(
out, x, offset_y + 2, 1, o1, o2,
name,
s->grat_yuva_color);
2904 offset_x +=
s->size * (
s->display ==
STACK);
2911 const int step = (
s->flags & 2) + 1;
2912 const float o1 =
s->opacity;
2913 const float o2 = 1. - o1;
2914 const int mult =
s->max / 256;
2916 int C, k = 0,
c, p, l, offset_x = 0, offset_y = 0;
2918 for (
c = 0;
c <
s->ncomp;
c++) {
2919 if (!((1 <<
c) &
s->pcomp) || (!
s->display && k > 0))
2924 for (p = 0; p <
s->ncomp; p++) {
2925 const int v =
s->grat_yuva_color[p] *
mult;
2926 for (l = 0; l <
s->nb_glines ; l++) {
2927 const uint16_t
pos =
s->glines[l].line[
C].pos;
2928 int x = offset_x + (
s->mirror ?
s->size - 1 -
pos :
pos);
2931 s->blend_line(dst,
height,
out->linesize[p], o1, o2, v, step);
2935 for (l = 0; l <
s->nb_glines && (
s->flags & 1); l++) {
2936 const char *
name =
s->glines[l].line[
C].name;
2937 const uint16_t
pos =
s->glines[l].line[
C].pos;
2938 int x = offset_x + (
s->mirror ?
s->size - 1 -
pos :
pos) - 10;
2943 s->draw_text(
out, x, offset_y + 2,
mult, o1, o2,
name,
s->grat_yuva_color);
2946 offset_x +=
s->size * (
s->display ==
STACK);
2953 const int step = (
s->flags & 2) + 1;
2954 const float o1 =
s->opacity;
2955 const float o2 = 1. - o1;
2957 int C, k = 0,
c, p, l, offset_y = 0, offset_x = 0;
2959 for (
c = 0;
c <
s->ncomp;
c++) {
2960 if ((!((1 <<
c) &
s->pcomp) || (!
s->display && k > 0)))
2965 for (p = 0; p <
s->ncomp; p++) {
2966 const int v =
s->grat_yuva_color[p];
2967 for (l = 0; l <
s->nb_glines ; l++) {
2968 const uint16_t
pos =
s->glines[l].line[
C].pos;
2969 int y = offset_y + (
s->mirror ?
s->size - 1 -
pos :
pos);
2970 uint8_t *dst =
out->data[p] + y *
out->linesize[p] + offset_x;
2972 s->blend_line(dst,
width, 1, o1, o2, v, step);
2976 for (l = 0; l <
s->nb_glines && (
s->flags & 1); l++) {
2977 const char *
name =
s->glines[l].line[
C].name;
2978 const uint16_t
pos =
s->glines[l].line[
C].pos;
2979 int y = offset_y + (
s->mirror ?
s->size - 1 -
pos :
pos) - 10;
2984 s->draw_text(
out, 2 + offset_x, y, 1, o1, o2,
name,
s->grat_yuva_color);
2987 offset_y +=
s->size * (
s->display ==
STACK);
2994 const int step = (
s->flags & 2) + 1;
2995 const float o1 =
s->opacity;
2996 const float o2 = 1. - o1;
2997 const int mult =
s->max / 256;
2999 int C, k = 0,
c, p, l, offset_x = 0, offset_y = 0;
3001 for (
c = 0;
c <
s->ncomp;
c++) {
3002 if ((!((1 <<
c) &
s->pcomp) || (!
s->display && k > 0)))
3007 for (p = 0; p <
s->ncomp; p++) {
3008 const int v =
s->grat_yuva_color[p] *
mult;
3009 for (l = 0; l <
s->nb_glines ; l++) {
3010 const uint16_t
pos =
s->glines[l].line[
C].pos;
3011 int y = offset_y + (
s->mirror ?
s->size - 1 -
pos :
pos);
3014 s->blend_line(dst,
width, 1, o1, o2, v, step);
3018 for (l = 0; l <
s->nb_glines && (
s->flags & 1); l++) {
3019 const char *
name =
s->glines[l].line[
C].name;
3020 const uint16_t
pos =
s->glines[l].line[
C].pos;
3021 int y = offset_y + (
s->mirror ?
s->size - 1 -
pos:
pos) - 10;
3026 s->draw_text(
out, 2 + offset_x, y,
mult, o1, o2,
name,
s->grat_yuva_color);
3029 offset_y +=
s->size * (
s->display ==
STACK);
3040 s->ncomp =
s->desc->nb_components;
3041 s->bits =
s->desc->comp[0].depth;
3042 s->max = 1 <<
s->bits;
3043 s->intensity =
s->fintensity * (
s->max - 1);
3045 s->shift_w[0] =
s->shift_w[3] = 0;
3046 s->shift_h[0] =
s->shift_h[3] = 0;
3047 s->shift_w[1] =
s->shift_w[2] =
s->desc->log2_chroma_w;
3048 s->shift_h[1] =
s->shift_h[2] =
s->desc->log2_chroma_h;
3052 switch (
s->filter) {
3055 case AFLAT:
s->size = 256 * 2;
break;
3056 case FLAT:
s->size = 256 * 3;
break;
3057 default:
s->size = 256;
break;
3060 switch (
s->filter | ((
s->bits > 8) << 4) |
3061 (
s->mode << 8) | (
s->mirror << 12)) {
3062 case 0x1100:
s->waveform_slice = lowpass_column_mirror;
break;
3063 case 0x1000:
s->waveform_slice = lowpass_row_mirror;
break;
3064 case 0x0100:
s->waveform_slice = lowpass_column;
break;
3065 case 0x0000:
s->waveform_slice = lowpass_row;
break;
3066 case 0x1110:
s->waveform_slice = lowpass16_column_mirror;
break;
3067 case 0x1010:
s->waveform_slice = lowpass16_row_mirror;
break;
3068 case 0x0110:
s->waveform_slice = lowpass16_column;
break;
3069 case 0x0010:
s->waveform_slice = lowpass16_row;
break;
3070 case 0x1101:
s->waveform_slice = flat_column_mirror;
break;
3071 case 0x1001:
s->waveform_slice = flat_row_mirror;
break;
3072 case 0x0101:
s->waveform_slice = flat_column;
break;
3073 case 0x0001:
s->waveform_slice = flat_row;
break;
3074 case 0x1111:
s->waveform_slice = flat16_column_mirror;
break;
3075 case 0x1011:
s->waveform_slice = flat16_row_mirror;
break;
3076 case 0x0111:
s->waveform_slice = flat16_column;
break;
3077 case 0x0011:
s->waveform_slice = flat16_row;
break;
3078 case 0x1102:
s->waveform_slice = aflat_column_mirror;
break;
3079 case 0x1002:
s->waveform_slice = aflat_row_mirror;
break;
3080 case 0x0102:
s->waveform_slice = aflat_column;
break;
3081 case 0x0002:
s->waveform_slice = aflat_row;
break;
3082 case 0x1112:
s->waveform_slice = aflat16_column_mirror;
break;
3083 case 0x1012:
s->waveform_slice = aflat16_row_mirror;
break;
3084 case 0x0112:
s->waveform_slice = aflat16_column;
break;
3085 case 0x0012:
s->waveform_slice = aflat16_row;
break;
3086 case 0x1103:
s->waveform_slice = chroma_column_mirror;
break;
3087 case 0x1003:
s->waveform_slice = chroma_row_mirror;
break;
3088 case 0x0103:
s->waveform_slice = chroma_column;
break;
3089 case 0x0003:
s->waveform_slice = chroma_row;
break;
3090 case 0x1113:
s->waveform_slice = chroma16_column_mirror;
break;
3091 case 0x1013:
s->waveform_slice = chroma16_row_mirror;
break;
3092 case 0x0113:
s->waveform_slice = chroma16_column;
break;
3093 case 0x0013:
s->waveform_slice = chroma16_row;
break;
3094 case 0x1104:
s->waveform_slice = color_column_mirror;
break;
3095 case 0x1004:
s->waveform_slice = color_row_mirror;
break;
3096 case 0x0104:
s->waveform_slice = color_column;
break;
3097 case 0x0004:
s->waveform_slice = color_row;
break;
3098 case 0x1114:
s->waveform_slice = color16_column_mirror;
break;
3099 case 0x1014:
s->waveform_slice = color16_row_mirror;
break;
3100 case 0x0114:
s->waveform_slice = color16_column;
break;
3101 case 0x0014:
s->waveform_slice = color16_row;
break;
3102 case 0x1105:
s->waveform_slice = acolor_column_mirror;
break;
3103 case 0x1005:
s->waveform_slice = acolor_row_mirror;
break;
3104 case 0x0105:
s->waveform_slice = acolor_column;
break;
3105 case 0x0005:
s->waveform_slice = acolor_row;
break;
3106 case 0x1115:
s->waveform_slice = acolor16_column_mirror;
break;
3107 case 0x1015:
s->waveform_slice = acolor16_row_mirror;
break;
3108 case 0x0115:
s->waveform_slice = acolor16_column;
break;
3109 case 0x0015:
s->waveform_slice = acolor16_row;
break;
3110 case 0x1106:
s->waveform_slice = xflat_column_mirror;
break;
3111 case 0x1006:
s->waveform_slice = xflat_row_mirror;
break;
3112 case 0x0106:
s->waveform_slice = xflat_column;
break;
3113 case 0x0006:
s->waveform_slice = xflat_row;
break;
3114 case 0x1116:
s->waveform_slice = xflat16_column_mirror;
break;
3115 case 0x1016:
s->waveform_slice = xflat16_row_mirror;
break;
3116 case 0x0116:
s->waveform_slice = xflat16_column;
break;
3117 case 0x0016:
s->waveform_slice = xflat16_row;
break;
3118 case 0x1107:
s->waveform_slice = yflat_column_mirror;
break;
3119 case 0x1007:
s->waveform_slice = yflat_row_mirror;
break;
3120 case 0x0107:
s->waveform_slice = yflat_column;
break;
3121 case 0x0007:
s->waveform_slice = yflat_row;
break;
3122 case 0x1117:
s->waveform_slice = yflat16_column_mirror;
break;
3123 case 0x1017:
s->waveform_slice = yflat16_row_mirror;
break;
3124 case 0x0117:
s->waveform_slice = yflat16_column;
break;
3125 case 0x0017:
s->waveform_slice = yflat16_row;
break;
3128 s->grat_yuva_color[0] = 255;
3129 s->grat_yuva_color[1] =
s->graticule ==
GRAT_INVERT ? 255 : 0;
3131 s->grat_yuva_color[3] = 255;
3147 switch (
s->filter) {
3158 else if (
s->graticule >
GRAT_NONE &&
s->mode == 0)
3163 switch (
s->filter) {
3282 s->size =
s->size << (
s->bits - 8);
3284 s->tint[0] = .5f * (
s->ftint[0] + 1.f) * (
s->size - 1);
3285 s->tint[1] = .5f * (
s->ftint[1] + 1.f) * (
s->size - 1);
3287 switch (inlink->
format) {
3300 s->bg_color[3] *=
s->bgopacity;
3312 for (
i = 0;
i <
s->ncomp;
i++) {
3313 if ((1 <<
i) &
s->pcomp)
3321 s->dcomp =
s->odesc->nb_components;
3339 for (p = 0; p <
s->ncomp; p++) {
3340 const int plane =
s->desc->comp[p].plane;
3343 if (!((1 << p) &
s->pcomp))
3346 for (k = 0; k < 4; k++) {
3347 s->emax[plane][k] =
s->peak +
size * (plane * 4 + k + 0);
3348 s->emin[plane][k] =
s->peak +
size * (plane * 4 + k + 16);
3353 s->eend[plane] = (
offset +
s->size - 1);
3355 for (k = 0; k < 4; k++) {
3356 s->emax[plane][k][
i] =
s->estart[plane];
3357 s->emin[plane][k][
i] =
s->eend[plane];
3383 for (k = 0; k <
s->dcomp; k++) {
3385 for (
i = 0;
i < outlink->
h ;
i++)
3386 memset(
out->data[
s->odesc->comp[k].plane] +
3387 i *
out->linesize[
s->odesc->comp[k].plane],
3388 s->bg_color[k], outlink->
w);
3390 const int mult =
s->max / 256;
3391 uint16_t *dst = (uint16_t *)
out->data[
s->odesc->comp[k].plane];
3393 for (
i = 0;
i < outlink->
h ;
i++) {
3394 for (j = 0; j < outlink->
w; j++)
3395 dst[j] =
s->bg_color[k] *
mult;
3396 dst +=
out->linesize[
s->odesc->comp[k].plane] / 2;
3401 for (k = 0,
i = 0; k <
s->ncomp; k++) {
3402 if ((1 << k) &
s->pcomp) {
3403 const int plane =
s->desc->comp[k].plane;
3409 offset_x =
s->mode ?
i++ * inlink->
w : 0;
3410 offset_y =
s->mode ? 0 :
i++ * inlink->
h;
3412 offset_y =
s->mode ?
i++ *
s->size * !!
s->display : 0;
3413 offset_x =
s->mode ? 0 :
i++ *
s->size * !!
s->display;
3419 td.offset_y = offset_y;
3420 td.offset_x = offset_x;
3422 switch (
s->filter) {
3433 envelope(
s,
out, plane, plane,
s->mode ? offset_x : offset_y);
3439 envelope(
s,
out, plane, plane,
s->mode ? offset_x : offset_y);
3440 envelope(
s,
out, plane, (plane + 1) %
s->ncomp,
s->mode ? offset_x : offset_y);
3443 envelope16(
s,
out, plane, (plane + 1) %
s->ncomp,
s->mode ? offset_x : offset_y);
3450 envelope(
s,
out, plane, (plane + 0) %
s->ncomp,
s->mode ? offset_x : offset_y);
3451 envelope(
s,
out, plane, (plane + 1) %
s->ncomp,
s->mode ? offset_x : offset_y);
3452 envelope(
s,
out, plane, (plane + 2) %
s->ncomp,
s->mode ? offset_x : offset_y);
3454 envelope16(
s,
out, plane, (plane + 0) %
s->ncomp,
s->mode ? offset_x : offset_y);
3455 envelope16(
s,
out, plane, (plane + 1) %
s->ncomp,
s->mode ? offset_x : offset_y);
3456 envelope16(
s,
out, plane, (plane + 2) %
s->ncomp,
s->mode ? offset_x : offset_y);
3462 s->graticulef(
s,
out);
3498 .priv_class = &waveform_class,
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;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);return NULL;} return ac;} 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;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->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);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define flags(name, subs,...)
static av_always_inline void filter(int16_t *output, ptrdiff_t out_stride, const int16_t *low, ptrdiff_t low_stride, const int16_t *high, ptrdiff_t high_stride, int len, int clip)
#define AV_CEIL_RSHIFT(a, b)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
mode
Use these values in ebur128_init (or'ed).
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static int16_t mult(Float11 *f1, Float11 *f2)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint16_t mask[17]
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV422P9
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA422P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUV444P10
typedef void(RENAME(mix_any_func_type))
static const SheerTable rgb[2]
#define FF_ARRAY_ELEMS(a)
Describe the class of an AVClass context structure.
int depth
Number of bits in the component.
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
This structure describes decoded (raw) audio or video data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t nb_components
The number of components each pixel has, (1-4)
Rational number (pair of numerator and denominator).
Used for passing data between threads.
void(* blend_line)(uint8_t *dst, int size, int linesize, float o1, float o2, int v, int step)
const AVPixFmtDescriptor * odesc
void(* draw_text)(AVFrame *out, int x, int y, int mult, float o1, float o2, const char *txt, const uint8_t color[4])
const AVPixFmtDescriptor * desc
int(* waveform_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
uint8_t grat_yuva_color[4]
void(* graticulef)(struct WaveformContext *s, AVFrame *out)
#define av_malloc_array(a, b)
static enum AVPixelFormat in_pix_fmts[]
static enum AVPixelFormat out_pix_fmts[]
static const uint8_t offset[127][2]
static void mirror(const float *modifier, float *vec)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
const uint8_t avpriv_cga_font[2048]
CGA/EGA/VGA ROM font data.