From: Michael Niedermayer Date: Thu, 16 May 2013 08:14:00 +0000 (+0200) Subject: Merge commit 'ba09675f44612fad9f7169f71b8276beb50a0dcd' X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a134f9676e4f7988d360b69e0aed176055c47bcb;p=ffmpeg Merge commit 'ba09675f44612fad9f7169f71b8276beb50a0dcd' * commit 'ba09675f44612fad9f7169f71b8276beb50a0dcd': vf_delogo: use the name 's' for the pointer to the private context vf_cropdetect: use the name 's' for the pointer to the private context vf_crop: cosmetics, break lines Conflicts: libavfilter/vf_delogo.c Merged-by: Michael Niedermayer --- a134f9676e4f7988d360b69e0aed176055c47bcb diff --cc libavfilter/vf_crop.c index 829d0bb4224,bf9e85f424e..4edb7cfb058 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@@ -176,18 -165,22 +176,22 @@@ static int config_input(AVFilterLink *l s->hsub = pix_desc->log2_chroma_w; s->vsub = pix_desc->log2_chroma_h; - if ((ret = av_expr_parse_and_eval(&res, (expr = s->ow_expr), + if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr), var_names, s->var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + goto fail_expr; s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res; - if ((ret = av_expr_parse_and_eval(&res, (expr = s->oh_expr), + if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr), var_names, s->var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + goto fail_expr; s->var_values[VAR_OUT_H] = s->var_values[VAR_OH] = res; /* evaluate again ow as it may depend on oh */ - if ((ret = av_expr_parse_and_eval(&res, (expr = s->ow_expr), + if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr), var_names, s->var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + goto fail_expr; + s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res; if (normalize_double(&s->w, s->var_values[VAR_OUT_W]) < 0 || normalize_double(&s->h, s->var_values[VAR_OUT_H]) < 0) { diff --cc libavfilter/vf_delogo.c index 7acb01d8949,4c917baee79..4bf0867bd9a --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@@ -182,18 -187,16 +182,18 @@@ static av_cold int init(AVFilterContex CHECK_UNSET_OPT(w); CHECK_UNSET_OPT(h); - if (delogo->band < 0 || delogo->show) { - delogo->show = 1; - delogo->band = 4; - if (s->show) ++ if (s->band < 0 || s->show) { ++ s->show = 1; + s->band = 4; + } - av_log(ctx, AV_LOG_DEBUG, "x:%d y:%d, w:%d h:%d band:%d show:%d\n", + av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d, w:%d h:%d band:%d show:%d\n", - delogo->x, delogo->y, delogo->w, delogo->h, delogo->band, delogo->show); + s->x, s->y, s->w, s->h, s->band, s->show); - delogo->w += delogo->band*2; - delogo->h += delogo->band*2; - delogo->x -= delogo->band; - delogo->y -= delogo->band; + s->w += s->band*2; + s->h += s->band*2; + s->x -= s->band; + s->y -= s->band; return 0; } @@@ -228,13 -233,11 +228,13 @@@ static int filter_frame(AVFilterLink *i apply_delogo(out->data[plane], out->linesize[plane], in ->data[plane], in ->linesize[plane], - inlink->w>>hsub, inlink->h>>vsub, + FF_CEIL_RSHIFT(inlink->w, hsub), + FF_CEIL_RSHIFT(inlink->h, vsub), - delogo->x>>hsub, delogo->y>>vsub, - FF_CEIL_RSHIFT(delogo->w, hsub), - FF_CEIL_RSHIFT(delogo->h, vsub), - delogo->band>>FFMIN(hsub, vsub), - delogo->show, direct); + s->x>>hsub, s->y>>vsub, - s->w>>hsub, s->h>>vsub, ++ FF_CEIL_RSHIFT(s->w, hsub), ++ FF_CEIL_RSHIFT(s->h, vsub), + s->band>>FFMIN(hsub, vsub), + s->show, direct); } if (!direct)