avfilter/phase: do not pass the whole context to analyze_plane().

Also make sure the AVFilterContext is only being used for logging by
changing the type to void*
This commit is contained in:
Clément Bœsch 2014-05-03 22:41:33 +02:00
parent 362ab940fc
commit 687119aa9d
1 changed files with 2 additions and 4 deletions

View File

@ -112,8 +112,7 @@ static int config_input(AVFilterLink *inlink)
* Find which field combination has the smallest average squared difference * Find which field combination has the smallest average squared difference
* between the fields. * between the fields.
*/ */
static enum PhaseMode analyze_plane(AVFilterContext *ctx, PhaseContext *s, static enum PhaseMode analyze_plane(void *ctx, enum PhaseMode mode, AVFrame *old, AVFrame *new)
AVFrame *old, AVFrame *new)
{ {
double bdiff, tdiff, pdiff, scale; double bdiff, tdiff, pdiff, scale;
const int ns = new->linesize[0]; const int ns = new->linesize[0];
@ -123,7 +122,6 @@ static enum PhaseMode analyze_plane(AVFilterContext *ctx, PhaseContext *s,
const int h = new->height; const int h = new->height;
const int w = new->width; const int w = new->width;
int bdif, tdif, pdif; int bdif, tdif, pdif;
enum PhaseMode mode = s->mode;
uint8_t *end, *rend; uint8_t *end, *rend;
int top, t; int top, t;
@ -261,7 +259,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
} else { } else {
mode = analyze_plane(ctx, s, s->frame, in); mode = analyze_plane(ctx, s->mode, s->frame, in);
} }
for (plane = 0; plane < s->nb_planes; plane++) { for (plane = 0; plane < s->nb_planes; plane++) {