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
48 int max;48 int max;
49 int nb_planes;49 int nb_planes;
50 int nb_threads;50 int nb_threads;
51 int64_t pts;
52 AVFrame *prev;51 AVFrame *prev;
53 52
54 void (*interpolate)(struct ESTDIFContext *s, uint8_t *dst,53 void (*interpolate)(struct ESTDIFContext *s, uint8_t *dst,
@@ -433,7 +432,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, · 378 unmodified lines
433 return 0;432 return 0;
434}433}
435 434
436static int filter(AVFilterContext *ctx, AVFrame *in)435static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts)
437{436{
438 ESTDIFContext *s = ctx->priv;437 ESTDIFContext *s = ctx->priv;
439 AVFilterLink *outlink = ctx->outputs[0];438 AVFilterLink *outlink = ctx->outputs[0];
@@ -445,7 +444,7 @@ static int filter(AVFilterContext *ctx, AVFrame *in) · 5 unmodified lines
445 return AVERROR(ENOMEM);444 return AVERROR(ENOMEM);
446 av_frame_copy_props(out, in);445 av_frame_copy_props(out, in);
447 out->interlaced_frame = 0;446 out->interlaced_frame = 0;
448 out->pts = s->pts;447 out->pts = pts;
449 448
450 td.out = out; td.in = in;449 td.out = out; td.in = in;
451 ff_filter_execute(ctx, deinterlace_slice, &td, NULL,450 ff_filter_execute(ctx, deinterlace_slice, &td, NULL,
@@ -509,16 +508,14 @@ static int config_input(AVFilterLink *inlink) · 57 unmodified lines
509 return ret;508 return ret;
510 }509 }
511 510
512 s->pts = s->prev->pts * 2;511 ret = filter(ctx, s->prev, s->prev->pts * 2);
513 ret = filter(ctx, s->prev);
514 if (ret < 0 || s->mode == 0) {512 if (ret < 0 || s->mode == 0) {
515 av_frame_free(&s->prev);513 av_frame_free(&s->prev);
516 s->prev = in;514 s->prev = in;
517 return ret;515 return ret;
518 }516 }
519 517
520 s->pts = s->prev->pts + in->pts;518 ret = filter(ctx, s->prev, s->prev->pts + in->pts);
521 ret = filter(ctx, s->prev);
522 av_frame_free(&s->prev);519 av_frame_free(&s->prev);
523 s->prev = in;520 s->prev = in;
524 return ret;521 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