From patchwork Sun Sep 8 22:44:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51444 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1422931vqu; Sun, 8 Sep 2024 22:14:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUSe39YJbNqM7EeB8fXp5XeGs8FzFyYeYEfLt+wDoSYwYkGx6SOLxEh4wusUkGr/2Tz8nYaO/NctJlsXGsl4Hz1@gmail.com X-Google-Smtp-Source: AGHT+IFVYFzETsvX/2WPJSjd5Tg762686iT4z69xwTv1Ii7Oqz73FK+Xo5Qj3hFaGlrUuDVlDlwG X-Received: by 2002:a2e:bc0a:0:b0:2ee:5ed4:792f with SMTP id 38308e7fff4ca-2f751eb32bcmr58396471fa.2.1725858857005; Sun, 08 Sep 2024 22:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725858856; cv=none; d=google.com; s=arc-20240605; b=L/Z9KcT8/SG9UZsxuCIu/l4w3sDcPi200d+iXMEWWPJF8xdZawyR/N3tH4WQhyXMUQ 1JzyPdK+lDkuiB2lMELiLNigit2WM9jzBptvxKYWgxXu9A58Fz/HgCo6s5YLxaaoB6s/ 09NZ9zoavgTua7A3FBnQvU2k4dCYRGR5sedTj+tjKqOHy+SRcks1GmOK0Pib9xDJ+sk0 4IvPzjWDS5zBkrPZzt10kGWswmnU6cT2PfM6YCsSuuUawLQZCniq3FDICIMxC5BVyVSI KQY6mtJd5WswBEc+AQX627AYB8gOA35ODiTN5bdA+kX6Abo5oMVpNsrqi0o5XngWWQpH 2LYQ== 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=l7pe3YGRQJsni6tQ1FMKDvA1hkJz0z366NepeehT2lY=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=fUruPXSBcDSK0o4RyRwxcb4CTT4vA9ftze0Cr/66K34UQmzGvqLHKD5VxhxMF1lamq Z+p+sgf2/HbvQZp8+PkQJ/PmO3GTcM6PFhVWr7aMZAy6Zk6H5sIrmFfFzNoLeu2A7dV0 3wVAC6VvseOH4m5vepGc41Y1wd1hQOwFdfnuVGgDSD7MBefiZqPR+fmXa284hA7lWvp8 W9bqVztXpe2zYN2zgOIyfaYrAagmMDriEzM+JL6XKJqjCw2LlpTCsUfTwAUVIak3qhdI hbYdmuTxGZhh/j+NJkKxaG0ABaV+xwPXgA23WXVWD36uBEszas5KLpzH280ekDYNggsc sQRQ==; 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=P1JDafVK; 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-5c3ebdb737dsi3199387a12.667.2024.09.08.22.14.16; Sun, 08 Sep 2024 22:14:16 -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=P1JDafVK; 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 134A368DDAF; Mon, 9 Sep 2024 03:55:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6BF7968DC9C for ; Mon, 9 Sep 2024 03:55:36 +0300 (EEST) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-371ba7e46easo2452560f8f.0 for ; Sun, 08 Sep 2024 17:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843335; x=1726448135; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=U/4ee7cZzll0ENhzPrhHSVCYBXy9kT0T2Bza1vr1z4M=; b=P1JDafVKbFxPMKpVirlqqgBHl71aqiHTCib7RjtmwgEdTn0hPnCmhHEtEABX4u0wYL 3dyCoiZQuR8xQpllUAdc1mPaAM+1DV6DBn8YdFMpHjLbYuHOe0SqIzvqUy8taA2Q8nBr fFmiKSQT96RMC0/hz+rbJgbuUwtOTgL1RiYjtlZnsjPvrOclpmH0dis8Kh09DUFHltcO gF+ljxTczyFf66YiloZYmyLE+iEL+4Tm0cUhs4QPnuzGSvGUEjAAHhDtTzx/kvuTP/V2 j1FpVIZTUjmoe0ePSaE9tuzOlIXIxuhnlgzMm+eaNAaVOC52dfbCDVgnesOqZ+KEZHou pwxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843335; x=1726448135; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=U/4ee7cZzll0ENhzPrhHSVCYBXy9kT0T2Bza1vr1z4M=; b=S7DEaiNP5SLX4nNLAGNdzWj/RizWfR2v4S+kCVIXcWnBJqneCXc9z+RZNtd5bJ/spX OMjXItIIHGYR1DR4gagdm1sOGJW57byqvbyVaVm0vgauoxTeCljJT9tGRM5EnU0SYBG/ hUNU2ixFOTP+iaUbzS+41gWHwsxGmEAjkzFs2JNKDnhQSfQsoSTPxNIIkOnxOWguEAGt TpQX0qxHtKASvp1GaGEfE0PnEja1YlSRxr2RgBZIwpexZDLnPLoV9GucPgrFrbvCJ6xy GNzh82dZp4lwbMnwhbXnt5gy57oVz3YhpXUbk4JECxcefULqXO8g1h1ojBX9jDda/o3A TSbg== X-Gm-Message-State: AOJu0Yy0f6Y2X/mKdxp8Sw34k74XxgFKMyis/4OAQCiysn9eX8CkU2Ik ejNS+oWOCnBVWD2It0cqLbWGbaiOPTBZtJd3T2CLeC4WGrGRaTBNmRV8mA== X-Received: by 2002:a5d:6184:0:b0:368:64e:a7dd with SMTP id ffacd0b85a97d-378896a5c88mr5927308f8f.53.1725843335660; Sun, 08 Sep 2024 17:55:35 -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.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:35 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Mon, 9 Sep 2024 00:44:25 +0200 Subject: [FFmpeg-devel] [PATCH 37/60] avcodec/elbg: 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: 6LMzGw8mFEgU --- libavcodec/elbg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c index 84043af4fd..22219f9a6f 100644 --- a/libavcodec/elbg.c +++ b/libavcodec/elbg.c @@ -158,7 +158,7 @@ static int simple_lbg(ELBGContext *elbg, int *points, cell *cells) { - int i, idx; + int i; int numpoints[2] = {0,0}; int *newcentroid[2] = { elbg->scratchbuf + 3*dim, @@ -172,7 +172,7 @@ static int simple_lbg(ELBGContext *elbg, newutility[1] = 0; for (tempcell = cells; tempcell; tempcell=tempcell->next) { - idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>= + int idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>= distance_limited(centroid[1], points + tempcell->index*dim, dim, INT_MAX); numpoints[idx]++; for (i=0; isize_part; - int i, j, steps = 0; + int j, steps = 0; int best_idx = 0; int last_error; @@ -384,7 +384,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, /* This loop evaluate the actual Voronoi partition. It is the most costly part of the algorithm. */ - for (i=0; i < numpoints; i++) { + for (int i = 0; i < numpoints; i++) { int best_dist = distance_limited(elbg->points + i * elbg->dim, elbg->codebook + best_idx * elbg->dim, elbg->dim, INT_MAX); @@ -413,7 +413,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, memset(elbg->codebook, 0, elbg->num_cb * elbg->dim * sizeof(*elbg->codebook)); - for (i=0; i < numpoints; i++) { + for (int i = 0; i < numpoints; i++) { size_part[elbg->nearest_cb[i]]++; for (j=0; j < elbg->dim; j++) elbg->codebook[elbg->nearest_cb[i]*elbg->dim + j] +=