Commit cc5c667e authored by Clément Bœsch's avatar Clément Bœsch Committed by Clément Bœsch

avfilter/signalstats: reindent after previous commit

parent 56b98dfc
...@@ -139,23 +139,23 @@ static int filter_brng(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i ...@@ -139,23 +139,23 @@ static int filter_brng(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i
int x, y, score = 0; int x, y, score = 0;
for (y = 0; y < h; y++) { for (y = 0; y < h; y++) {
const int yc = y >> s->vsub; const int yc = y >> s->vsub;
const uint8_t *pluma = &in->data[0][y * in->linesize[0]]; const uint8_t *pluma = &in->data[0][y * in->linesize[0]];
const uint8_t *pchromau = &in->data[1][yc * in->linesize[1]]; const uint8_t *pchromau = &in->data[1][yc * in->linesize[1]];
const uint8_t *pchromav = &in->data[2][yc * in->linesize[2]]; const uint8_t *pchromav = &in->data[2][yc * in->linesize[2]];
for (x = 0; x < w; x++) { for (x = 0; x < w; x++) {
const int xc = x >> s->hsub; const int xc = x >> s->hsub;
const int luma = pluma[x]; const int luma = pluma[x];
const int chromau = pchromau[xc]; const int chromau = pchromau[xc];
const int chromav = pchromav[xc]; const int chromav = pchromav[xc];
const int filt = luma < 16 || luma > 235 || const int filt = luma < 16 || luma > 235 ||
chromau < 16 || chromau > 240 || chromau < 16 || chromau > 240 ||
chromav < 16 || chromav > 240; chromav < 16 || chromav > 240;
score += filt; score += filt;
if (out && filt) if (out && filt)
burn_frame(s, out, x, y); burn_frame(s, out, x, y);
} }
} }
return score; return score;
} }
...@@ -173,35 +173,35 @@ static int filter_tout(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i ...@@ -173,35 +173,35 @@ static int filter_tout(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i
for (y = 0; y < h; y++) { for (y = 0; y < h; y++) {
if (y - 1 < 0 || y + 1 >= h) if (y - 1 < 0 || y + 1 >= h)
continue; continue;
// detect two pixels above and below (to eliminate interlace artefacts) // detect two pixels above and below (to eliminate interlace artefacts)
// should check that video format is infact interlaced. // should check that video format is infact interlaced.
#define FILTER(i, j) \ #define FILTER(i, j) \
filter_tout_outlier(p[(y-j) * lw + x + i], \ filter_tout_outlier(p[(y-j) * lw + x + i], \
p[ y * lw + x + i], \ p[ y * lw + x + i], \
p[(y+j) * lw + x + i]) p[(y+j) * lw + x + i])
#define FILTER3(j) (FILTER(-1, j) && FILTER(0, j) && FILTER(1, j)) #define FILTER3(j) (FILTER(-1, j) && FILTER(0, j) && FILTER(1, j))
if (y - 2 >= 0 && y + 2 < h) { if (y - 2 >= 0 && y + 2 < h) {
for (x = 1; x < w - 1; x++) { for (x = 1; x < w - 1; x++) {
filt = FILTER3(2) && FILTER3(1); filt = FILTER3(2) && FILTER3(1);
score += filt; score += filt;
if (filt && out) if (filt && out)
burn_frame(s, out, x, y); burn_frame(s, out, x, y);
} }
} else { } else {
for (x = 1; x < w - 1; x++) { for (x = 1; x < w - 1; x++) {
filt = FILTER3(1); filt = FILTER3(1);
score += filt; score += filt;
if (filt && out) if (filt && out)
burn_frame(s, out, x, y); burn_frame(s, out, x, y);
}
} }
} }
}
return score; return score;
} }
...@@ -214,18 +214,18 @@ static int filter_vrep(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i ...@@ -214,18 +214,18 @@ static int filter_vrep(SignalstatsContext *s, const AVFrame *in, AVFrame *out, i
int x, y, score = 0; int x, y, score = 0;
for (y = VREP_START; y < h; y++) { for (y = VREP_START; y < h; y++) {
const int y2lw = (y - VREP_START) * lw; const int y2lw = (y - VREP_START) * lw;
const int ylw = y * lw; const int ylw = y * lw;
int filt, totdiff = 0; int filt, totdiff = 0;
for (x = 0; x < w; x++)
totdiff += abs(p[y2lw + x] - p[ylw + x]);
filt = totdiff < w;
score += filt;
if (filt && out)
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
burn_frame(s, out, x, y); totdiff += abs(p[y2lw + x] - p[ylw + x]);
filt = totdiff < w;
score += filt;
if (filt && out)
for (x = 0; x < w; x++)
burn_frame(s, out, x, y);
} }
return score * w; return score * w;
} }
...@@ -317,12 +317,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) ...@@ -317,12 +317,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
cpw += prev->linesize[1]; cpw += prev->linesize[1];
} }
for (fil = 0; fil < FILT_NUMB; fil ++) { for (fil = 0; fil < FILT_NUMB; fil ++) {
if (s->filters & 1<<fil) { if (s->filters & 1<<fil) {
AVFrame *dbg = out != in && s->outfilter == fil ? out : NULL; AVFrame *dbg = out != in && s->outfilter == fil ? out : NULL;
filtot[fil] = filters_def[fil].process(s, in, dbg, link->w, link->h); filtot[fil] = filters_def[fil].process(s, in, dbg, link->w, link->h);
}
} }
}
// find low / high based on histogram percentile // find low / high based on histogram percentile
// these only need to be calculated once. // these only need to be calculated once.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment