From patchwork Sun Sep 8 17:54:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51404 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1356623vqu; Sun, 8 Sep 2024 17:55:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVfe1+naC3bx9DYfZY9qq6cUp5zHcjBQUfuDQuiyhMwO5Syknl/JiTQANDRODYLA/77GyFbqVMNfKv4kxpuwAga@gmail.com X-Google-Smtp-Source: AGHT+IGVDeRmHYJM8ozpXUg2WYvIXae1530ExT83ZNRpJ/HBPtnwS9wDUlxnjfUKwK0/BMV53Xuf X-Received: by 2002:a05:651c:541:b0:2f7:5c23:98fb with SMTP id 38308e7fff4ca-2f75c239929mr13524031fa.10.1725843358187; Sun, 08 Sep 2024 17:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725843358; cv=none; d=google.com; s=arc-20240605; b=WDuGi36PgqRhuPuA5oREjqUBIynH51HJPf3fPTeimn+mjzC3/VUEhp6+3rzgam5v5a zOX6x5Xet+w68quAk3q1IY42CkZFg6SH+HqRfYwQTQvTUj5lCeFhPq/RF4B7qKIk2Ph1 SglH7tMU2uGiLX8syK9WMoCsnQAc6nr11eD1e7Gq5PSfhafnWIFyVGESyDOCdT4/KmCC ZGhXwhkvd5T5O0r5H6bheD56k3cNYnHDnYCTr2T0jguRPjkibNI81h9aqmjBnyys19J7 3RN8IFBoTBo3sO0Z3zINbfTQDZdgqwCwpdcoyAM+3hjA+3DCxjq3R9EdWqKlXGKXpznx Ue5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:date:from:to:message-id:in-reply-to :dkim-signature:delivered-to; bh=p3XU0inhxIfwxQ2MVBFv3vkhBer/np3t2cXeInt1kvs=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=IdMPQa1XwQ+el07FqlvfrK7bXcc2Od2MhNQBqjld8f423PeiEVljNTA1lZ4w0uC4Xz SDT2WknTGDoYIO9X1QryVkyoM0T+UiSjdR75ycHxT0HnA3nyDdjofGsx28G/bz8lk9PB k+dQvndDE9d7vT+FW28SuGxLjBmzfFvIbiKoR+Oaq01q33KiatuTAYVD1uhHsFaxvJjs vUG7qjCXY31SYdi0prZV5dsxtkL/sjfJZWmFAsr3JIwKkj1nyDQvyh5e1WRvk0ngK27U wZ4b/InZfsgknd2ZwqAT5hBacAPxsrUeEjlawKUHpxqSs3LtNBhljWoGBiRhfzzW2s8U vb5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=DJbBB3xh; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c3ebdab800si2753019a12.581.2024.09.08.17.55.57; Sun, 08 Sep 2024 17:55:58 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=DJbBB3xh; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3344B68DA58; Mon, 9 Sep 2024 03:55:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 051BA68DA3F for ; Mon, 9 Sep 2024 03:55:06 +0300 (EEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42cb6f3a5bcso5847655e9.2 for ; Sun, 08 Sep 2024 17:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843305; x=1726448105; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=oot+dOhMwATpzhWEvgHb6Cux3zX5uv4TBhEyrEZ960k=; b=DJbBB3xhvl7tPMUbOdxz3KL/j70k6ZlvWZ7zqfwnt8sjsb53gVC48mylMfaRZBcusy EHhVjLOn6J80CX2Z7ToPUImmNUh2pxjL23R3ZtVBRvqClJW7BjMOpfCH/+33CAaa/1JZ Gs58Nzi/uOBHG9MQtlnEP/FK4eq9nTa58pW6LPhzz6rvdUE7r+FLFjZJZLek/AEg67RU 6HFINfjFiV/HuxrO4mz/xyiwn7Fa+lCzPaWC4/yFbNTEVaz7I09uCLvZnscobNdxg+E1 4zPeZXUv1K/bqDwvS/aAohTRqLIEY30tcFtZhqPWKrl4L4nxeq+E461TUBhyOLaMuB51 tNlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843305; x=1726448105; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oot+dOhMwATpzhWEvgHb6Cux3zX5uv4TBhEyrEZ960k=; b=Ov33u4ZOXfo7HfHBQl933jczikjEGKoSRJXSFAiplhY+sEWhS2m6N4KZAyLL+mqwnL zy2fISdBV0ENKGOikRPnZ00k3Gq8JA8hEX+rGzvKzwwEs/I1ascqg69IPCpEeEpvkCQB yLWzPuaiyI5mIwaPCIpme0h3yhJs+1dqS6uJMU+3YwBD63zoL/F6JMAIrv3o4+uMGoc1 zc/n1sv04B5BuUFBKvDGo9mFCY2nV1Jo87CZb2vgEXgYJ6ox9UXeGo8Aj8wD26msam5q uxpYzWqM9Uc5YiWqkHHESGtraMZvuN3XNuPlw9U/GWsb7wiCkLu24RkWNhDs+JCWRSNa gDOw== X-Gm-Message-State: AOJu0YyVbOatnat0KSBDltPFjcxCn/5ek+57GVe6YLwxfJum1FpLD50u rzmXui9FWjpQIc3AeWxP4yY+jRJgB23KajRHRvjybEA99OmyIhP/EQKyBw== X-Received: by 2002:adf:a457:0:b0:374:c318:2190 with SMTP id ffacd0b85a97d-37892466d2emr4653308f8f.59.1725843305264; Sun, 08 Sep 2024 17:55:05 -0700 (PDT) Received: from localhost (p200300cccf1178009d94fda8472792f7.dip0.t-ipconnect.de. [2003:cc:cf11:7800:9d94:fda8:4727:92f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895649728sm4583399f8f.16.2024.09.08.17.55.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:04 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Sun, 8 Sep 2024 19:54:47 +0200 Subject: [FFmpeg-devel] [PATCH 05/60] lavfi/vf_ssim360: fix variable shadowing X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: HyHFW0ZyIZwj --- libavfilter/vf_ssim360.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c index 68bd7b4d78..42632bcd85 100644 --- a/libavfilter/vf_ssim360.c +++ b/libavfilter/vf_ssim360.c @@ -1132,7 +1132,7 @@ static int do_ssim360(FFFrameSync *fs) AVFrame *master, *ref; AVDictionary **metadata; double c[4], ssim360v = 0.0, ssim360p50 = 0.0; - int i, ret; + int ret; int need_frame_skip = s->nb_net_frames % (s->frame_skip_ratio + 1); HeatmapList* h_ptr = NULL; @@ -1153,7 +1153,7 @@ static int do_ssim360(FFFrameSync *fs) return ret; } - for (i = 0; i < s->nb_components; i++) { + for (int i = 0; i < s->nb_components; i++) { if (s->use_tape) { c[i] = ssim360_tape(master->data[i], s->main_tape_map[i][0], ref->data[i], s->ref_tape_map [i][0], @@ -1191,16 +1191,16 @@ static int do_ssim360(FFFrameSync *fs) // Record percentiles from histogram and attach metadata when using tape if (s->use_tape) { - int i, p, hist_indices[4]; + int hist_indices[4]; double hist_weight[4]; - for (i = 0; i < s->nb_components; i++) { + for (int i = 0; i < s->nb_components; i++) { hist_indices[i] = SSIM360_HIST_SIZE - 1; hist_weight[i] = 0; } - for (p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) { - for (i = 0; i < s->nb_components; i++) { + for (int p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) { + for (int i = 0; i < s->nb_components; i++) { double target_weight, ssim360p; // Target weight = total number of samples above the specified percentile @@ -1218,12 +1218,12 @@ static int do_ssim360(FFFrameSync *fs) } } - for (i = 0; i < s->nb_components; i++) { + for (int i = 0; i < s->nb_components; i++) { memset(s->ssim360_hist[i], 0, SSIM360_HIST_SIZE * sizeof(double)); s->ssim360_hist_net[i] = 0; } - for (i = 0; i < s->nb_components; i++) { + for (int i = 0; i < s->nb_components; i++) { int cidx = s->is_rgb ? s->rgba_map[i] : i; set_meta(metadata, "lavfi.ssim360.", s->comps[i], c[cidx]); } @@ -1235,7 +1235,7 @@ static int do_ssim360(FFFrameSync *fs) if (s->stats_file) { fprintf(s->stats_file, "n:%"PRId64" ", s->nb_ssim_frames); - for (i = 0; i < s->nb_components; i++) { + for (int i = 0; i < s->nb_components; i++) { int cidx = s->is_rgb ? s->rgba_map[i] : i; fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]); }