int black;
float mpd, mhd, msd, mac, spw, bhd, wth, bth;
int chp;
int black;
float mpd, mhd, msd, mac, spw, bhd, wth, bth;
int chp;
{ "th_w", "set white color threshold", OFFSET(wth), AV_OPT_TYPE_FLOAT, {.dbl=.35}, 0.1, 1, FLAGS },
{ "th_b", "set black color threshold", OFFSET(bth), AV_OPT_TYPE_FLOAT, {.dbl=.15}, 0, 0.5, FLAGS },
{ "chp", "check and apply parity bit", OFFSET(chp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
{ "th_w", "set white color threshold", OFFSET(wth), AV_OPT_TYPE_FLOAT, {.dbl=.35}, 0.1, 1, FLAGS },
{ "th_b", "set black color threshold", OFFSET(bth), AV_OPT_TYPE_FLOAT, {.dbl=.15}, 0, 0.5, FLAGS },
{ "chp", "check and apply parity bit", OFFSET(chp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
+ { "lp", "lowpass line prior to processing", OFFSET(lp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
s->max_start_diff = s->msd * ((1 << depth) - 1);
s->white = s->wth * ((1 << depth) - 1);
s->black = s->bth * ((1 << depth) - 1);
s->max_start_diff = s->msd * ((1 << depth) - 1);
s->white = s->wth * ((1 << depth) - 1);
s->black = s->bth * ((1 << depth) - 1);
+
+ if (s->lp) {
+ uint8_t *dst = s->temp;
+ int w = inlink->w - 1;
+
+ for (i = 0; i < inlink->w; i++) {
+ int a = FFMAX(i - 3, 0);
+ int b = FFMAX(i - 2, 0);
+ int c = FFMAX(i - 1, 0);
+ int d = FFMIN(i + 3, w);
+ int e = FFMIN(i + 2, w);
+ int f = FFMIN(i + 1, w);
+
+ dst[i] = (src[a] + src[b] + src[c] + src[i] + src[d] + src[e] + src[f] + 6) / 7;
+ }
+
+ src = s->temp;
+ }
+
for (i = 0; i < sync_width; i++) {
max = FFMAX(max, src[i]);
min = FFMIN(min, src[i]);
for (i = 0; i < sync_width; i++) {
max = FFMAX(max, src[i]);
min = FFMIN(min, src[i]);
- if (max_peak_diff > s->max_peak_diff)
+ if (max_peak_diff > s->max_peak_diff) {
+ av_log(ctx, AV_LOG_DEBUG, "mhd: %d > %d\n", max_peak_diff, s->max_peak_diff);
- if (range > s->max_period_diff)
+ if (range > s->max_period_diff) {
+ av_log(ctx, AV_LOG_DEBUG, "mpd: %d > %d\n", range, s->max_period_diff);
s1 = src[sync_width + width_per_bit * 0 + width_per_bit / 2];
s2 = src[sync_width + width_per_bit * 1 + width_per_bit / 2];
s3 = src[sync_width + width_per_bit * 2 + width_per_bit / 2];
s1 = src[sync_width + width_per_bit * 0 + width_per_bit / 2];
s2 = src[sync_width + width_per_bit * 1 + width_per_bit / 2];
s3 = src[sync_width + width_per_bit * 2 + width_per_bit / 2];
- if (FFABS(s1 - s2) > s->max_start_diff || s1 > s->black || s2 > s->black || s3 < s->white)
+ if (FFABS(s1 - s2) > s->max_start_diff || s1 > s->black || s2 > s->black || s3 < s->white) {
+ av_log(ctx, AV_LOG_DEBUG, "msd: %d > %d\n", FFABS(s1 - s2), s->max_start_diff);
for (ch = 0; ch < 2; ch++) {
for (parity = 0, i = 0; i < 8; i++) {
for (ch = 0; ch < 2; ch++) {
for (parity = 0, i = 0; i < 8; i++) {
.query_formats = query_formats,
.inputs = readeia608_inputs,
.outputs = readeia608_outputs,
.query_formats = query_formats,
.inputs = readeia608_inputs,
.outputs = readeia608_outputs,