@@ -211,16 +211,15 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
uint8_t *cur = &s->cur ->data[td->plane][y * refs];
uint8_t *next = &s->next->data[td->plane][y * refs];
uint8_t *dst = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]];
+ int prefs = y + 1 < td->h ? refs : -refs;
+ int mrefs = y ? -refs : refs;
+ int parity = td->parity ^ td->tff;
int mode = y == 1 || y + 2 == td->h ? 2 : s->mode;
s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,
next + pix_3, td->w - edge,
- y + 1 < td->h ? refs : -refs,
- y ? -refs : refs,
- td->parity ^ td->tff, mode);
+ prefs, mrefs, parity, mode);
s->filter_edges(dst, prev, cur, next, td->w,
- y + 1 < td->h ? refs : -refs,
- y ? -refs : refs,
- td->parity ^ td->tff, mode, s->req_align);
+ prefs, mrefs, parity, mode, s->req_align);
} else {
memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]],
&s->cur->data[td->plane][y * refs], td->w * df);
@@ -67,8 +67,7 @@ typedef struct YADIFContext {
* Required alignment for filter_line
*/
int req_align;
- void (*filter_line)(void *dst,
- void *prev, void *cur, void *next,
+ void (*filter_line)(void *dst, void *prev, void *cur, void *next,
int w, int prefs, int mrefs, int parity, int mode);
void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
int w, int prefs, int mrefs, int parity, int mode,
Reformat some of the code to improve readability and reduce code duplication. This change is intended to be purely cosmentic and shouldn't result in any functional changes. Signed-off-by: Chris Phlipot <cphlipot0@gmail.com> --- libavfilter/vf_yadif.c | 11 +++++------ libavfilter/yadif.h | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-)