From patchwork Thu Sep 7 07:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5023 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1614067jao; Thu, 7 Sep 2017 00:43:17 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7092SN9MCOgNzI3HPujJKBCwyKpFdLrmKmdwZd2cBp7uYnM1138hDphgHTxCGNhiEAT/IR X-Received: by 10.28.230.198 with SMTP id e67mr1542787wmi.8.1504770197166; Thu, 07 Sep 2017 00:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504770197; cv=none; d=google.com; s=arc-20160816; b=gjSMqaXWmcXqG8e72L075Pbt+9w2SA4fzZ5qGeMOn+lK9iIgCX9hbHo63vrJ2WSwrG lh+lLudmpi9PsP8aJLizyeIY6SOAjd8Rbo4zzACk59Bsl1j3LkbnUIdmxLp0OcToAbgo 6nfntEbnmbMLWVV5R80y0ndOx9qUUNw5flYryeJXEuAkpsKMQUSC5gWX9evAuHjGmdFF gpOJEacMNRdLFBiMCXHXaAGDsZNJ0XjWS9NnKJBICUBUM+ib1XNwQdt9kquInevKn361 mNhVkpiCiFJYkc1Qi5pgo+GdKRZFPdTMkPx6B2D8fWlwEyW4IR/1f4bBQw4Nf3vLNKJk Laqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=5KcOGl9wimOKSa88LdJceMMjVYLX7A5fEK+ukoc5OtU=; b=N2CdYKpc8dufciZWGQg3bvK2ehmM3pTpGAiWkdOjQLhkxYeOBF7e7ae+kWHMSwxcfo INrAuYbDCrkuuVuaBJR3UAqzJkiv43kA6GVWdrhslea0b21k3cn3BjsyNleghc7ZZzxF i3xGuSF/7Ad7ZpdSZbOyZBHO4lJd7oXS4NR8VjFRP5MSEKNHX+xIyEKGAeyaZ7nnN10M GftpgschSFhC1CTsD/WfObv8ZWFIEn1LWTOtghcwHRVBon3VqyBLiHgnXmPXDdbL7S5l iO7sXhUaWjbUKeMJDwJ9OuIlh4o9udEkrIWhnQhNQijgAgwssBxaiole27/qErTvPUui PrZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j4si1605990wra.255.2017.09.07.00.43.16; Thu, 07 Sep 2017 00:43:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E6A4689721; Thu, 7 Sep 2017 10:42:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1BBC688366 for ; Thu, 7 Sep 2017 10:42:26 +0300 (EEST) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v877gUTc051245 for ; Thu, 7 Sep 2017 09:42:30 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 0976BE00AB; Thu, 7 Sep 2017 09:42:30 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 09:42:23 +0200 Message-Id: <20170907074226.7273-5-george@nsup.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170907074226.7273-1-george@nsup.org> References: <20170907074226.7273-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 07 Sep 2017 09:42:30 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 5/8] lavfi/vf_zoompan: make some function arguments simple. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The modified value is never used after the function call. Signed-off-by: Nicolas George --- libavfilter/vf_zoompan.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c index b1ade33b1f..e0a5a8eb64 100644 --- a/libavfilter/vf_zoompan.c +++ b/libavfilter/vf_zoompan.c @@ -149,7 +149,7 @@ static int config_output(AVFilterLink *outlink) } static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_values, int i, - double *zoom, double *dx, double *dy) + double zoom, double dx, double dy) { ZPContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -167,23 +167,23 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va var_values[VAR_FRAME] = i; var_values[VAR_ON] = outlink->frame_count_in + 1; - *zoom = av_expr_eval(s->zoom_expr, var_values, NULL); + zoom = av_expr_eval(s->zoom_expr, var_values, NULL); - *zoom = av_clipd(*zoom, 1, 10); - var_values[VAR_ZOOM] = *zoom; - w = in->width * (1.0 / *zoom); - h = in->height * (1.0 / *zoom); + zoom = av_clipd(zoom, 1, 10); + var_values[VAR_ZOOM] = zoom; + w = in->width * (1.0 / zoom); + h = in->height * (1.0 / zoom); - *dx = av_expr_eval(s->x_expr, var_values, NULL); + dx = av_expr_eval(s->x_expr, var_values, NULL); - x = *dx = av_clipd(*dx, 0, FFMAX(in->width - w, 0)); - var_values[VAR_X] = *dx; + x = dx = av_clipd(dx, 0, FFMAX(in->width - w, 0)); + var_values[VAR_X] = dx; x &= ~((1 << s->desc->log2_chroma_w) - 1); - *dy = av_expr_eval(s->y_expr, var_values, NULL); + dy = av_expr_eval(s->y_expr, var_values, NULL); - y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0)); - var_values[VAR_Y] = *dy; + y = dy = av_clipd(dy, 0, FFMAX(in->height - h, 0)); + var_values[VAR_Y] = dy; y &= ~((1 << s->desc->log2_chroma_h) - 1); out = ff_get_video_buffer(outlink, outlink->w, outlink->h); @@ -229,12 +229,12 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va s->current_frame++; if (s->current_frame >= s->nb_frames) { - if (*dx != -1) - s->x = *dx; - if (*dy != -1) - s->y = *dy; - if (*zoom != -1) - s->prev_zoom = *zoom; + if (dx != -1) + s->x = dx; + if (dy != -1) + s->y = dy; + if (zoom != -1) + s->prev_zoom = zoom; s->prev_nb_frames = s->nb_frames; s->nb_frames = 0; s->current_frame = 0; @@ -287,9 +287,8 @@ static int activate(AVFilterContext *ctx) s->var_values[VAR_DURATION] = s->nb_frames = nb_frames; } if (s->in) { - double zoom = -1, dx = -1, dy = -1; ret = output_single_frame(ctx, s->in, s->var_values, s->current_frame, - &zoom, &dx, &dy); + -1, -1, -1); return ret; } FF_FILTER_FORWARD_STATUS(inlink, outlink);