History

lavfi/vf_estdif: drop a redundant context variable

It is only used in filter() and always set immediately before filter() is called, so it can be passed as a parameter instead.

Anton Khirnov committed 4 years ago

Commit 62bfcc31 parent 2feeb6d1 file · +4 −7Browse files

Unified · Split

libavfilter/vf_estdif.c+4−7
@@ -48,7 +48,6 @@ typedef struct ESTDIFContext { · 47 unmodified lines
4848 int max;
4949 int nb_planes;
5050 int nb_threads;
51− int64_t pts;
5251 AVFrame *prev;
5352
5453 void (*interpolate)(struct ESTDIFContext *s, uint8_t *dst,
@@ -433,7 +432,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, · 378 unmodified lines
433432 return 0;
434433 }
435434
436−static int filter(AVFilterContext *ctx, AVFrame *in)
435+static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts)
437436 {
438437 ESTDIFContext *s = ctx->priv;
439438 AVFilterLink *outlink = ctx->outputs[0];
@@ -445,7 +444,7 @@ static int filter(AVFilterContext *ctx, AVFrame *in) · 5 unmodified lines
445444 return AVERROR(ENOMEM);
446445 av_frame_copy_props(out, in);
447446 out->interlaced_frame = 0;
448− out->pts = s->pts;
447+ out->pts = pts;
449448
450449 td.out = out; td.in = in;
451450 ff_filter_execute(ctx, deinterlace_slice, &td, NULL,
@@ -509,16 +508,14 @@ static int config_input(AVFilterLink *inlink) · 57 unmodified lines
509508 return ret;
510509 }
511510
512− s->pts = s->prev->pts * 2;
513− ret = filter(ctx, s->prev);
511+ ret = filter(ctx, s->prev, s->prev->pts * 2);
514512 if (ret < 0 || s->mode == 0) {
515513 av_frame_free(&s->prev);
516514 s->prev = in;
517515 return ret;
518516 }
519517
520− s->pts = s->prev->pts + in->pts;
521− ret = filter(ctx, s->prev);
518+ ret = filter(ctx, s->prev, s->prev->pts + in->pts);
522519 av_frame_free(&s->prev);
523520 s->prev = in;
524521 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t