111 int shift_w[4], shift_h[4];
119 int jobnr,
int nb_jobs);
124 float o1,
float o2,
const char *txt,
130 #define OFFSET(x) offsetof(WaveformContext, x) 131 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM 320 int depth, depth2,
rgb,
i, ret,
ncomp, ncomp2;
353 if (ncomp != ncomp2 || depth != depth2)
370 else if (rgb && depth == 8 && ncomp > 2)
372 else if (rgb && depth == 9 && ncomp > 2)
374 else if (rgb && depth == 10 && ncomp > 2)
376 else if (rgb && depth == 12 && ncomp > 2)
378 else if (depth == 8 && ncomp > 2)
380 else if (depth == 9 && ncomp > 2)
382 else if (depth == 10 && ncomp > 2)
384 else if (depth == 12 && ncomp > 2)
398 const int limit = s->
max - 1;
407 for (x = offset; x < offset + dst_w; x++) {
408 for (y = start; y <
end; y++) {
409 dst = (uint16_t *)out->
data[component] + y * dst_linesize + x;
415 for (y = end - 1; y >= start; y--) {
416 dst = (uint16_t *)out->
data[component] + y * dst_linesize + x;
424 for (y = offset; y < offset + dst_h; y++) {
425 dst = (uint16_t *)out->
data[component] + y * dst_linesize;
426 for (x = start; x <
end; x++) {
432 for (x = end - 1; x >= start; x--) {
454 for (x = offset; x < offset + dst_w; x++) {
455 for (y = start; y <
end; y++) {
462 for (y = end - 1; y >= start; y--) {
471 for (y = offset; y < offset + dst_h; y++) {
473 for (x = start; x <
end; x++) {
479 for (x = end - 1; x >= start; x--) {
493 const int limit = s->
max - 1;
504 for (x = offset; x < offset + dst_w; x++) {
505 for (y = start; y < end && y < emin[x -
offset]; y++) {
506 dst = (uint16_t *)out->
data[component] + y * dst_linesize + x;
512 for (y = end - 1; y >= start && y >= emax[x -
offset]; y--) {
513 dst = (uint16_t *)out->
data[component] + y * dst_linesize + x;
524 for (x = offset; x < offset + dst_w; x++) {
525 dst = (uint16_t *)out->
data[component] + emin[x - offset] * dst_linesize + x;
531 for (y = offset; y < offset + dst_h; y++) {
532 dst = (uint16_t *)out->
data[component] + y * dst_linesize;
533 for (x = start; x < end && x < emin[y -
offset]; x++) {
539 for (x = end - 1; x >= start && x >= emax[y -
offset]; x--) {
550 for (y = offset; y < offset + dst_h; y++) {
551 dst = (uint16_t *)out->
data[component] + y * dst_linesize + emin[y - offset];
573 for (x = offset; x < offset + dst_w; x++) {
574 for (y = start; y < end && y < emin[x -
offset]; y++) {
581 for (y = end - 1; y >= start && y >= emax[x -
offset]; y--) {
593 for (x = offset; x < offset + dst_w; x++) {
600 for (y = offset; y < offset + dst_h; y++) {
602 for (x = start; x < end && x < emin[y -
offset]; x++) {
608 for (x = end - 1; x >= start && x >= emax[y -
offset]; x--) {
619 for (y = offset; y < offset + dst_h; y++) {
668 if (*target - intensity > 0)
676 if (*target - intensity > 0)
687 int jobnr,
int nb_jobs)
695 const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
696 const int limit = s->
max - 1;
700 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
701 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
702 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
703 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
705 const uint16_t *src_data = (
const uint16_t *)in->
data[plane] + sliceh_start * src_linesize;
706 uint16_t *dst_data = (uint16_t *)out->
data[dplane] + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
707 uint16_t *
const dst_bottom_line = dst_data + dst_linesize * (s->
size - 1);
708 uint16_t *
const dst_line = (mirror ? dst_bottom_line : dst_data);
712 if (!column && mirror)
715 for (y = sliceh_start; y < sliceh_end; y++) {
716 const uint16_t *src_data_end = src_data + slicew_end;
717 uint16_t *
dst = dst_line + slicew_start *
step;
719 for (p = src_data + slicew_start; p < src_data_end; p++) {
721 int i = 0, v =
FFMIN(*p, limit);
725 target = dst++ + dst_signed_linesize * v;
726 update16(target, max, intensity, limit);
727 }
while (++i < step);
729 uint16_t *row = dst_data;
732 target = row - v - 1;
735 update16(target, max, intensity, limit);
737 }
while (++i < step);
741 dst_data += dst_linesize *
step;
747 const int t0 = s->
tint[0];
748 const int t1 = s->
tint[1];
749 uint16_t *dst0, *dst1;
753 src = (
const uint16_t *)(out->
data[0]) + offset_y * dst_linesize +
offset_x;
754 dst0 = (uint16_t *)(out->
data[1]) + offset_y * dst_linesize +
offset_x;
755 dst1 = (uint16_t *)(out->
data[2]) + offset_y * dst_linesize +
offset_x;
756 for (y = 0; y < s->
max; y++) {
757 for (x = slicew_start * step; x < slicew_end *
step; x++) {
771 const int t0 = s->
tint[0];
772 const int t1 = s->
tint[1];
773 uint16_t *dst0, *dst1;
777 src = (
const uint16_t *)out->
data[0] + (offset_y + sliceh_start * step) * dst_linesize +
offset_x;
778 dst0 = (uint16_t *)(out->
data[1]) + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
779 dst1 = (uint16_t *)(out->
data[2]) + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
780 for (y = sliceh_start * step; y < sliceh_end *
step; y++) {
781 for (x = 0; x < s->
max; x++) {
795 #define LOWPASS16_FUNC(name, column, mirror) \ 796 static int lowpass16_##name(AVFilterContext *ctx, \ 797 void *arg, int jobnr, \ 800 WaveformContext *s = ctx->priv; \ 801 ThreadData *td = arg; \ 802 AVFrame *in = td->in; \ 803 AVFrame *out = td->out; \ 804 int component = td->component; \ 805 int offset_y = td->offset_y; \ 806 int offset_x = td->offset_x; \ 808 lowpass16(s, in, out, component, s->intensity, \ 809 offset_y, offset_x, column, mirror, \ 825 int jobnr,
int nb_jobs)
828 const int dplane = (s->rgb || s->display ==
OVERLAY) ? plane : 0;
833 const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
837 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
838 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
839 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
840 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
843 uint8_t *dst_data = out->data[dplane] + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
844 uint8_t *
const dst_bottom_line = dst_data + dst_linesize * (s->size - 1);
845 uint8_t *
const dst_line = (mirror ? dst_bottom_line : dst_data);
849 if (!column && mirror)
852 for (y = sliceh_start; y < sliceh_end; y++) {
853 const uint8_t *src_data_end = src_data + slicew_end;
856 for (p = src_data + slicew_start; p < src_data_end; p++) {
862 target = dst++ + dst_signed_linesize * *
p;
863 update(target, max, intensity);
864 }
while (++i < step);
869 target = row - *p - 1;
872 update(target, max, intensity);
874 }
while (++i < step);
878 dst_data += dst_linesize *
step;
881 if (s->display !=
OVERLAY && column && !s->rgb) {
882 const int bg = s->bg_color[0];
883 const int dst_h = 256;
884 const int t0 = s->tint[0];
885 const int t1 = s->tint[1];
890 src = out->data[0] + offset_y * dst_linesize +
offset_x;
891 dst0 = out->data[1] + offset_y * dst_linesize +
offset_x;
892 dst1 = out->data[2] + offset_y * dst_linesize +
offset_x;
893 for (y = 0; y < dst_h; y++) {
894 for (x = slicew_start * step; x < slicew_end *
step; x++) {
905 }
else if (s->display !=
OVERLAY && !s->rgb) {
906 const int bg = s->bg_color[0];
907 const int dst_w = 256;
908 const int t0 = s->tint[0];
909 const int t1 = s->tint[1];
914 src = out->data[0] + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
915 dst0 = out->data[1] + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
916 dst1 = out->data[2] + (offset_y + sliceh_start *
step) * dst_linesize + offset_x;
917 for (y = sliceh_start * step; y < sliceh_end *
step; y++) {
918 for (x = 0; x < dst_w; x++) {
932 #define LOWPASS_FUNC(name, column, mirror) \ 933 static int lowpass_##name(AVFilterContext *ctx, \ 934 void *arg, int jobnr, \ 937 WaveformContext *s = ctx->priv; \ 938 ThreadData *td = arg; \ 939 AVFrame *in = td->in; \ 940 AVFrame *out = td->out; \ 941 int component = td->component; \ 942 int offset_y = td->offset_y; \ 943 int offset_x = td->offset_x; \ 945 lowpass(s, in, out, component, s->intensity, \ 946 offset_y, offset_x, column, mirror, \ 962 int jobnr,
int nb_jobs)
965 const int c0_linesize = in->linesize[ plane + 0 ] / 2;
966 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2;
967 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2;
968 const int c0_shift_w = s->shift_w[ component + 0 ];
969 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
970 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
971 const int c0_shift_h = s->shift_h[ component + 0 ];
972 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
973 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
974 const int d0_linesize = out->linesize[ plane + 0 ] / 2;
975 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2;
976 const int limit = s->max - 1;
977 const int max = limit - intensity;
978 const int mid = s->max / 2;
979 const int src_h = in->
height;
980 const int src_w = in->width;
981 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
982 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
983 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
984 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
988 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
989 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
991 for (x = slicew_start; x < slicew_end; x++) {
992 const uint16_t *c0_data = (uint16_t *)in->data[plane + 0];
993 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 1) % s->ncomp];
994 const uint16_t *c2_data = (uint16_t *)in->data[(plane + 2) % s->ncomp];
995 uint16_t *d0_data = (uint16_t *)(out->data[
plane]) + offset_y * d0_linesize + offset_x;
996 uint16_t *d1_data = (uint16_t *)(out->data[(plane + 1) % s->ncomp]) + offset_y * d1_linesize + offset_x;
997 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
998 uint16_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
999 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
1000 uint16_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
1002 for (y = 0; y < src_h; y++) {
1003 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit) + s->max;
1004 const int c1 =
FFMIN(
FFABS(c1_data[x >> c1_shift_w] - mid) +
FFABS(c2_data[x >> c2_shift_w] - mid), limit);
1007 target = d0 + x + d0_signed_linesize * c0;
1009 target = d1 + x + d1_signed_linesize * (c0 -
c1);
1011 target = d1 + x + d1_signed_linesize * (c0 +
c1);
1014 if (!c0_shift_h || (y & c0_shift_h))
1015 c0_data += c0_linesize;
1016 if (!c1_shift_h || (y & c1_shift_h))
1017 c1_data += c1_linesize;
1018 if (!c2_shift_h || (y & c2_shift_h))
1019 c2_data += c2_linesize;
1020 d0_data += d0_linesize;
1021 d1_data += d1_linesize;
1025 const uint16_t *c0_data = (uint16_t *)(in->data[plane]) + (sliceh_start >> c0_shift_h) * c0_linesize;
1026 const uint16_t *c1_data = (uint16_t *)(in->data[(plane + 1) % s->ncomp]) + (sliceh_start >> c1_shift_h) * c1_linesize;
1027 const uint16_t *c2_data = (uint16_t *)(in->data[(plane + 2) % s->ncomp]) + (sliceh_start >> c2_shift_h) * c2_linesize;
1028 uint16_t *d0_data = (uint16_t *)(out->data[plane]) + (offset_y + sliceh_start) * d0_linesize + offset_x;
1029 uint16_t *d1_data = (uint16_t *)(out->data[(plane + 1) % s->ncomp]) + (offset_y + sliceh_start) * d1_linesize +
offset_x;
1032 d0_data += s->size - 1;
1033 d1_data += s->size - 1;
1036 for (y = sliceh_start; y < sliceh_end; y++) {
1037 for (x = 0; x < src_w; x++) {
1038 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit) + s->max;
1039 const int c1 =
FFMIN(
FFABS(c1_data[x >> c1_shift_w] - mid) +
FFABS(c2_data[x >> c2_shift_w] - mid), limit);
1043 target = d0_data - c0;
1045 target = d1_data - (c0 -
c1);
1047 target = d1_data - (c0 +
c1);
1050 target = d0_data + c0;
1052 target = d1_data + (c0 -
c1);
1054 target = d1_data + (c0 +
c1);
1059 if (!c0_shift_h || (y & c0_shift_h))
1060 c0_data += c0_linesize;
1061 if (!c1_shift_h || (y & c1_shift_h))
1062 c1_data += c1_linesize;
1063 if (!c2_shift_h || (y & c2_shift_h))
1064 c2_data += c2_linesize;
1065 d0_data += d0_linesize;
1066 d1_data += d1_linesize;
1071 #define FLAT16_FUNC(name, column, mirror) \ 1072 static int flat16_##name(AVFilterContext *ctx, \ 1073 void *arg, int jobnr, \ 1076 WaveformContext *s = ctx->priv; \ 1077 ThreadData *td = arg; \ 1078 AVFrame *in = td->in; \ 1079 AVFrame *out = td->out; \ 1080 int component = td->component; \ 1081 int offset_y = td->offset_y; \ 1082 int offset_x = td->offset_x; \ 1084 flat16(s, in, out, component, s->intensity, \ 1085 offset_y, offset_x, column, mirror, \ 1101 int jobnr,
int nb_jobs)
1104 const int c0_linesize = in->linesize[ plane + 0 ];
1105 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
1106 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
1107 const int c0_shift_w = s->shift_w[ component + 0 ];
1108 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
1109 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
1110 const int c0_shift_h = s->shift_h[ component + 0 ];
1111 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
1112 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
1113 const int d0_linesize = out->linesize[ plane + 0 ];
1114 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
1115 const int max = 255 - intensity;
1116 const int src_h = in->
height;
1117 const int src_w = in->width;
1118 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
1119 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
1120 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
1121 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
1125 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
1126 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
1128 for (x = slicew_start; x < slicew_end; x++) {
1129 const uint8_t *c0_data = in->data[plane + 0];
1130 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
1131 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
1133 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x;
1134 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
1135 uint8_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
1136 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
1137 uint8_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
1139 for (y = 0; y < src_h; y++) {
1140 const int c0 = c0_data[x >> c0_shift_w] + 256;
1141 const int c1 =
FFABS(c1_data[x >> c1_shift_w] - 128) +
FFABS(c2_data[x >> c2_shift_w] - 128);
1144 target = d0 + x + d0_signed_linesize * c0;
1146 target = d1 + x + d1_signed_linesize * (c0 -
c1);
1148 target = d1 + x + d1_signed_linesize * (c0 +
c1);
1151 if (!c0_shift_h || (y & c0_shift_h))
1152 c0_data += c0_linesize;
1153 if (!c1_shift_h || (y & c1_shift_h))
1154 c1_data += c1_linesize;
1155 if (!c2_shift_h || (y & c2_shift_h))
1156 c2_data += c2_linesize;
1157 d0_data += d0_linesize;
1158 d1_data += d1_linesize;
1162 const uint8_t *c0_data = in->data[
plane] + (sliceh_start >> c0_shift_h) * c0_linesize;
1163 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1164 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1165 uint8_t *d0_data = out->data[
plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
1166 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize +
offset_x;
1169 d0_data += s->size - 1;
1170 d1_data += s->size - 1;
1173 for (y = sliceh_start; y < sliceh_end; y++) {
1174 for (x = 0; x < src_w; x++) {
1175 const int c0 = c0_data[x >> c0_shift_w] + 256;
1176 const int c1 =
FFABS(c1_data[x >> c1_shift_w] - 128) +
FFABS(c2_data[x >> c2_shift_w] - 128);
1180 target = d0_data - c0;
1182 target = d1_data - (c0 -
c1);
1184 target = d1_data - (c0 +
c1);
1187 target = d0_data + c0;
1189 target = d1_data + (c0 -
c1);
1191 target = d1_data + (c0 +
c1);
1196 if (!c0_shift_h || (y & c0_shift_h))
1197 c0_data += c0_linesize;
1198 if (!c1_shift_h || (y & c1_shift_h))
1199 c1_data += c1_linesize;
1200 if (!c2_shift_h || (y & c2_shift_h))
1201 c2_data += c2_linesize;
1202 d0_data += d0_linesize;
1203 d1_data += d1_linesize;
1208 #define FLAT_FUNC(name, column, mirror) \ 1209 static int flat_##name(AVFilterContext *ctx, \ 1210 void *arg, int jobnr, \ 1213 WaveformContext *s = ctx->priv; \ 1214 ThreadData *td = arg; \ 1215 AVFrame *in = td->in; \ 1216 AVFrame *out = td->out; \ 1217 int component = td->component; \ 1218 int offset_y = td->offset_y; \ 1219 int offset_x = td->offset_x; \ 1221 flat(s, in, out, component, s->intensity, \ 1222 offset_y, offset_x, column, mirror, \ 1233 #define AFLAT16(name, update_cb, update_cr, column, mirror) \ 1234 static int name(AVFilterContext *ctx, \ 1235 void *arg, int jobnr, \ 1238 WaveformContext *s = ctx->priv; \ 1239 ThreadData *td = arg; \ 1240 AVFrame *in = td->in; \ 1241 AVFrame *out = td->out; \ 1242 int component = td->component; \ 1243 int offset_y = td->offset_y; \ 1244 int offset_x = td->offset_x; \ 1245 const int intensity = s->intensity; \ 1246 const int plane = s->desc->comp[component].plane; \ 1247 const int c0_linesize = in->linesize[ plane + 0 ] / 2; \ 1248 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2; \ 1249 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2; \ 1250 const int c0_shift_w = s->shift_w[ component + 0 ]; \ 1251 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp]; \ 1252 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp]; \ 1253 const int c0_shift_h = s->shift_h[ component + 0 ]; \ 1254 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp]; \ 1255 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp]; \ 1256 const int d0_linesize = out->linesize[ plane + 0 ] / 2; \ 1257 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2; \ 1258 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp] / 2; \ 1259 const int limit = s->max - 1; \ 1260 const int max = limit - intensity; \ 1261 const int mid = s->max / 2; \ 1262 const int src_h = in->height; \ 1263 const int src_w = in->width; \ 1264 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0; \ 1265 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h; \ 1266 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0; \ 1267 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w; \ 1271 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1); \ 1272 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1); \ 1273 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1); \ 1275 for (x = slicew_start; x < slicew_end; x++) { \ 1276 const uint16_t *c0_data = (uint16_t *)in->data[plane + 0]; \ 1277 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 1) % s->ncomp]; \ 1278 const uint16_t *c2_data = (uint16_t *)in->data[(plane + 2) % s->ncomp]; \ 1279 uint16_t *d0_data = (uint16_t *)out->data[plane] + offset_y * d0_linesize + offset_x; \ 1280 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x; \ 1281 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x; \ 1282 uint16_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1); \ 1283 uint16_t * const d0 = (mirror ? d0_bottom_line : d0_data); \ 1284 uint16_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1); \ 1285 uint16_t * const d1 = (mirror ? d1_bottom_line : d1_data); \ 1286 uint16_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1); \ 1287 uint16_t * const d2 = (mirror ? d2_bottom_line : d2_data); \ 1289 for (y = 0; y < src_h; y++) { \ 1290 const int c0 = FFMIN(c0_data[x >> c0_shift_w], limit) + mid; \ 1291 const int c1 = FFMIN(c1_data[x >> c1_shift_w], limit) - mid; \ 1292 const int c2 = FFMIN(c2_data[x >> c2_shift_w], limit) - mid; \ 1295 target = d0 + x + d0_signed_linesize * c0; \ 1296 update16(target, max, intensity, limit); \ 1298 target = d1 + x + d1_signed_linesize * (c0 + c1); \ 1299 update_cb(target, max, intensity, limit); \ 1301 target = d2 + x + d2_signed_linesize * (c0 + c2); \ 1302 update_cr(target, max, intensity, limit); \ 1304 if (!c0_shift_h || (y & c0_shift_h)) \ 1305 c0_data += c0_linesize; \ 1306 if (!c1_shift_h || (y & c1_shift_h)) \ 1307 c1_data += c1_linesize; \ 1308 if (!c2_shift_h || (y & c2_shift_h)) \ 1309 c2_data += c2_linesize; \ 1310 d0_data += d0_linesize; \ 1311 d1_data += d1_linesize; \ 1312 d2_data += d2_linesize; \ 1316 const uint16_t *c0_data = (uint16_t *)in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize; \ 1317 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize; \ 1318 const uint16_t *c2_data = (uint16_t *)in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize; \ 1319 uint16_t *d0_data = (uint16_t *)out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x; \ 1320 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x; \ 1321 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x; \ 1324 d0_data += s->size - 1; \ 1325 d1_data += s->size - 1; \ 1326 d2_data += s->size - 1; \ 1329 for (y = sliceh_start; y < sliceh_end; y++) { \ 1330 for (x = 0; x < src_w; x++) { \ 1331 const int c0 = FFMIN(c0_data[x >> c0_shift_w], limit) + mid; \ 1332 const int c1 = FFMIN(c1_data[x >> c1_shift_w], limit) - mid; \ 1333 const int c2 = FFMIN(c2_data[x >> c2_shift_w], limit) - mid; \ 1337 target = d0_data - c0; \ 1338 update16(target, max, intensity, limit); \ 1339 target = d1_data - (c0 + c1); \ 1340 update_cb(target, max, intensity, limit); \ 1341 target = d2_data - (c0 + c2); \ 1342 update_cr(target, max, intensity, limit); \ 1344 target = d0_data + c0; \ 1345 update16(target, max, intensity, limit); \ 1346 target = d1_data + (c0 + c1); \ 1347 update_cb(target, max, intensity, limit); \ 1348 target = d2_data + (c0 + c2); \ 1349 update_cr(target, max, intensity, limit); \ 1353 if (!c0_shift_h || (y & c0_shift_h)) \ 1354 c0_data += c0_linesize; \ 1355 if (!c1_shift_h || (y & c1_shift_h)) \ 1356 c1_data += c1_linesize; \ 1357 if (!c2_shift_h || (y & c2_shift_h)) \ 1358 c2_data += c2_linesize; \ 1359 d0_data += d0_linesize; \ 1360 d1_data += d1_linesize; \ 1361 d2_data += d2_linesize; \ 1367 #define AFLAT(name, update_cb, update_cr, column, mirror) \ 1368 static int name(AVFilterContext *ctx, \ 1369 void *arg, int jobnr, \ 1372 WaveformContext *s = ctx->priv; \ 1373 ThreadData *td = arg; \ 1374 AVFrame *in = td->in; \ 1375 AVFrame *out = td->out; \ 1376 int component = td->component; \ 1377 int offset_y = td->offset_y; \ 1378 int offset_x = td->offset_x; \ 1379 const int src_h = in->height; \ 1380 const int src_w = in->width; \ 1381 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0; \ 1382 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h; \ 1383 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0; \ 1384 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w; \ 1385 const int intensity = s->intensity; \ 1386 const int plane = s->desc->comp[component].plane; \ 1387 const int c0_linesize = in->linesize[ plane + 0 ]; \ 1388 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp]; \ 1389 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp]; \ 1390 const int c0_shift_w = s->shift_w[ component + 0 ]; \ 1391 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp]; \ 1392 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp]; \ 1393 const int c0_shift_h = s->shift_h[ component + 0 ]; \ 1394 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp]; \ 1395 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp]; \ 1396 const int d0_linesize = out->linesize[ plane + 0 ]; \ 1397 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp]; \ 1398 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp]; \ 1399 const int max = 255 - intensity; \ 1403 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1); \ 1404 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1); \ 1405 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1); \ 1407 for (x = slicew_start; x < slicew_end; x++) { \ 1408 const uint8_t *c0_data = in->data[plane + 0]; \ 1409 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp]; \ 1410 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp]; \ 1411 uint8_t *d0_data = out->data[plane] + offset_y * d0_linesize + offset_x; \ 1412 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x; \ 1413 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x; \ 1414 uint8_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1); \ 1415 uint8_t * const d0 = (mirror ? d0_bottom_line : d0_data); \ 1416 uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1); \ 1417 uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data); \ 1418 uint8_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1); \ 1419 uint8_t * const d2 = (mirror ? d2_bottom_line : d2_data); \ 1421 for (y = 0; y < src_h; y++) { \ 1422 const int c0 = c0_data[x >> c0_shift_w] + 128; \ 1423 const int c1 = c1_data[x >> c1_shift_w] - 128; \ 1424 const int c2 = c2_data[x >> c2_shift_w] - 128; \ 1427 target = d0 + x + d0_signed_linesize * c0; \ 1428 update(target, max, intensity); \ 1430 target = d1 + x + d1_signed_linesize * (c0 + c1); \ 1431 update_cb(target, max, intensity); \ 1433 target = d2 + x + d2_signed_linesize * (c0 + c2); \ 1434 update_cr(target, max, intensity); \ 1436 if (!c0_shift_h || (y & c0_shift_h)) \ 1437 c0_data += c0_linesize; \ 1438 if (!c1_shift_h || (y & c1_shift_h)) \ 1439 c1_data += c1_linesize; \ 1440 if (!c2_shift_h || (y & c2_shift_h)) \ 1441 c2_data += c2_linesize; \ 1442 d0_data += d0_linesize; \ 1443 d1_data += d1_linesize; \ 1444 d2_data += d2_linesize; \ 1448 const uint8_t *c0_data = in->data[plane] + (sliceh_start >> c0_shift_h) * c0_linesize; \ 1449 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize; \ 1450 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize; \ 1451 uint8_t *d0_data = out->data[plane] + (offset_y + sliceh_start) * d0_linesize + offset_x; \ 1452 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x; \ 1453 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x; \ 1456 d0_data += s->size - 1; \ 1457 d1_data += s->size - 1; \ 1458 d2_data += s->size - 1; \ 1461 for (y = sliceh_start; y < sliceh_end; y++) { \ 1462 for (x = 0; x < src_w; x++) { \ 1463 const int c0 = c0_data[x >> c0_shift_w] + 128; \ 1464 const int c1 = c1_data[x >> c1_shift_w] - 128; \ 1465 const int c2 = c2_data[x >> c2_shift_w] - 128; \ 1469 target = d0_data - c0; \ 1470 update(target, max, intensity); \ 1471 target = d1_data - (c0 + c1); \ 1472 update_cb(target, max, intensity); \ 1473 target = d2_data - (c0 + c2); \ 1474 update_cr(target, max, intensity); \ 1476 target = d0_data + c0; \ 1477 update(target, max, intensity); \ 1478 target = d1_data + (c0 + c1); \ 1479 update_cb(target, max, intensity); \ 1480 target = d2_data + (c0 + c2); \ 1481 update_cr(target, max, intensity); \ 1485 if (!c0_shift_h || (y & c0_shift_h)) \ 1486 c0_data += c0_linesize; \ 1487 if (!c1_shift_h || (y & c1_shift_h)) \ 1488 c1_data += c1_linesize; \ 1489 if (!c2_shift_h || (y & c2_shift_h)) \ 1490 c2_data += c2_linesize; \ 1491 d0_data += d0_linesize; \ 1492 d1_data += d1_linesize; \ 1493 d2_data += d2_linesize; \ 1501 AFLAT16(aflat16_column, update16, update16, 1, 0)
1502 AFLAT16(aflat16_column_mirror, update16, update16, 1, 1)
1504 AFLAT16(xflat16_row_mirror, update16, update16_cr, 0, 1)
1505 AFLAT16(xflat16_column, update16, update16_cr, 1, 0)
1506 AFLAT16(xflat16_column_mirror, update16, update16_cr, 1, 1)
1507 AFLAT16(yflat16_row, update16_cr, update16_cr, 0, 0)
1508 AFLAT16(yflat16_row_mirror, update16_cr, update16_cr, 0, 1)
1509 AFLAT16(yflat16_column, update16_cr, update16_cr, 1, 0)
1510 AFLAT16(yflat16_column_mirror, update16_cr, update16_cr, 1, 1)
1513 AFLAT(aflat_row_mirror, update, update, 0, 1)
1514 AFLAT(aflat_column, update, update, 1, 0)
1515 AFLAT(aflat_column_mirror, update, update, 1, 1)
1517 AFLAT(xflat_row_mirror, update, update_cr, 0, 1)
1518 AFLAT(xflat_column, update, update_cr, 1, 0)
1519 AFLAT(xflat_column_mirror, update, update_cr, 1, 1)
1520 AFLAT(yflat_row, update_cr, update_cr, 0, 0)
1521 AFLAT(yflat_row_mirror, update_cr, update_cr, 0, 1)
1522 AFLAT(yflat_column, update_cr, update_cr, 1, 0)
1523 AFLAT(yflat_column_mirror, update_cr, update_cr, 1, 1)
1530 int jobnr,
int nb_jobs)
1533 const int c0_linesize = in->linesize[(plane + 1) % s->ncomp] / 2;
1534 const int c1_linesize = in->linesize[(plane + 2) % s->ncomp] / 2;
1536 const int limit = s->max - 1;
1538 const int mid = s->max / 2;
1539 const int c0_shift_w = s->shift_w[(component + 1) % s->ncomp];
1540 const int c1_shift_w = s->shift_w[(component + 2) % s->ncomp];
1541 const int c0_shift_h = s->shift_h[(component + 1) % s->ncomp];
1542 const int c1_shift_h = s->shift_h[(component + 2) % s->ncomp];
1543 const int src_h = in->height;
1544 const int src_w = in->width;
1545 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
1546 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
1547 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
1548 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
1552 const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
1554 for (x = slicew_start; x < slicew_end; x++) {
1555 const uint16_t *c0_data = (uint16_t *)in->data[(plane + 1) % s->ncomp];
1556 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 2) % s->ncomp];
1557 uint16_t *dst_data = (uint16_t *)out->data[plane] + offset_y * dst_linesize + offset_x;
1558 uint16_t *
const dst_bottom_line = dst_data + dst_linesize * (s->size - 1);
1559 uint16_t *
const dst_line = (mirror ? dst_bottom_line : dst_data);
1560 uint16_t *
dst = dst_line;
1562 for (y = 0; y < src_h; y++) {
1563 const int sum =
FFMIN(
FFABS(c0_data[x >> c0_shift_w] - mid) +
FFABS(c1_data[x >> c1_shift_w] - mid - 1), limit);
1566 target = dst + x + dst_signed_linesize * sum;
1567 update16(target, max, intensity, limit);
1569 if (!c0_shift_h || (y & c0_shift_h))
1570 c0_data += c0_linesize;
1571 if (!c1_shift_h || (y & c1_shift_h))
1572 c1_data += c1_linesize;
1577 const uint16_t *c0_data = (uint16_t *)in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c0_shift_h) * c0_linesize;
1578 const uint16_t *c1_data = (uint16_t *)in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1579 uint16_t *dst_data = (uint16_t *)out->data[plane] + (offset_y + sliceh_start) * dst_linesize +
offset_x;
1582 dst_data += s->size - 1;
1583 for (y = sliceh_start; y < sliceh_end; y++) {
1584 for (x = 0; x < src_w; x++) {
1585 const int sum =
FFMIN(
FFABS(c0_data[x >> c0_shift_w] - mid) +
FFABS(c1_data[x >> c1_shift_w] - mid - 1), limit);
1589 target = dst_data - sum;
1590 update16(target, max, intensity, limit);
1592 target = dst_data + sum;
1593 update16(target, max, intensity, limit);
1597 if (!c0_shift_h || (y & c0_shift_h))
1598 c0_data += c0_linesize;
1599 if (!c1_shift_h || (y & c1_shift_h))
1600 c1_data += c1_linesize;
1606 #define CHROMA16_FUNC(name, column, mirror) \ 1607 static int chroma16_##name(AVFilterContext *ctx, \ 1608 void *arg, int jobnr, \ 1611 WaveformContext *s = ctx->priv; \ 1612 ThreadData *td = arg; \ 1613 AVFrame *in = td->in; \ 1614 AVFrame *out = td->out; \ 1615 int component = td->component; \ 1616 int offset_y = td->offset_y; \ 1617 int offset_x = td->offset_x; \ 1619 chroma16(s, in, out, component, s->intensity,\ 1620 offset_y, offset_x, column, mirror, \ 1636 int jobnr,
int nb_jobs)
1639 const int src_h = in->height;
1640 const int src_w = in->width;
1641 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
1642 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
1643 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
1644 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
1645 const int c0_linesize = in->linesize[(plane + 1) % s->ncomp];
1646 const int c1_linesize = in->linesize[(plane + 2) % s->ncomp];
1649 const int c0_shift_w = s->shift_w[(component + 1) % s->ncomp];
1650 const int c1_shift_w = s->shift_w[(component + 2) % s->ncomp];
1651 const int c0_shift_h = s->shift_h[(component + 1) % s->ncomp];
1652 const int c1_shift_h = s->shift_h[(component + 2) % s->ncomp];
1656 const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
1658 for (x = slicew_start; x < slicew_end; x++) {
1659 const uint8_t *c0_data = in->data[(plane + 1) % s->ncomp];
1660 const uint8_t *c1_data = in->data[(plane + 2) % s->ncomp];
1662 uint8_t *
const dst_bottom_line = dst_data + dst_linesize * (s->size - 1);
1663 uint8_t *
const dst_line = (mirror ? dst_bottom_line : dst_data);
1666 for (y = 0; y < src_h; y++) {
1667 const int sum =
FFABS(c0_data[x >> c0_shift_w] - 128) +
FFABS(c1_data[x >> c1_shift_w] - 127);
1670 target = dst + x + dst_signed_linesize * sum;
1671 update(target, max, intensity);
1673 if (!c0_shift_h || (y & c0_shift_h))
1674 c0_data += c0_linesize;
1675 if (!c1_shift_h || (y & c1_shift_h))
1676 c1_data += c1_linesize;
1681 const uint8_t *c0_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c0_shift_h) * c0_linesize;
1682 const uint8_t *c1_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1683 uint8_t *dst_data = out->data[
plane] + (offset_y + sliceh_start) * dst_linesize + offset_x;
1686 dst_data += s->size - 1;
1687 for (y = sliceh_start; y < sliceh_end; y++) {
1688 for (x = 0; x < src_w; x++) {
1689 const int sum =
FFABS(c0_data[x >> c0_shift_w] - 128) +
FFABS(c1_data[x >> c1_shift_w] - 127);
1693 target = dst_data - sum;
1694 update(target, max, intensity);
1696 target = dst_data + sum;
1697 update(target, max, intensity);
1701 if (!c0_shift_h || (y & c0_shift_h))
1702 c0_data += c0_linesize;
1703 if (!c1_shift_h || (y & c1_shift_h))
1704 c1_data += c1_linesize;
1710 #define CHROMA_FUNC(name, column, mirror) \ 1711 static int chroma_##name(AVFilterContext *ctx, \ 1712 void *arg, int jobnr, \ 1715 WaveformContext *s = ctx->priv; \ 1716 ThreadData *td = arg; \ 1717 AVFrame *in = td->in; \ 1718 AVFrame *out = td->out; \ 1719 int component = td->component; \ 1720 int offset_y = td->offset_y; \ 1721 int offset_x = td->offset_x; \ 1723 chroma(s, in, out, component, s->intensity, \ 1724 offset_y, offset_x, column, mirror, \ 1740 int jobnr,
int nb_jobs)
1743 const int limit = s->max - 1;
1744 const int src_h = in->height;
1745 const int src_w = in->width;
1746 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
1747 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
1748 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
1749 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
1750 const int c0_linesize = in->linesize[ plane + 0 ] / 2;
1751 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2;
1752 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2;
1753 const int c0_shift_h = s->shift_h[ component + 0 ];
1754 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
1755 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
1756 const uint16_t *c0_data = (
const uint16_t *)in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
1757 const uint16_t *c1_data = (
const uint16_t *)in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1758 const uint16_t *c2_data = (
const uint16_t *)in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1759 const int d0_linesize = out->linesize[ plane + 0 ] / 2;
1760 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2;
1761 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp] / 2;
1762 const int c0_shift_w = s->shift_w[ component + 0 ];
1763 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
1764 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
1768 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
1769 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
1770 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
1771 uint16_t *d0_data = (uint16_t *)out->data[plane] + offset_y * d0_linesize + offset_x;
1772 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x;
1773 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x;
1774 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
1775 uint16_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
1776 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
1777 uint16_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
1778 uint16_t *
const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
1779 uint16_t *
const d2 = (mirror ? d2_bottom_line : d2_data);
1781 for (y = 0; y < src_h; y++) {
1782 for (x = slicew_start; x < slicew_end; x++) {
1783 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
1784 const int c1 = c1_data[x >> c1_shift_w];
1785 const int c2 = c2_data[x >> c2_shift_w];
1787 *(d0 + d0_signed_linesize * c0 + x) = c0;
1788 *(d1 + d1_signed_linesize * c0 + x) = c1;
1789 *(d2 + d2_signed_linesize * c0 + x) = c2;
1792 if (!c0_shift_h || (y & c0_shift_h))
1793 c0_data += c0_linesize;
1794 if (!c1_shift_h || (y & c1_shift_h))
1795 c1_data += c1_linesize;
1796 if (!c2_shift_h || (y & c2_shift_h))
1797 c2_data += c2_linesize;
1798 d0_data += d0_linesize;
1799 d1_data += d1_linesize;
1800 d2_data += d2_linesize;
1803 uint16_t *d0_data = (uint16_t *)out->data[plane] + (offset_y + sliceh_start) * d0_linesize +
offset_x;
1804 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
1805 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
1808 d0_data += s->size - 1;
1809 d1_data += s->size - 1;
1810 d2_data += s->size - 1;
1813 for (y = sliceh_start; y < sliceh_end; y++) {
1814 for (x = 0; x < src_w; x++) {
1815 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
1816 const int c1 = c1_data[x >> c1_shift_w];
1817 const int c2 = c2_data[x >> c2_shift_w];
1820 *(d0_data - c0) = c0;
1821 *(d1_data - c0) = c1;
1822 *(d2_data - c0) = c2;
1824 *(d0_data + c0) = c0;
1825 *(d1_data + c0) = c1;
1826 *(d2_data + c0) = c2;
1830 if (!c0_shift_h || (y & c0_shift_h))
1831 c0_data += c0_linesize;
1832 if (!c1_shift_h || (y & c1_shift_h))
1833 c1_data += c1_linesize;
1834 if (!c2_shift_h || (y & c2_shift_h))
1835 c2_data += c2_linesize;
1836 d0_data += d0_linesize;
1837 d1_data += d1_linesize;
1838 d2_data += d2_linesize;
1843 #define COLOR16_FUNC(name, column, mirror) \ 1844 static int color16_##name(AVFilterContext *ctx, \ 1845 void *arg, int jobnr, \ 1848 WaveformContext *s = ctx->priv; \ 1849 ThreadData *td = arg; \ 1850 AVFrame *in = td->in; \ 1851 AVFrame *out = td->out; \ 1852 int component = td->component; \ 1853 int offset_y = td->offset_y; \ 1854 int offset_x = td->offset_x; \ 1856 color16(s, in, out, component, s->intensity, \ 1857 offset_y, offset_x, column, mirror, \ 1873 int jobnr,
int nb_jobs)
1876 const int src_h = in->height;
1877 const int src_w = in->width;
1878 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
1879 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
1880 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
1881 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
1882 const int c0_linesize = in->linesize[ plane + 0 ];
1883 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
1884 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
1885 const int c0_shift_h = s->shift_h[ component + 0 ];
1886 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
1887 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
1888 const uint8_t *c0_data = in->data[
plane] + (sliceh_start >> c0_shift_h) * c0_linesize;
1889 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
1890 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
1891 const int d0_linesize = out->linesize[ plane + 0 ];
1892 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
1893 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp];
1894 const int c0_shift_w = s->shift_w[ component + 0 ];
1895 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
1896 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
1900 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
1901 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
1902 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
1904 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x;
1905 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize +
offset_x;
1906 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
1907 uint8_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
1908 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
1909 uint8_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
1910 uint8_t *
const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
1911 uint8_t *
const d2 = (mirror ? d2_bottom_line : d2_data);
1913 for (y = 0; y < src_h; y++) {
1914 for (x = slicew_start; x < slicew_end; x++) {
1915 const int c0 = c0_data[x >> c0_shift_w];
1916 const int c1 = c1_data[x >> c1_shift_w];
1917 const int c2 = c2_data[x >> c2_shift_w];
1919 *(d0 + d0_signed_linesize * c0 + x) = c0;
1920 *(d1 + d1_signed_linesize * c0 + x) = c1;
1921 *(d2 + d2_signed_linesize * c0 + x) = c2;
1924 if (!c0_shift_h || (y & c0_shift_h))
1925 c0_data += c0_linesize;
1926 if (!c1_shift_h || (y & c1_shift_h))
1927 c1_data += c1_linesize;
1928 if (!c2_shift_h || (y & c2_shift_h))
1929 c2_data += c2_linesize;
1930 d0_data += d0_linesize;
1931 d1_data += d1_linesize;
1932 d2_data += d2_linesize;
1935 uint8_t *d0_data = out->data[
plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
1936 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize +
offset_x;
1937 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize +
offset_x;
1940 d0_data += s->size - 1;
1941 d1_data += s->size - 1;
1942 d2_data += s->size - 1;
1945 for (y = sliceh_start; y < sliceh_end; y++) {
1946 for (x = 0; x < src_w; x++) {
1947 const int c0 = c0_data[x >> c0_shift_w];
1948 const int c1 = c1_data[x >> c1_shift_w];
1949 const int c2 = c2_data[x >> c2_shift_w];
1952 *(d0_data - c0) = c0;
1953 *(d1_data - c0) = c1;
1954 *(d2_data - c0) = c2;
1956 *(d0_data + c0) = c0;
1957 *(d1_data + c0) = c1;
1958 *(d2_data + c0) = c2;
1962 if (!c0_shift_h || (y & c0_shift_h))
1963 c0_data += c0_linesize;
1964 if (!c1_shift_h || (y & c1_shift_h))
1965 c1_data += c1_linesize;
1966 if (!c2_shift_h || (y & c2_shift_h))
1967 c2_data += c2_linesize;
1968 d0_data += d0_linesize;
1969 d1_data += d1_linesize;
1970 d2_data += d2_linesize;
1975 #define COLOR_FUNC(name, column, mirror) \ 1976 static int color_##name(AVFilterContext *ctx, \ 1977 void *arg, int jobnr, \ 1980 WaveformContext *s = ctx->priv; \ 1981 ThreadData *td = arg; \ 1982 AVFrame *in = td->in; \ 1983 AVFrame *out = td->out; \ 1984 int component = td->component; \ 1985 int offset_y = td->offset_y; \ 1986 int offset_x = td->offset_x; \ 1988 color(s, in, out, component, s->intensity, \ 1989 offset_y, offset_x, column, mirror, \ 2005 int jobnr,
int nb_jobs)
2008 const int limit = s->max - 1;
2010 const int src_h = in->height;
2011 const int src_w = in->width;
2012 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
2013 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
2014 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
2015 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
2016 const int c0_shift_h = s->shift_h[ component + 0 ];
2017 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
2018 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
2019 const int c0_linesize = in->linesize[ plane + 0 ] / 2;
2020 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2;
2021 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2;
2022 const uint16_t *c0_data = (
const uint16_t *)in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
2023 const uint16_t *c1_data = (
const uint16_t *)in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
2024 const uint16_t *c2_data = (
const uint16_t *)in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
2025 const int d0_linesize = out->linesize[ plane + 0 ] / 2;
2026 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2;
2027 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp] / 2;
2028 const int c0_shift_w = s->shift_w[ component + 0 ];
2029 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
2030 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
2034 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
2035 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
2036 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
2037 uint16_t *d0_data = (uint16_t *)out->data[plane] + offset_y * d0_linesize + offset_x;
2038 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x;
2039 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize + offset_x;
2040 uint16_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
2041 uint16_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
2042 uint16_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
2043 uint16_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
2044 uint16_t *
const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
2045 uint16_t *
const d2 = (mirror ? d2_bottom_line : d2_data);
2047 for (y = 0; y < src_h; y++) {
2048 for (x = slicew_start; x < slicew_end; x++) {
2049 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
2050 const int c1 = c1_data[x >> c1_shift_w];
2051 const int c2 = c2_data[x >> c2_shift_w];
2053 update16(d0 + d0_signed_linesize * c0 + x, max, intensity, limit);
2054 *(d1 + d1_signed_linesize * c0 + x) = c1;
2055 *(d2 + d2_signed_linesize * c0 + x) = c2;
2058 if (!c0_shift_h || (y & c0_shift_h))
2059 c0_data += c0_linesize;
2060 if (!c1_shift_h || (y & c1_shift_h))
2061 c1_data += c1_linesize;
2062 if (!c2_shift_h || (y & c2_shift_h))
2063 c2_data += c2_linesize;
2064 d0_data += d0_linesize;
2065 d1_data += d1_linesize;
2066 d2_data += d2_linesize;
2069 uint16_t *d0_data = (uint16_t *)out->data[plane] + (offset_y + sliceh_start) * d0_linesize +
offset_x;
2070 uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize + offset_x;
2071 uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize + offset_x;
2074 d0_data += s->size - 1;
2075 d1_data += s->size - 1;
2076 d2_data += s->size - 1;
2079 for (y = sliceh_start; y < sliceh_end; y++) {
2080 for (x = 0; x < src_w; x++) {
2081 const int c0 =
FFMIN(c0_data[x >> c0_shift_w], limit);
2082 const int c1 = c1_data[x >> c1_shift_w];
2083 const int c2 = c2_data[x >> c2_shift_w];
2086 update16(d0_data - c0, max, intensity, limit);
2087 *(d1_data - c0) = c1;
2088 *(d2_data - c0) = c2;
2090 update16(d0_data + c0, max, intensity, limit);
2091 *(d1_data + c0) = c1;
2092 *(d2_data + c0) = c2;
2096 if (!c0_shift_h || (y & c0_shift_h))
2097 c0_data += c0_linesize;
2098 if (!c1_shift_h || (y & c1_shift_h))
2099 c1_data += c1_linesize;
2100 if (!c2_shift_h || (y & c2_shift_h))
2101 c2_data += c2_linesize;
2102 d0_data += d0_linesize;
2103 d1_data += d1_linesize;
2104 d2_data += d2_linesize;
2109 #define ACOLOR16_FUNC(name, column, mirror) \ 2110 static int acolor16_##name(AVFilterContext *ctx, \ 2111 void *arg, int jobnr, \ 2114 WaveformContext *s = ctx->priv; \ 2115 ThreadData *td = arg; \ 2116 AVFrame *in = td->in; \ 2117 AVFrame *out = td->out; \ 2118 int component = td->component; \ 2119 int offset_y = td->offset_y; \ 2120 int offset_x = td->offset_x; \ 2122 acolor16(s, in, out, component, s->intensity,\ 2123 offset_y, offset_x, column, mirror, \ 2139 int jobnr,
int nb_jobs)
2142 const int src_h = in->height;
2143 const int src_w = in->width;
2144 const int sliceh_start = !column ? (src_h * jobnr) / nb_jobs : 0;
2145 const int sliceh_end = !column ? (src_h * (jobnr+1)) / nb_jobs : src_h;
2146 const int slicew_start = column ? (src_w * jobnr) / nb_jobs : 0;
2147 const int slicew_end = column ? (src_w * (jobnr+1)) / nb_jobs : src_w;
2148 const int c0_shift_w = s->shift_w[ component + 0 ];
2149 const int c1_shift_w = s->shift_w[(component + 1) % s->ncomp];
2150 const int c2_shift_w = s->shift_w[(component + 2) % s->ncomp];
2151 const int c0_shift_h = s->shift_h[ component + 0 ];
2152 const int c1_shift_h = s->shift_h[(component + 1) % s->ncomp];
2153 const int c2_shift_h = s->shift_h[(component + 2) % s->ncomp];
2154 const int c0_linesize = in->linesize[ plane + 0 ];
2155 const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
2156 const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
2157 const uint8_t *c0_data = in->data[plane + 0] + (sliceh_start >> c0_shift_h) * c0_linesize;
2158 const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp] + (sliceh_start >> c1_shift_h) * c1_linesize;
2159 const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp] + (sliceh_start >> c2_shift_h) * c2_linesize;
2160 const int d0_linesize = out->linesize[ plane + 0 ];
2161 const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
2162 const int d2_linesize = out->linesize[(plane + 2) % s->ncomp];
2167 const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
2168 const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
2169 const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
2171 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset_y * d1_linesize + offset_x;
2172 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset_y * d2_linesize +
offset_x;
2173 uint8_t *
const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
2174 uint8_t *
const d0 = (mirror ? d0_bottom_line : d0_data);
2175 uint8_t *
const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
2176 uint8_t *
const d1 = (mirror ? d1_bottom_line : d1_data);
2177 uint8_t *
const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
2178 uint8_t *
const d2 = (mirror ? d2_bottom_line : d2_data);
2180 for (y = 0; y < src_h; y++) {
2181 for (x = slicew_start; x < slicew_end; x++) {
2182 const int c0 = c0_data[x >> c0_shift_w];
2183 const int c1 = c1_data[x >> c1_shift_w];
2184 const int c2 = c2_data[x >> c2_shift_w];
2186 update(d0 + d0_signed_linesize * c0 + x, max, intensity);
2187 *(d1 + d1_signed_linesize * c0 + x) = c1;
2188 *(d2 + d2_signed_linesize * c0 + x) = c2;
2191 if (!c0_shift_h || (y & c0_shift_h))
2192 c0_data += c0_linesize;
2193 if (!c1_shift_h || (y & c1_shift_h))
2194 c1_data += c1_linesize;
2195 if (!c2_shift_h || (y & c2_shift_h))
2196 c2_data += c2_linesize;
2197 d0_data += d0_linesize;
2198 d1_data += d1_linesize;
2199 d2_data += d2_linesize;
2202 uint8_t *d0_data = out->data[
plane] + (offset_y + sliceh_start) * d0_linesize + offset_x;
2203 uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + (offset_y + sliceh_start) * d1_linesize +
offset_x;
2204 uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + (offset_y + sliceh_start) * d2_linesize +
offset_x;
2207 d0_data += s->size - 1;
2208 d1_data += s->size - 1;
2209 d2_data += s->size - 1;
2212 for (y = sliceh_start; y < sliceh_end; y++) {
2213 for (x = 0; x < src_w; x++) {
2214 const int c0 = c0_data[x >> c0_shift_w];
2215 const int c1 = c1_data[x >> c1_shift_w];
2216 const int c2 = c2_data[x >> c2_shift_w];
2219 update(d0_data - c0, max, intensity);
2220 *(d1_data - c0) = c1;
2221 *(d2_data - c0) = c2;
2223 update(d0_data + c0, max, intensity);
2224 *(d1_data + c0) = c1;
2225 *(d2_data + c0) = c2;
2229 if (!c0_shift_h || (y & c0_shift_h))
2230 c0_data += c0_linesize;
2231 if (!c1_shift_h || (y & c1_shift_h))
2232 c1_data += c1_linesize;
2233 if (!c2_shift_h || (y & c2_shift_h))
2234 c2_data += c2_linesize;
2235 d0_data += d0_linesize;
2236 d1_data += d1_linesize;
2237 d2_data += d2_linesize;
2242 #define ACOLOR_FUNC(name, column, mirror) \ 2243 static int acolor_##name(AVFilterContext *ctx, \ 2244 void *arg, int jobnr, \ 2247 WaveformContext *s = ctx->priv; \ 2248 ThreadData *td = arg; \ 2249 AVFrame *in = td->in; \ 2250 AVFrame *out = td->out; \ 2251 int component = td->component; \ 2252 int offset_y = td->offset_y; \ 2253 int offset_x = td->offset_x; \ 2255 acolor(s, in, out, component, s->intensity, \ 2256 offset_y, offset_x, column, mirror, \ 2271 { { {
"16", 16+128 }, {
"16", 16+128 }, {
"16", 16+128 }, {
"0", 0+128 } } },
2272 { { {
"128", 128+128 }, {
"128", 128+128 }, {
"128", 128+128 }, {
"128", 128+128 } } },
2273 { { {
"235", 235+128 }, {
"240", 240+128 }, {
"240", 240+128 }, {
"255", 255+128 } } },
2277 { { {
"32", 32+256 }, {
"32", 32+256 }, {
"32", 32+256 }, {
"0", 0+256 } } },
2278 { { {
"256", 256+256 }, {
"256", 256+256 }, {
"256", 256+256 }, {
"256", 256+256 } } },
2279 { { {
"470", 470+256 }, {
"480", 480+256 }, {
"480", 480+256 }, {
"511", 511+256 } } },
2283 { { {
"64", 64+512 }, {
"64", 64+512 }, {
"64", 64+512 }, {
"0", 0+512 } } },
2284 { { {
"512", 512+512 }, {
"512", 512+512 }, {
"512", 512+512 }, {
"512", 512+512 } } },
2285 { { {
"940", 940+512 }, {
"960", 960+512 }, {
"960", 960+512 }, {
"1023", 1023+512 } } },
2289 { { {
"256", 256+2048 }, {
"256", 256+2048 }, {
"256", 256+2048 }, {
"0", 0+2048 } } },
2290 { { {
"2048", 2048+2048 }, {
"2048", 2048+2048 }, {
"2048", 2048+2048 }, {
"2048", 2048+2048 } } },
2291 { { {
"3760", 3760+2048 }, {
"3840", 3840+2048 }, {
"3840", 3840+2048 }, {
"4095", 4095+2048 } } },
2295 { { {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 0+128 } } },
2296 { { {
"175", 71+128 }, {
"175", 72+128 }, {
"175", 72+128 }, {
"175", 64+128 } } },
2297 { { {
"350", 126+128 }, {
"350", 128+128 }, {
"350", 128+128 }, {
"350", 128+128 } } },
2298 { { {
"525", 180+128 }, {
"525", 184+128 }, {
"525", 184+128 }, {
"525", 192+128 } } },
2299 { { {
"700", 235+128 }, {
"700", 240+128 }, {
"700", 240+128 }, {
"700", 255+128 } } },
2303 { { {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 0+256 } } },
2304 { { {
"175", 142+256 }, {
"175", 144+256 }, {
"175", 144+256 }, {
"175", 128+256 } } },
2305 { { {
"350", 251+256 }, {
"350", 256+256 }, {
"350", 256+256 }, {
"350", 256+256 } } },
2306 { { {
"525", 361+256 }, {
"525", 368+256 }, {
"525", 368+256 }, {
"525", 384+256 } } },
2307 { { {
"700", 470+256 }, {
"700", 480+256 }, {
"700", 480+256 }, {
"700", 511+256 } } },
2311 { { {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 0+512 } } },
2312 { { {
"175", 283+512 }, {
"175", 288+512 }, {
"175", 288+512 }, {
"175", 256+512 } } },
2313 { { {
"350", 502+512 }, {
"350", 512+512 }, {
"350", 512+512 }, {
"350", 512+512 } } },
2314 { { {
"525", 721+512 }, {
"525", 736+512 }, {
"525", 736+512 }, {
"525", 768+512 } } },
2315 { { {
"700", 940+512 }, {
"700", 960+512 }, {
"700", 960+512 }, {
"700", 1023+512 } } },
2319 { { {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 0+2048 } } },
2320 { { {
"175", 1132+2048 }, {
"175", 1152+2048 }, {
"175", 1152+2048 }, {
"175", 1024+2048 } } },
2321 { { {
"350", 2008+2048 }, {
"350", 2048+2048 }, {
"350", 2048+2048 }, {
"350", 2048+2048 } } },
2322 { { {
"525", 2884+2048 }, {
"525", 2944+2048 }, {
"525", 2944+2048 }, {
"525", 3072+2048 } } },
2323 { { {
"700", 3760+2048 }, {
"700", 3840+2048 }, {
"700", 3840+2048 }, {
"700", 4095+2048 } } },
2327 { { {
"-25", -39+128 }, {
"-25", -40+128 }, {
"-25", -40+128 }, {
"-25", -64+128 } } },
2328 { { {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 16+128 }, {
"0", 0+128 } } },
2329 { { {
"25", 71+128 }, {
"25", 72+128 }, {
"25", 72+128 }, {
"25", 64+128 } } },
2330 { { {
"50", 126+128 }, {
"50", 128+128 }, {
"50", 128+128 }, {
"50", 128+128 } } },
2331 { { {
"75", 180+128 }, {
"75", 184+128 }, {
"75", 184+128 }, {
"75", 192+128 } } },
2332 { { {
"100", 235+128 }, {
"100", 240+128 }, {
"100", 240+128 }, {
"100", 256+128 } } },
2333 { { {
"125", 290+128 }, {
"125", 296+128 }, {
"125", 296+128 }, {
"125", 320+128 } } },
2337 { { {
"-25", -78+256 }, {
"-25", -80+256 }, {
"-25", -80+256 }, {
"-25",-128+256 } } },
2338 { { {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 32+256 }, {
"0", 0+256 } } },
2339 { { {
"25", 142+256 }, {
"25", 144+256 }, {
"25", 144+256 }, {
"25", 128+256 } } },
2340 { { {
"50", 251+256 }, {
"50", 256+256 }, {
"50", 256+256 }, {
"50", 256+256 } } },
2341 { { {
"75", 361+256 }, {
"75", 368+256 }, {
"75", 368+256 }, {
"75", 384+256 } } },
2342 { { {
"100", 470+256 }, {
"100", 480+256 }, {
"100", 480+256 }, {
"100", 512+256 } } },
2343 { { {
"125", 580+256 }, {
"125", 592+256 }, {
"125", 592+256 }, {
"125", 640+256 } } },
2347 { { {
"-25",-156+512 }, {
"-25",-160+512 }, {
"-25",-160+512 }, {
"-25", -256+512 } } },
2348 { { {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 64+512 }, {
"0", 0+512 } } },
2349 { { {
"25", 283+512 }, {
"25", 288+512 }, {
"25", 288+512 }, {
"25", 256+512 } } },
2350 { { {
"50", 502+512 }, {
"50", 512+512 }, {
"50", 512+512 }, {
"50", 512+512 } } },
2351 { { {
"75", 721+512 }, {
"75", 736+512 }, {
"75", 736+512 }, {
"75", 768+512 } } },
2352 { { {
"100", 940+512 }, {
"100", 960+512 }, {
"100", 960+512 }, {
"100", 1024+512 } } },
2353 { { {
"125",1160+512 }, {
"125",1184+512 }, {
"125",1184+512 }, {
"125", 1280+512 } } },
2357 { { {
"-25", -624+2048 }, {
"-25", -640+2048 }, {
"-25", -640+2048 }, {
"-25",-1024+2048 } } },
2358 { { {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 256+2048 }, {
"0", 0+2048 } } },
2359 { { {
"25", 1132+2048 }, {
"25", 1152+2048 }, {
"25", 1152+2048 }, {
"25", 1024+2048 } } },
2360 { { {
"50", 2008+2048 }, {
"50", 2048+2048 }, {
"50", 2048+2048 }, {
"50", 2048+2048 } } },
2361 { { {
"75", 2884+2048 }, {
"75", 2944+2048 }, {
"75", 2944+2048 }, {
"75", 3072+2048 } } },
2362 { { {
"100", 3760+2048 }, {
"100", 3840+2048 }, {
"100", 3840+2048 }, {
"100", 4096+2048 } } },
2363 { { {
"125", 4640+2048 }, {
"125", 4736+2048 }, {
"125", 4736+2048 }, {
"125", 5120+2048 } } },
2367 { { {
"16", 16+256 }, {
"16", 16+256 }, {
"16", 16+256 }, {
"0", 0+256 } } },
2368 { { {
"128", 128+256 }, {
"128", 128+256 }, {
"128", 128+256 }, {
"128", 128+256 } } },
2369 { { {
"235", 235+256 }, {
"240", 240+256 }, {
"240", 240+256 }, {
"255", 255+256 } } },
2373 { { {
"32", 32+512 }, {
"32", 32+512 }, {
"32", 32+512 }, {
"0", 0+512 } } },
2374 { { {
"256", 256+512 }, {
"256", 256+512 }, {
"256", 256+512 }, {
"256", 256+512 } } },
2375 { { {
"470", 470+512 }, {
"480", 480+512 }, {
"480", 480+512 }, {
"511", 511+512 } } },
2379 { { {
"64", 64+1024 }, {
"64", 64+1024 }, {
"64", 64+1024 }, {
"0", 0+1024 } } },
2380 { { {
"512", 512+1024 }, {
"512", 512+1024 }, {
"512", 512+1024 }, {
"512", 512+1024 } } },
2381 { { {
"940", 940+1024 }, {
"960", 960+1024 }, {
"960", 960+1024 }, {
"1023", 1023+1024 } } },
2385 { { {
"256", 256+4096 }, {
"256", 256+4096 }, {
"256", 256+4096 }, {
"0", 0+4096 } } },
2386 { { {
"2048", 2048+4096 }, {
"2048", 2048+4096 }, {
"2048", 2048+4096 }, {
"2048", 2048+4096 } } },
2387 { { {
"3760", 3760+4096 }, {
"3840", 3840+4096 }, {
"3840", 3840+4096 }, {
"4095", 4095+4096 } } },
2391 { { {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 0+256 } } },
2392 { { {
"175", 71+256 }, {
"175", 72+256 }, {
"175", 72+256 }, {
"175", 64+256 } } },
2393 { { {
"350", 126+256 }, {
"350", 128+256 }, {
"350", 128+256 }, {
"350", 128+256 } } },
2394 { { {
"525", 180+256 }, {
"525", 184+256 }, {
"525", 184+256 }, {
"525", 192+256 } } },
2395 { { {
"700", 235+256 }, {
"700", 240+256 }, {
"700", 240+256 }, {
"700", 255+256 } } },
2399 { { {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 0+512 } } },
2400 { { {
"175", 142+512 }, {
"175", 144+512 }, {
"175", 144+512 }, {
"175", 128+512 } } },
2401 { { {
"350", 251+512 }, {
"350", 256+512 }, {
"350", 256+512 }, {
"350", 256+512 } } },
2402 { { {
"525", 361+512 }, {
"525", 368+512 }, {
"525", 368+512 }, {
"525", 384+512 } } },
2403 { { {
"700", 470+512 }, {
"700", 480+512 }, {
"700", 480+512 }, {
"700", 511+512 } } },
2407 { { {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 0+1024 } } },
2408 { { {
"175", 283+1024 }, {
"175", 288+1024 }, {
"175", 288+1024 }, {
"175", 256+1024 } } },
2409 { { {
"350", 502+1024 }, {
"350", 512+1024 }, {
"350", 512+1024 }, {
"350", 512+1024 } } },
2410 { { {
"525", 721+1024 }, {
"525", 736+1024 }, {
"525", 736+1024 }, {
"525", 768+1024 } } },
2411 { { {
"700", 940+1024 }, {
"700", 960+1024 }, {
"700", 960+1024 }, {
"700", 1023+1024 } } },
2415 { { {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 0+4096 } } },
2416 { { {
"175", 1132+4096 }, {
"175", 1152+4096 }, {
"175", 1152+4096 }, {
"175", 1024+4096 } } },
2417 { { {
"350", 2008+4096 }, {
"350", 2048+4096 }, {
"350", 2048+4096 }, {
"350", 2048+4096 } } },
2418 { { {
"525", 2884+4096 }, {
"525", 2944+4096 }, {
"525", 2944+4096 }, {
"525", 3072+4096 } } },
2419 { { {
"700", 3760+4096 }, {
"700", 3840+4096 }, {
"700", 3840+4096 }, {
"700", 4095+4096 } } },
2423 { { {
"-25", -39+256 }, {
"-25", -40+256 }, {
"-25", -40+256 }, {
"-25", -64+256 } } },
2424 { { {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 16+256 }, {
"0", 0+256 } } },
2425 { { {
"25", 71+256 }, {
"25", 72+256 }, {
"25", 72+256 }, {
"25", 64+256 } } },
2426 { { {
"50", 126+256 }, {
"50", 128+256 }, {
"50", 128+256 }, {
"50", 128+256 } } },
2427 { { {
"75", 180+256 }, {
"75", 184+256 }, {
"75", 184+256 }, {
"75", 192+256 } } },
2428 { { {
"100", 235+256 }, {
"100", 240+256 }, {
"100", 240+256 }, {
"100", 256+256 } } },
2429 { { {
"125", 290+256 }, {
"125", 296+256 }, {
"125", 296+256 }, {
"125", 320+256 } } },
2433 { { {
"-25", -78+512 }, {
"-25", -80+512 }, {
"-25", -80+512 }, {
"-25",-128+512 } } },
2434 { { {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 32+512 }, {
"0", 0+512 } } },
2435 { { {
"25", 142+512 }, {
"25", 144+512 }, {
"25", 144+512 }, {
"25", 128+512 } } },
2436 { { {
"50", 251+512 }, {
"50", 256+512 }, {
"50", 256+512 }, {
"50", 256+512 } } },
2437 { { {
"75", 361+512 }, {
"75", 368+512 }, {
"75", 368+512 }, {
"75", 384+512 } } },
2438 { { {
"100", 470+512 }, {
"100", 480+512 }, {
"100", 480+512 }, {
"100", 512+512 } } },
2439 { { {
"125", 580+512 }, {
"125", 592+512 }, {
"125", 592+512 }, {
"125", 640+512 } } },
2443 { { {
"-25",-156+1024 }, {
"-25",-160+1024 }, {
"-25",-160+1024 }, {
"-25", -256+1024 } } },
2444 { { {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 64+1024 }, {
"0", 0+1024 } } },
2445 { { {
"25", 283+1024 }, {
"25", 288+1024 }, {
"25", 288+1024 }, {
"25", 256+1024 } } },
2446 { { {
"50", 502+1024 }, {
"50", 512+1024 }, {
"50", 512+1024 }, {
"50", 512+1024 } } },
2447 { { {
"75", 721+1024 }, {
"75", 736+1024 }, {
"75", 736+1024 }, {
"75", 768+1024 } } },
2448 { { {
"100", 940+1024 }, {
"100", 960+1024 }, {
"100", 960+1024 }, {
"100", 1024+1024 } } },
2449 { { {
"125",1160+1024 }, {
"125",1184+1024 }, {
"125",1184+1024 }, {
"125", 1280+1024 } } },
2453 { { {
"-25", -624+4096 }, {
"-25", -640+4096 }, {
"-25", -640+4096 }, {
"-25",-1024+4096 } } },
2454 { { {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 256+4096 }, {
"0", 0+4096 } } },
2455 { { {
"25", 1132+4096 }, {
"25", 1152+4096 }, {
"25", 1152+4096 }, {
"25", 1024+4096 } } },
2456 { { {
"50", 2008+4096 }, {
"50", 2048+4096 }, {
"50", 2048+4096 }, {
"50", 2048+4096 } } },
2457 { { {
"75", 2884+4096 }, {
"75", 2944+4096 }, {
"75", 2944+4096 }, {
"75", 3072+4096 } } },
2458 { { {
"100", 3760+4096 }, {
"100", 3840+4096 }, {
"100", 3840+4096 }, {
"100", 4096+4096 } } },
2459 { { {
"125", 4640+4096 }, {
"125", 4736+4096 }, {
"125", 4736+4096 }, {
"125", 5120+4096 } } },
2463 { { {
"16", 16 }, {
"16", 16 }, {
"16", 16 }, {
"0", 0 } } },
2464 { { {
"128", 128 }, {
"128", 128 }, {
"128", 128 }, {
"128", 128 } } },
2465 { { {
"235", 235 }, {
"240", 240 }, {
"240", 240 }, {
"255", 255 } } },
2469 { { {
"32", 32 }, {
"32", 32 }, {
"32", 32 }, {
"0", 0 } } },
2470 { { {
"256", 256 }, {
"256", 256 }, {
"256", 256 }, {
"256", 256 } } },
2471 { { {
"470", 470 }, {
"480", 480 }, {
"480", 480 }, {
"511", 511 } } },
2475 { { {
"64", 64 }, {
"64", 64 }, {
"64", 64 }, {
"0", 0 } } },
2476 { { {
"512", 512 }, {
"512", 512 }, {
"512", 512 }, {
"512", 512 } } },
2477 { { {
"940", 940 }, {
"960", 960 }, {
"960", 960 }, {
"1023", 1023 } } },
2481 { { {
"256", 256 }, {
"256", 256 }, {
"256", 256 }, {
"0", 0 } } },
2482 { { {
"2048", 2048 }, {
"2048", 2048 }, {
"2048", 2048 }, {
"2048", 2048 } } },
2483 { { {
"3760", 3760 }, {
"3840", 3840 }, {
"3840", 3840 }, {
"4095", 4095 } } },
2487 { { {
"0", 16 }, {
"0", 16 }, {
"0", 16 }, {
"0", 0 } } },
2488 { { {
"175", 71 }, {
"175", 72 }, {
"175", 72 }, {
"175", 64 } } },
2489 { { {
"350", 126 }, {
"350", 128 }, {
"350", 128 }, {
"350", 128 } } },
2490 { { {
"525", 180 }, {
"525", 184 }, {
"525", 184 }, {
"525", 192 } } },
2491 { { {
"700", 235 }, {
"700", 240 }, {
"700", 240 }, {
"700", 255 } } },
2495 { { {
"0", 32 }, {
"0", 32 }, {
"0", 32 }, {
"0", 0 } } },
2496 { { {
"175", 142 }, {
"175", 144 }, {
"175", 144 }, {
"175", 128 } } },
2497 { { {
"350", 251 }, {
"350", 256 }, {
"350", 256 }, {
"350", 256 } } },
2498 { { {
"525", 361 }, {
"525", 368 }, {
"525", 368 }, {
"525", 384 } } },
2499 { { {
"700", 470 }, {
"700", 480 }, {
"700", 480 }, {
"700", 511 } } },
2503 { { {
"0", 64 }, {
"0", 64 }, {
"0", 64 }, {
"0", 0 } } },
2504 { { {
"175", 283 }, {
"175", 288 }, {
"175", 288 }, {
"175", 256 } } },
2505 { { {
"350", 502 }, {
"350", 512 }, {
"350", 512 }, {
"350", 512 } } },
2506 { { {
"525", 721 }, {
"525", 736 }, {
"525", 736 }, {
"525", 768 } } },
2507 { { {
"700", 940 }, {
"700", 960 }, {
"700", 960 }, {
"700", 1023 } } },
2511 { { {
"0", 256 }, {
"0", 256 }, {
"0", 256 }, {
"0", 0 } } },
2512 { { {
"175", 1132 }, {
"175", 1152 }, {
"175", 1152 }, {
"175", 1024 } } },
2513 { { {
"350", 2008 }, {
"350", 2048 }, {
"350", 2048 }, {
"350", 2048 } } },
2514 { { {
"525", 2884 }, {
"525", 2944 }, {
"525", 2944 }, {
"525", 3072 } } },
2515 { { {
"700", 3760 }, {
"700", 3840 }, {
"700", 3840 }, {
"700", 4095 } } },
2519 { { {
"0", 16 }, {
"0", 16 }, {
"0", 16 }, {
"0", 0 } } },
2520 { { {
"25", 71 }, {
"25", 72 }, {
"25", 72 }, {
"25", 64 } } },
2521 { { {
"50", 126 }, {
"50", 128 }, {
"50", 128 }, {
"50", 128 } } },
2522 { { {
"75", 180 }, {
"75", 184 }, {
"75", 184 }, {
"75", 192 } } },
2523 { { {
"100", 235 }, {
"100", 240 }, {
"100", 240 }, {
"100", 255 } } },
2527 { { {
"0", 32 }, {
"0", 32 }, {
"0", 32 }, {
"0", 0 } } },
2528 { { {
"25", 142 }, {
"25", 144 }, {
"25", 144 }, {
"25", 128 } } },
2529 { { {
"50", 251 }, {
"50", 256 }, {
"50", 256 }, {
"50", 256 } } },
2530 { { {
"75", 361 }, {
"75", 368 }, {
"75", 368 }, {
"75", 384 } } },
2531 { { {
"100", 470 }, {
"100", 480 }, {
"100", 480 }, {
"100", 511 } } },
2535 { { {
"0", 64 }, {
"0", 64 }, {
"0", 64 }, {
"0", 0 } } },
2536 { { {
"25", 283 }, {
"25", 288 }, {
"25", 288 }, {
"25", 256 } } },
2537 { { {
"50", 502 }, {
"50", 512 }, {
"50", 512 }, {
"50", 512 } } },
2538 { { {
"75", 721 }, {
"75", 736 }, {
"75", 736 }, {
"75", 768 } } },
2539 { { {
"100", 940 }, {
"100", 960 }, {
"100", 960 }, {
"100", 1023 } } },
2543 { { {
"0", 256 }, {
"0", 256 }, {
"0", 256 }, {
"0", 0 } } },
2544 { { {
"25", 1132 }, {
"25", 1152 }, {
"25", 1152 }, {
"25", 1024 } } },
2545 { { {
"50", 2008 }, {
"50", 2048 }, {
"50", 2048 }, {
"50", 2048 } } },
2546 { { {
"75", 2884 }, {
"75", 2944 }, {
"75", 2944 }, {
"75", 3072 } } },
2547 { { {
"100", 3760 }, {
"100", 3840 }, {
"100", 3840 }, {
"100", 4095 } } },
2551 { { {
"50", 50 }, {
"50", 50 }, {
"50", 50 }, {
"50", 50 } } },
2552 { { {
"100", 100 }, {
"100", 100 }, {
"100", 100 }, {
"100", 100 } } },
2553 { { {
"150", 150 }, {
"150", 150 }, {
"150", 150 }, {
"150", 150 } } },
2554 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2555 { { {
"255", 255 }, {
"255", 255 }, {
"255", 255 }, {
"255", 255 } } },
2559 { { {
"100", 100 }, {
"100", 100 }, {
"100", 100 }, {
"100", 100 } } },
2560 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2561 { { {
"300", 300 }, {
"300", 300 }, {
"300", 300 }, {
"300", 300 } } },
2562 { { {
"400", 400 }, {
"400", 400 }, {
"400", 400 }, {
"400", 400 } } },
2563 { { {
"500", 500 }, {
"500", 500 }, {
"500", 500 }, {
"500", 500 } } },
2567 { { {
"200", 200 }, {
"200", 200 }, {
"200", 200 }, {
"200", 200 } } },
2568 { { {
"400", 400 }, {
"400", 400 }, {
"400", 400 }, {
"400", 400 } } },
2569 { { {
"600", 600 }, {
"600", 600 }, {
"600", 600 }, {
"600", 600 } } },
2570 { { {
"800", 800 }, {
"800", 800 }, {
"800", 800 }, {
"800", 800 } } },
2571 { { {
"1000",1000 }, {
"1000",1000 }, {
"1000",1000 }, {
"1000",1000 } } },
2575 { { {
"800", 800 }, {
"800", 800 }, {
"800", 800 }, {
"800", 800 } } },
2576 { { {
"1600", 1600 }, {
"1600", 1600 }, {
"1600", 1600 }, {
"1600", 1600 } } },
2577 { { {
"2400", 2400 }, {
"2400", 2400 }, {
"2400", 2400 }, {
"2400", 2400 } } },
2578 { { {
"3200", 3200 }, {
"3200", 3200 }, {
"3200", 3200 }, {
"3200", 3200 } } },
2579 { { {
"4000", 4000 }, {
"4000", 4000 }, {
"4000", 4000 }, {
"4000", 4000 } } },
2587 dst[0] = v * o1 + dst[0] * o2;
2589 dst += linesize *
step;
2595 uint16_t *
dst = (uint16_t *)ddst;
2599 dst[0] = v * o1 + dst[0] * o2;
2601 dst += (linesize / 2) * step;
2610 dst[x] = v * o1 + dst[x] * o2;
2616 uint16_t *
dst = (uint16_t *)ddst;
2620 dst[x] = v * o1 + dst[x] * o2;
2632 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2633 for (i = 0; txt[
i]; i++) {
2635 int v = color[
plane];
2638 for (char_y = 0; char_y < font_height; char_y++) {
2639 for (mask = 0x80;
mask; mask >>= 1) {
2640 if (font[txt[i] * font_height + char_y] & mask)
2641 p[0] = p[0] * o2 + v * o1;
2658 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2659 for (i = 0; txt[
i]; i++) {
2663 uint16_t *
p = (uint16_t *)(out->
data[plane] + y * out->
linesize[plane]) + (x + i * 8);
2664 for (char_y = 0; char_y < font_height; char_y++) {
2665 for (mask = 0x80;
mask; mask >>= 1) {
2666 if (font[txt[i] * font_height + char_y] & mask)
2667 p[0] = p[0] * o2 + v * o1;
2684 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2685 for (i = 0; txt[
i]; i++) {
2687 int v = color[
plane];
2689 for (char_y = font_height - 1; char_y >= 0; char_y--) {
2691 for (mask = 0x80;
mask; mask >>= 1) {
2692 if (font[txt[i] * font_height + font_height - 1 - char_y] & mask)
2693 p[char_y] = p[char_y] * o2 + v * o1;
2709 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2710 for (i = 0; txt[
i]; i++) {
2714 for (char_y = 0; char_y < font_height; char_y++) {
2715 uint16_t *
p = (uint16_t *)(out->
data[plane] + (y + i * 10) * out->
linesize[
plane]) + x;
2716 for (mask = 0x80;
mask; mask >>= 1) {
2717 if (font[txt[i] * font_height + font_height - 1 - char_y] & mask)
2718 p[char_y] = p[char_y] * o2 + v * o1;
2731 dst[0] = (v - dst[0]) * o1 + dst[0] * o2;
2733 dst += linesize *
step;
2739 uint16_t *
dst = (uint16_t *)ddst;
2743 dst[0] = (v - dst[0]) * o1 + dst[0] * o2;
2745 dst += (linesize / 2) * step;
2754 dst[x] = (v - dst[x]) * o1 + dst[x] * o2;
2760 uint16_t *
dst = (uint16_t *)ddst;
2764 dst[x] = (v - dst[x]) * o1 + dst[x] * o2;
2776 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2777 for (i = 0; txt[
i]; i++) {
2779 int v = color[
plane];
2782 for (char_y = 0; char_y < font_height; char_y++) {
2783 for (mask = 0x80;
mask; mask >>= 1) {
2784 if (font[txt[i] * font_height + char_y] & mask)
2785 p[0] = p[0] * o2 + (v - p[0]) * o1;
2802 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2803 for (i = 0; txt[
i]; i++) {
2807 uint16_t *
p = (uint16_t *)(out->
data[plane] + y * out->
linesize[plane]) + (x + i * 8);
2808 for (char_y = 0; char_y < font_height; char_y++) {
2809 for (mask = 0x80;
mask; mask >>= 1) {
2810 if (font[txt[i] * font_height + char_y] & mask)
2811 p[0] = p[0] * o2 + (v - p[0]) * o1;
2828 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2829 for (i = 0; txt[
i]; i++) {
2831 int v = color[
plane];
2833 for (char_y = font_height - 1; char_y >= 0; char_y--) {
2835 for (mask = 0x80;
mask; mask >>= 1) {
2836 if (font[txt[i] * font_height + font_height - 1 - char_y] & mask)
2837 p[char_y] = p[char_y] * o2 + (v - p[char_y]) * o1;
2853 for (plane = 0; plane < 4 && out->
data[
plane]; plane++) {
2854 for (i = 0; txt[
i]; i++) {
2858 for (char_y = 0; char_y < font_height; char_y++) {
2859 uint16_t *
p = (uint16_t *)(out->
data[plane] + (y + i * 10) * out->
linesize[
plane]) + x;
2860 for (mask = 0x80;
mask; mask >>= 1) {
2861 if (font[txt[i] * font_height + font_height - 1 - char_y] & mask)
2862 p[char_y] = p[char_y] * o2 + (v - p[char_y]) * o1;
2878 const float o2 = 1. - o1;
2888 for (p = 0; p < s->
ncomp; p++) {
2919 const float o2 = 1. - o1;
2920 const int mult = s->
max / 256;
2930 for (p = 0; p < s->
ncomp; p++) {
2961 const float o2 = 1. - o1;
2971 for (p = 0; p < s->
ncomp; p++) {
2978 s->
blend_line(dst, width, 1, o1, o2, v, step);
3002 const float o2 = 1. - o1;
3003 const int mult = s->
max / 256;
3013 for (p = 0; p < s->
ncomp; p++) {
3020 s->
blend_line(dst, width, 1, o1, o2, v, step);
3062 case FLAT: s->
size = 256 * 3;
break;
3063 default: s->
size = 256;
break;
3293 switch (inlink->
format) {
3345 for (p = 0; p < s->
ncomp; p++) {
3349 if (!((1 << p) & s->
pcomp))
3352 for (k = 0; k < 4; k++) {
3361 for (k = 0; k < 4; k++) {
3389 for (k = 0; k < s->
dcomp; k++) {
3391 for (i = 0; i < outlink->
h ; i++)
3396 const int mult = s->
max / 256;
3399 for (i = 0; i < outlink->
h ; i++) {
3400 for (j = 0; j < outlink->
w; j++)
3407 for (k = 0, i = 0; k < s->
ncomp; k++) {
3408 if ((1 << k) & s->
pcomp) {
3415 offset_x = s->
mode ? i++ * inlink->
w : 0;
3416 offset_y = s->
mode ? 0 : i++ * inlink->
h;
3439 envelope(s, out, plane, plane, s->
mode ? offset_x : offset_y);
3445 envelope(s, out, plane, plane, s->
mode ? offset_x : offset_y);
3504 .priv_class = &waveform_class,
int plane
Which of the 4 planes contains the component.
#define AV_PIX_FMT_YUVA422P9
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA422P10
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Main libavfilter public API header.
int h
agreed upon image height
#define AV_PIX_FMT_GBRP10
static void blend_line(uint8_t *dst, unsigned src, unsigned alpha, int dx, int w, unsigned hsub, int left, int right)
#define AV_PIX_FMT_YUV420P12
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
void(* draw_text)(AVFrame *out, int x, int y, int mult, float o1, float o2, const char *txt, const uint8_t color[4])
#define AV_PIX_FMT_GRAY10
const char * name
Pad name.
#define AV_PIX_FMT_GRAY12
AVFilterLink ** inputs
array of pointers to input links
uint8_t grat_yuva_color[4]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
void(* graticulef)(struct WaveformContext *s, AVFrame *out)
static av_cold int end(AVCodecContext *avctx)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_PIX_FMT_YUVA420P9
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_YUV422P12
A filter pad used for either input or output.
A link between two filters.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define i(width, name, range_min, range_max)
const uint8_t avpriv_cga_font[2048]
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
static void mirror(const float *modifier, float *vec)
struct GraticuleLine line[4]
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
enum AVColorRange color_range
MPEG vs JPEG YUV range.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#define AV_PIX_FMT_GBRAP12
simple assert() macros that are a bit more flexible than ISO C assert().
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
#define AV_PIX_FMT_YUV444P10
static enum AVPixelFormat in_pix_fmts[]
static const uint8_t offset[127][2]
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
#define AV_PIX_FMT_YUV422P9
uint8_t nb_components
The number of components each pixel has, (1-4)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUVA444P12
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
AVFilterContext * src
source filter
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV444P9
int format
agreed upon media format
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
typedef void(RENAME(mix_any_func_type))
Used for passing data between threads.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static void draw_text(FFDrawContext *draw, AVFrame *frame, FFDrawColor *color, int x0, int y0, const uint8_t *text, int vertical)
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
void(* blend_line)(uint8_t *dst, int size, int linesize, float o1, float o2, int v, int step)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AV_PIX_FMT_YUV420P10
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const char * name
Filter name.
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV420P9
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterLink ** outputs
array of pointers to output links
#define AV_PIX_FMT_GBRP12
#define flags(name, subs,...)
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_YUVA444P9
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static enum AVPixelFormat out_pix_fmts[]
avfilter_execute_func * execute
AVFilterContext * dst
dest filter
const AVPixFmtDescriptor * odesc
const AVPixFmtDescriptor * desc
int(* waveform_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
#define av_malloc_array(a, b)
int depth
Number of bits in the component.
const AVPixFmtDescriptor * desc
AVPixelFormat
Pixel format.
mode
Use these values in ebur128_init (or'ed).
CGA/EGA/VGA ROM font data.
AVFilterFormats * out_formats
#define AV_PIX_FMT_YUVA422P12
#define AV_CEIL_RSHIFT(a, b)