From patchwork Sat May 18 15:24:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48977 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3502486pzb; Sat, 18 May 2024 08:24:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXsx7mvO0Xq2xvM/7TFusOKb0j8GUg6J+TB955QG5felEkO6F0ZsFFF9hWglIzJdQIsSlCQBGWbvMMBTXqMHgo3lqBDzGLFRzs2w== X-Google-Smtp-Source: AGHT+IGTvhdMT8OGpDKN18VtIJUse3arS3l9TPNhslTZOC85SzpmmWxy12CHOzdJlFUjoq32qSyl X-Received: by 2002:a50:8a84:0:b0:572:d1e1:b4b3 with SMTP id 4fb4d7f45d1cf-5734d59d528mr18456337a12.7.1716045867212; Sat, 18 May 2024 08:24:27 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-574d3fc5d3bsi6502004a12.226.2024.05.18.08.24.26; Sat, 18 May 2024 08:24:27 -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=@outlook.com header.s=selector1 header.b=GKAz0jh2; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63F5868BF8B; Sat, 18 May 2024 18:24:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2059.outbound.protection.outlook.com [40.92.90.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 95E3C68BF8B for ; Sat, 18 May 2024 18:24:16 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJW7Q3yKuONVHOhmRtwsyGKpP7CsseB0OBLNeuALiiqPr4LGlUI859BG8U6xjDiwHpz5Bdu1l5sD94oyRosDMSgYP1C+H68CkjGWCltuQVbDd45f72SlftxOafq0fcfACUgQt+nEHanTLq1yrJ2FzVjxQwUBw7nhAswuuz3Z177flxEpwHsii7wlta7xHziD9cmJmege1cDwcCpEDXsvwRhNSlTZXxvUriuNHcFV8xOxj3cP8F9Ves1NqJbku554L8rF/y+ej/H6DojW7ScfLu/FmB+pLpio7Mx4Sgq9AEQtf0KI1gbcYt43udKmHUGYFF9uro0nFcIN3PTzrx4e/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VjmPNwCFkYB4yc8kn+GjQjxebQvH4VLh5g+eSpXpdLI=; b=NXwg9dwF+hpsljlpBBOM9hncK1UAjf5ycV7rMqYL6wxHD7w52AQZgfKkCzbJJRyNLzXLEDvZY7udENArnj8akeNkvokUYkAhzQNHjw/ftgJS4i8WodtKETsY3XYn9sVKi68hOuiCNBkNvLSEtr+LAVUbs5KacgWkykmTGb828FI6XrTE4fpwnGV0Q8s3byMH2aW+a4o1IipFuuGJB7BE/G4uZEiC+JUQP7G19lgVkQIQqu1rpiex371if3YrFdO3+T7dhF7pyPucl2F0z5DzyMHyANZjW5tv7vahdlue3UG9Gbudhxy3o+ipSwao3g+Og+EgpQPzb4BwthmfZol3Mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VjmPNwCFkYB4yc8kn+GjQjxebQvH4VLh5g+eSpXpdLI=; b=GKAz0jh2jvo8Ck55dTGQ1LGnKWMOY0Q6hyEszE8nYkKUGGjqPkPXnEa0o2vGs8pRa958Q49arkAlL2SpVMfVvaOtwjhfeWV9c8Aqz4l91Ze6XvUpkeGQQpD//1RA3XL16my8rBRn00GRDb7A2T2ZJFY3yzh9rSnlGCcvq28Y35yaCbJLGdhOwHDC4+iiqOSA4XmduW72yZRUZwEkJKuXTA0HiEmry5JfWFOMNAVuPV6yBLkFt3puUGpKe/s4Iu6i+MdfwmusTMWJSF4OM8JyzWs2kbRY5KGt4aWzEZ8HX2Ltn2ieNmlxUWRbmgI8NKMC7iAdjHlGEg6qfsysh8rsOw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0064.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:23b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.34; Sat, 18 May 2024 15:24:14 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9%4]) with mapi id 15.20.7544.052; Sat, 18 May 2024 15:24:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 May 2024 17:24:04 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [VuXrk+WLspmrjfYWy4FEpI9NtwguzPX1mciKoQsXmEU=] X-ClientProxiedBy: FR0P281CA0124.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240518152406.918954-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0064:EE_ X-MS-Office365-Filtering-Correlation-Id: 3337573e-ac0d-4e07-4f30-08dc774e9314 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: df0bD+bMxZHVYftwYwhrbAasC23wgqEvX9NuB2j1LLVzKGbwaWjRiah93QNaB0mdccEMfcy+dr/Jy84UYaGUyv3WzVU2pktilCYZ1liOA471fOMa+ky05V3f1Jq+kpsP/IeHVywrZUE6v8U16GLPhxRERHfRBA05YV2v3uBII23KnU5wsH9Ts/BWahR3K0YdkD51iyza+AcRI3Cn6YGCmY92IgcdMxwwYSI2k5vCY+RgT55CHC3ibL2HoRSjp10T24R6LxejmLhwsnnV7Q0XyYOpPoOmEFSZ1H6RSf09OqvoNoLVTgbeWZ72ffqtquFnLQIW1y9Z9P67gZumNHa7H63TVpuEZT6AOD6OTNa4/iQOuKrHcetGrNI9z7VUliIoWXJbzCaFsEdRP5Ief+J/tda4esklCuQs0wM3e9HuU/+vMiOdEI1Z1rdfyPZ99Up0QPaz2RVOUxbJYDfLmA02U6BMozoslv7lGNJ6XbZIfvHqicVCMgKLIuSox3L7zmiCSsswwKRNMQFcILWh74AJW4Y2uPxdHuBMmkNYR7J5X6nbNwIYGuOA41Yx4ptxetJrPtuvH+g71cvzzVFW3rHWpVdzc/BzdjcynkT6fvyMQwOCf/KtRv112f/fgwVfJj+E X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lbfp7Uv85Y03kg65ecEEjIAcky/uEJgytQMTFPxzKhbD9vbWMlhAsoBHNvCdUqu4DC0n+eMXOeZLqqU8Np58DIL6ixB+comnuQ2T/RgTYmEEBggE1D73+KDhzZHcXABNJnh1Io1LkM3Pg0UgvfIePP+nTRL3DduWNEUDFU3U/2KUbjyvj9q+Pna324Bpt9OAL+CQRsW2SUJV6hZ8K8+bbAEF8IoXK25K0QNxffOWcP03WgSmipbr2nJsNLF455eq/9QwxBW0qLxYMO5nueG0YUPLiAJjmMNSRnVG9ctuWZRqirWzmsXoRQIBriJTsbhJVnMjGC8PMhrdJo6RQG3bV0x09c+Ygk879j95nzqPgEUJLN4pdapxlOhSIDtGlmC3KHbgd3D4DtW7MNZ+9y6CDIqcllH1MK9URWkptZeEY9PIZT5IT2eW8X/08F9sWtaSUa22p4XMHjCRp0Jvd3v42EK7ZNR7ArLzK3k2u/egyW4Z6dNd18KkbZ0riU4XBlrQiv2WOSPgL11bJpiiEtsdizw6qZx5yXa346HTARTtiVpzCnZYkSRxJYrZ9B7npvbwNUP0dh0EJD8BovK54eJehb7odTR9LYpGItTuPYnN2fIK3Le5rLrte40mjVIxXTcZmIphfXIytQknmzXyuWjH5nRDky2xvFcTgGeT+z3QKvrEtYvUB4QoS43bPBvXahX86Nnmp3JtJ6GtKaG2Yn0RWhnG/qkmzjeSxPrIA3fCMAXovjd5EmZvSz+83V4CDDQ9r6k3SW8JxC0CHUIci/we7dhXsPL8KlkRfPG2I+fPwkZEVPkTsBHv79Hln6OdeyrQOpbgJleMCbuahBjO11AOqRjhmUFJAGkiPgix6GKq6Z2aMHW54sjJ0wFJ8Isr8U92D8F2wcMHKlnSM8QGOAvM69Yy8qXfkMSm0CVrWlOpp7T5E/bRgm6pA0sx9coqlb3OrWDz9SKqeWzt0yE9dMHPzeyof75Yp3FQCBfP8QVR1ulgsclHbZ8GfX4OqacEwWSEY0H0oMByw0JP/OZX0rf5oIKTnPGSnFsfw5Ek2YfD2WlgVge37e0GskHX8PSNg4nubebtbLwd57lIBKnwb2L5ivZBv9EP+TyMZ6HbMWXlWtRWr96bjP6oMKbWGoNBOzbmcMogJI8QK0Wi4TYqOvhJ/635ijg9r8WrdEEG/jWzVrJnNYxOqgvK/0hXjSyf2iK2ThDeGvq/IX2Kb/aGWywBVMbTAY6E4zl9eDfTKj6uA7izxaTDdcg0HeYzB8wIhm3RS5Cl+iKR2LgG5dFf8EV1gA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3337573e-ac0d-4e07-4f30-08dc774e9314 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2024 15:24:14.1923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0064 Subject: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_signalstats: Use av_dict_set_int() where appropriate 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ovS+WL1anjrC Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_signalstats.c | 80 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c index c2358c66cb..960899596f 100644 --- a/libavfilter/vf_signalstats.c +++ b/libavfilter/vf_signalstats.c @@ -720,40 +720,40 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in) av_dict_set(&out->metadata, "lavfi.signalstats." key, metabuf, 0); \ } while (0) - SET_META("YMIN", "%d", miny); - SET_META("YLOW", "%d", lowy); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0); SET_META("YAVG", "%g", 1.0 * toty / s->fs); - SET_META("YHIGH", "%d", highy); - SET_META("YMAX", "%d", maxy); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YHIGH", highy, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YMAX", maxy, 0); - SET_META("UMIN", "%d", minu); - SET_META("ULOW", "%d", lowu); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UMIN", minu, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.ULOW", lowu, 0); SET_META("UAVG", "%g", 1.0 * totu / s->cfs); - SET_META("UHIGH", "%d", highu); - SET_META("UMAX", "%d", maxu); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UHIGH", highu, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UMAX", maxu, 0); - SET_META("VMIN", "%d", minv); - SET_META("VLOW", "%d", lowv); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VMIN", minv, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VLOW", lowv, 0); SET_META("VAVG", "%g", 1.0 * totv / s->cfs); - SET_META("VHIGH", "%d", highv); - SET_META("VMAX", "%d", maxv); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VHIGH", highv, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VMAX", maxv, 0); - SET_META("SATMIN", "%d", minsat); - SET_META("SATLOW", "%d", lowsat); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMIN", minsat, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATLOW", lowsat, 0); SET_META("SATAVG", "%g", 1.0 * totsat / s->cfs); - SET_META("SATHIGH", "%d", highsat); - SET_META("SATMAX", "%d", maxsat); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATHIGH", highsat, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMAX", maxsat, 0); - SET_META("HUEMED", "%d", medhue); + av_dict_set_int(&out->metadata, "lavfi.signalstats.HUEMED", medhue, 0); SET_META("HUEAVG", "%g", 1.0 * tothue / s->cfs); SET_META("YDIF", "%g", 1.0 * dify / s->fs); SET_META("UDIF", "%g", 1.0 * difu / s->cfs); SET_META("VDIF", "%g", 1.0 * difv / s->cfs); - SET_META("YBITDEPTH", "%d", compute_bit_depth(masky)); - SET_META("UBITDEPTH", "%d", compute_bit_depth(masku)); - SET_META("VBITDEPTH", "%d", compute_bit_depth(maskv)); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YBITDEPTH", compute_bit_depth(masky), 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UBITDEPTH", compute_bit_depth(masku), 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VBITDEPTH", compute_bit_depth(maskv), 0); for (fil = 0; fil < FILT_NUMB; fil ++) { if (s->filters & 1<frame_prev); s->frame_prev = av_frame_clone(in); - SET_META("YMIN", "%d", miny); - SET_META("YLOW", "%d", lowy); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0); SET_META("YAVG", "%g", 1.0 * toty / s->fs); - SET_META("YHIGH", "%d", highy); - SET_META("YMAX", "%d", maxy); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YHIGH", highy, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YMAX", maxy, 0); - SET_META("UMIN", "%d", minu); - SET_META("ULOW", "%d", lowu); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UMIN", minu, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.ULOW", lowu, 0); SET_META("UAVG", "%g", 1.0 * totu / s->cfs); - SET_META("UHIGH", "%d", highu); - SET_META("UMAX", "%d", maxu); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UHIGH", highu, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UMAX", maxu, 0); - SET_META("VMIN", "%d", minv); - SET_META("VLOW", "%d", lowv); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VMIN", minv, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VLOW", lowv, 0); SET_META("VAVG", "%g", 1.0 * totv / s->cfs); - SET_META("VHIGH", "%d", highv); - SET_META("VMAX", "%d", maxv); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VHIGH", highv, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VMAX", maxv, 0); - SET_META("SATMIN", "%d", minsat); - SET_META("SATLOW", "%d", lowsat); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMIN", minsat, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATLOW", lowsat, 0); SET_META("SATAVG", "%g", 1.0 * totsat / s->cfs); - SET_META("SATHIGH", "%d", highsat); - SET_META("SATMAX", "%d", maxsat); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATHIGH", highsat, 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMAX", maxsat, 0); - SET_META("HUEMED", "%d", medhue); + av_dict_set_int(&out->metadata, "lavfi.signalstats.HUEMED", medhue, 0); SET_META("HUEAVG", "%g", 1.0 * tothue / s->cfs); SET_META("YDIF", "%g", 1.0 * dify / s->fs); SET_META("UDIF", "%g", 1.0 * difu / s->cfs); SET_META("VDIF", "%g", 1.0 * difv / s->cfs); - SET_META("YBITDEPTH", "%d", compute_bit_depth(masky)); - SET_META("UBITDEPTH", "%d", compute_bit_depth(masku)); - SET_META("VBITDEPTH", "%d", compute_bit_depth(maskv)); + av_dict_set_int(&out->metadata, "lavfi.signalstats.YBITDEPTH", compute_bit_depth(masky), 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.UBITDEPTH", compute_bit_depth(masku), 0); + av_dict_set_int(&out->metadata, "lavfi.signalstats.VBITDEPTH", compute_bit_depth(maskv), 0); for (fil = 0; fil < FILT_NUMB; fil ++) { if (s->filters & 1< X-Patchwork-Id: 48978 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3503091pzb; Sat, 18 May 2024 08:26:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUhJdQ/79llBCu9aQ7PG4P3VbgRogEIHCZOfJ1mamuN4pe4U09W4QkF6mA0duFS18bz/ENg6iDBRy722V8Z/n7KiwDP2D4G3l78tg== X-Google-Smtp-Source: AGHT+IGhj9BjG4Sso/WT5tbDYwMflbRmYwFcavyIDzXGKAxwi/j7/PpEMLYvKChb7TszVetrz2sB X-Received: by 2002:a05:6402:2550:b0:575:9a9:7b5e with SMTP id 4fb4d7f45d1cf-57509a97bb4mr6602131a12.0.1716045963471; Sat, 18 May 2024 08:26:03 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5733c36d77fsi10847288a12.543.2024.05.18.08.26.03; Sat, 18 May 2024 08:26:03 -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=@outlook.com header.s=selector1 header.b=utC9Hs9p; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BFED668CF01; Sat, 18 May 2024 18:26:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2109.outbound.protection.outlook.com [40.92.90.109]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D7F068C1BA for ; Sat, 18 May 2024 18:25:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PeOpET4BxL6Ye1TfJ/Zl8AD+Do/CTiW50r7LxQNdTt+H+B6QPbzKW18JOyB5ojcxbIUzSNreuuocFKbDbnvOxDnZe6eOMuL9ZI7Xq15Aik23qKDF1pW1u+8A1xlbZogkK3H+ENThAonPzFuUQrhgjbdXUmxIhBZRRhyXzQDh3qJak5QJmGpQxJ1wYH6yZoZonPMBNkpydcBo+iHoMIFT2EthRmB+DaRMRfg2b436d+qyHWzETBhoS4LJxblCq2u0BrzLAd83/DD63OpVzp2GFdyfiwgmZOuXnU62rWI5hsUM6oCIORR4Zdui0u4y6zqK7hmELRuNweHb4R4unLbI6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Unn3GXcA6Qc4lZV1l3SUbkbFjn6eaAoKrzEb7+0uYRY=; b=L4R/nXaqEDenjDltoWGKl8SFTVUzZv48RNh4t/HAywoufWmt6pY6sV/OFfzO/njJFlERS4yjqRiPoZYhNO2LEjNyDs9HGvnO+LO39J+PhidurxxaKKCpKbGS5UiTOPUiWdBZc90kJ+Yb5Zw0MMHXbl1FBVoMeSFHpDNsT5J5vHlMW7OhMu5RN/NRSVjimR0q/F/jojowzCF64vH2KU6Q6Ap+WNaN1HD+2rHvx+2tQpSoFwZKYnILEWdX43LJDgwFdfjM8lTifuDFQapCCsylwxR0CBoXOMmf1HuaFqooX4jPPTKK//+lXnP7fLi5qH2RsNzI46SSwLvhcFQzxf50JQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Unn3GXcA6Qc4lZV1l3SUbkbFjn6eaAoKrzEb7+0uYRY=; b=utC9Hs9pHaLBNIFLiG2giAtMAuLDtG4VajN93m6hSMkgGHx+vf9L9nFLVPy6ULgzJhy/XxQUyCWCqDE1q1hm+Ogva7uP1T4wS+mQ49cJt5thKEGutkovbTxk+mrO7iA3zpypzh9oFaHdELWKxeLYuDLA/7KeruP/UwrqPREJjVw2ascesb367MGCXW4Hp4l1PlQfQAhFc7zONwDdP7YRvtb5qI2e51k8Zk8X/eqkhyx7uJGvzDfv5P+v1aIPERTVMWJ1khElimycyCk6nw4q5E4LE5AA4byebs2gnbIPlpDzWWSLMe+EVHOWZMjtamTzWMZHIqJoCeljy21zfok/zg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0064.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:23b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.34; Sat, 18 May 2024 15:25:52 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9%4]) with mapi id 15.20.7544.052; Sat, 18 May 2024 15:25:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 May 2024 17:25:43 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [NZzMGct8ZdQPg9CUgljb143XqqktA5mTBM/soxR3ZOk=] X-ClientProxiedBy: ZR0P278CA0013.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::23) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240518152544.932561-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0064:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c82dd28-7cdc-4ccc-9eaf-08dc774ecdd8 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: wNK1Y8cYho9FyPWU3F+xYKAOtEDBgKLIDfdjs4KwvnPnXJtW9UaK5JOnGoA91JHpcs7zjOdQe1Y7A1kAGfOs4AbIGfFe3rT5meB/O2Uq44/48q4G7K/08BA8N+Ux7e293iAJQcvd419AvPmH6NxsaYC6U5BvZnTN/nOzgRYGvaIqb21wxIejmq9egJAflfL2sAoqUQymm0RNuWziIPvNpVuaekNzqihRSFXA29BIrYj/fLS+Rn19WIcLWCdWKDQXPbHeN2tZIWEmx/1kOmshhXVel8lygA5mBsoAg2yInq03gogvz/mciEws9AKnUhMvqnQ5reOMJiZSGCehHyqHlmT48pjOfwNKSWw0iSic/axwlIoOlUyfJ12HSMycZcpgesh5UedGipM+4UM4+KBMbbeeOCLVtFhERzJXuT38rHStK2D+Zbf33OccZ0zpGPiGRUP/5/yhH/pH1hFyFajV/dD3SVj6MbDMBbXVODWVY5Xwg7lX1yy+ZgsDW/kKZT2KmELNhLMnbImK/AsbUEGkQVlXMuwokyes7FxCugLbTFwhR9pkh4wWFt2rzm+AO0uuHZ3QpnKLEaDeSVBJp63m2ZW0SGXueShD6VZPzHycV6nqTxA0UX136OhAW11vvrAH X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9sHK53tqWZdLl/5HUQMCY+Mel5qEcrTXb5+/ijR/BEyZG/t0QejrrQ2PfWETrbcB4NvVzvDJzyZqptvLX8lOMJBc1OzWxfrbAEm7RyYbQZCZkKvbbXzsiilG9/9M3Rbr230ETN0S09GG3li0Jysa2mOnBZZtkeoWU0aMpsuPWMNTtc3Kdh+jvfb8DG/MZNseTzpkTaC7RG7XTocIGsmpc7UfmM/jhnqBbklHBF0rgtWztfKJIGHZRzsZ/+Y4kPY6oU3mqFj/jU3nrqCJqmJV4IK6s0DMF1WWYiBDPZFI+EoO+OJZMwDG9R4orstgUX6KkFbxCWKgYLQN/NO1qCrSifCUf/dyDUn+JVwk7tMMEwJf2CYVjeRsfaTPVVsratHc3ZzdpvxCcjwGP56HhNp5nXXA9b2Lk7qe/D3OOjbTdmtTDHA/xZ0RvmsFZkLl1cR7FQ/q5L74cjJHzMksLeMxRXMa8Is0fEWK0iau81cFWB/niILu8tFMOiA2zjV0pc76DtoIPmDj2SIxGDYDXnMyd+FWJz3WdZSuIJvWLG7MM9ogzEsGJGR183E1j/9lr2WzZ34Wk8G/tIwqAwvKvgbJWz0/rRrUn5AODK036K7XK/hY8NfmS4IKWAwMHkK1k72iRq2AppDBOk98oSOidBw//VCUyF4JTpEXuX/gBuLBsIWrNexVipryEIzaZx/INX8be5ittD2gcsfZunZelGFzeKviXiYkCudHD6zLSkdKjmySpOyq1oQHtp8MhnPXvaDV0w/D+E7ZXIORRwAU+URY4Cl4xVbq6kRCyN0JzYSYfH98Qxt+pL7YKXx5tw4HI1UzDE+x5zZfeRHwKAFhFB1aZ/ynJwE6ODvX6lia1tpuk9T2dj98I7xUkuUptb3zt6o70dFPhnBy9NHM9vVwp0xhSnqnbbI3rHWzPy8FX3bIWoTTWoHoQxq4gdVvZWIEKrxKB7SvESiLgdi3ZzSNfM4GpVXCHrDJqc6IqXjWQaY0xy2ALoT6fIMIFwKCHsgUXvcjrHn2bAk9Kw2JVjuVwAjULSDASIQxCyw44yzWllRapUyPFtxyfWI8l/JDR3bFyYo7fLyHrYqxIeJTJdnB5QEzVsOJ0kvSEy6kqoTnFkrw2isfZueWjoaNObSlMCzydBK8jRBuREM8JXJnT9TXWaoB83/QEUd0mKV7Fh9YEsV0Lf9bRyGzUmN4mC3Zko0/Km5qwjAf5p7Jfo1f4vE/oniRMYn9VcsSVe45gmX11H/JYyINu3aP4PMtL02tYMETQbtLzj/H89A4SBk2iHnIos4BVA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c82dd28-7cdc-4ccc-9eaf-08dc774ecdd8 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2024 15:25:52.6035 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0064 Subject: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: KgNug0mH539T Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_signalstats.c | 279 ++++++----------------------------- 1 file changed, 43 insertions(+), 236 deletions(-) diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c index 960899596f..1bdc6a42ba 100644 --- a/libavfilter/vf_signalstats.c +++ b/libavfilter/vf_signalstats.c @@ -538,7 +538,7 @@ static unsigned compute_bit_depth(uint16_t mask) return av_popcount(mask); } -static int filter_frame8(AVFilterLink *link, AVFrame *in) +static int filter_frame(AVFilterLink *link, AVFrame *in) { AVFilterContext *ctx = link->dst; SignalstatsContext *s = ctx->priv; @@ -563,20 +563,17 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in) int accy, accu, accv; int accsat, acchue = 0; int medhue, maxhue; - int toty = 0, totu = 0, totv = 0, totsat=0; - int tothue = 0; - int dify = 0, difu = 0, difv = 0; + int64_t toty = 0, totu = 0, totv = 0, totsat=0; + int64_t tothue = 0; + int64_t dify = 0, difu = 0, difv = 0; uint16_t masky = 0, masku = 0, maskv = 0; - int ret; + int filtot[FILT_NUMB] = {0}; AVFrame *prev; - + int ret; AVFrame *sat = s->frame_sat; AVFrame *hue = s->frame_hue; - const uint8_t *p_sat = sat->data[0]; - const uint8_t *p_hue = hue->data[0]; - const int lsz_sat = sat->linesize[0]; - const int lsz_hue = hue->linesize[0]; + const int hbd = s->depth > 8; ThreadDataHueSatMetrics td_huesat = { .src = in, .dst_sat = sat, @@ -602,38 +599,45 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in) } } - ff_filter_execute(ctx, compute_sat_hue_metrics8, &td_huesat, + ff_filter_execute(ctx, hbd ? compute_sat_hue_metrics16 + : compute_sat_hue_metrics8, &td_huesat, NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx))); - // Calculate luma histogram and difference with previous frame or field. memset(s->histy, 0, s->maxsize * sizeof(*s->histy)); + memset(s->histu, 0, s->maxsize * sizeof(*s->histu)); + memset(s->histv, 0, s->maxsize * sizeof(*s->histv)); + memset(s->histsat, 0, s->maxsize * sizeof(*s->histsat)); + + if (hbd) { + const uint16_t *p_sat = (uint16_t *)sat->data[0]; + const uint16_t *p_hue = (uint16_t *)hue->data[0]; + const int lsz_sat = sat->linesize[0] / 2; + const int lsz_hue = hue->linesize[0] / 2; + // Calculate luma histogram and difference with previous frame or field. for (j = 0; j < link->h; j++) { for (i = 0; i < link->w; i++) { - const int yuv = in->data[0][w + i]; + const int yuv = AV_RN16(in->data[0] + w + i * 2); masky |= yuv; histy[yuv]++; - dify += abs(yuv - prev->data[0][pw + i]); + dify += abs(yuv - (int)AV_RN16(prev->data[0] + pw + i * 2)); } w += in->linesize[0]; pw += prev->linesize[0]; } // Calculate chroma histogram and difference with previous frame or field. - memset(s->histu, 0, s->maxsize * sizeof(*s->histu)); - memset(s->histv, 0, s->maxsize * sizeof(*s->histv)); - memset(s->histsat, 0, s->maxsize * sizeof(*s->histsat)); for (j = 0; j < s->chromah; j++) { for (i = 0; i < s->chromaw; i++) { - const int yuvu = in->data[1][cw+i]; - const int yuvv = in->data[2][cw+i]; + const int yuvu = AV_RN16(in->data[1] + cw + i * 2); + const int yuvv = AV_RN16(in->data[2] + cw + i * 2); masku |= yuvu; maskv |= yuvv; histu[yuvu]++; - difu += abs(yuvu - prev->data[1][cpw+i]); + difu += abs(yuvu - (int)AV_RN16(prev->data[1] + cpw + i * 2)); histv[yuvv]++; - difv += abs(yuvv - prev->data[2][cpw+i]); + difv += abs(yuvv - (int)AV_RN16(prev->data[2] + cpw + i * 2)); histsat[p_sat[i]]++; histhue[((int16_t*)p_hue)[i]]++; @@ -643,228 +647,36 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in) p_sat += lsz_sat; p_hue += lsz_hue; } - - for (fil = 0; fil < FILT_NUMB; fil ++) { - if (s->filters & 1<outfilter == fil ? out : NULL, - }; - memset(s->jobs_rets, 0, s->nb_jobs * sizeof(*s->jobs_rets)); - ff_filter_execute(ctx, filters_def[fil].process8, - &td, s->jobs_rets, s->nb_jobs); - for (i = 0; i < s->nb_jobs; i++) - filtot[fil] += s->jobs_rets[i]; - } - } - - // find low / high based on histogram percentile - // these only need to be calculated once. - - lowp = lrint(s->fs * 10 / 100.); - highp = lrint(s->fs * 90 / 100.); - clowp = lrint(s->cfs * 10 / 100.); - chighp = lrint(s->cfs * 90 / 100.); - - accy = accu = accv = accsat = 0; - for (fil = 0; fil < s->maxsize; fil++) { - if (miny < 0 && histy[fil]) miny = fil; - if (minu < 0 && histu[fil]) minu = fil; - if (minv < 0 && histv[fil]) minv = fil; - if (minsat < 0 && histsat[fil]) minsat = fil; - - if (histy[fil]) maxy = fil; - if (histu[fil]) maxu = fil; - if (histv[fil]) maxv = fil; - if (histsat[fil]) maxsat = fil; - - toty += histy[fil] * fil; - totu += histu[fil] * fil; - totv += histv[fil] * fil; - totsat += histsat[fil] * fil; - - accy += histy[fil]; - accu += histu[fil]; - accv += histv[fil]; - accsat += histsat[fil]; - - if (lowy == -1 && accy >= lowp) lowy = fil; - if (lowu == -1 && accu >= clowp) lowu = fil; - if (lowv == -1 && accv >= clowp) lowv = fil; - if (lowsat == -1 && accsat >= clowp) lowsat = fil; - - if (highy == -1 && accy >= highp) highy = fil; - if (highu == -1 && accu >= chighp) highu = fil; - if (highv == -1 && accv >= chighp) highv = fil; - if (highsat == -1 && accsat >= chighp) highsat = fil; - } - - maxhue = histhue[0]; - medhue = -1; - for (fil = 0; fil < 360; fil++) { - tothue += histhue[fil] * fil; - acchue += histhue[fil]; - - if (medhue == -1 && acchue > s->cfs / 2) - medhue = fil; - if (histhue[fil] > maxhue) { - maxhue = histhue[fil]; - } - } - - av_frame_free(&s->frame_prev); - s->frame_prev = av_frame_clone(in); - -#define SET_META(key, fmt, val) do { \ - snprintf(metabuf, sizeof(metabuf), fmt, val); \ - av_dict_set(&out->metadata, "lavfi.signalstats." key, metabuf, 0); \ -} while (0) - - av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0); - SET_META("YAVG", "%g", 1.0 * toty / s->fs); - av_dict_set_int(&out->metadata, "lavfi.signalstats.YHIGH", highy, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.YMAX", maxy, 0); - - av_dict_set_int(&out->metadata, "lavfi.signalstats.UMIN", minu, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.ULOW", lowu, 0); - SET_META("UAVG", "%g", 1.0 * totu / s->cfs); - av_dict_set_int(&out->metadata, "lavfi.signalstats.UHIGH", highu, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.UMAX", maxu, 0); - - av_dict_set_int(&out->metadata, "lavfi.signalstats.VMIN", minv, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.VLOW", lowv, 0); - SET_META("VAVG", "%g", 1.0 * totv / s->cfs); - av_dict_set_int(&out->metadata, "lavfi.signalstats.VHIGH", highv, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.VMAX", maxv, 0); - - av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMIN", minsat, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.SATLOW", lowsat, 0); - SET_META("SATAVG", "%g", 1.0 * totsat / s->cfs); - av_dict_set_int(&out->metadata, "lavfi.signalstats.SATHIGH", highsat, 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMAX", maxsat, 0); - - av_dict_set_int(&out->metadata, "lavfi.signalstats.HUEMED", medhue, 0); - SET_META("HUEAVG", "%g", 1.0 * tothue / s->cfs); - - SET_META("YDIF", "%g", 1.0 * dify / s->fs); - SET_META("UDIF", "%g", 1.0 * difu / s->cfs); - SET_META("VDIF", "%g", 1.0 * difv / s->cfs); - - av_dict_set_int(&out->metadata, "lavfi.signalstats.YBITDEPTH", compute_bit_depth(masky), 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.UBITDEPTH", compute_bit_depth(masku), 0); - av_dict_set_int(&out->metadata, "lavfi.signalstats.VBITDEPTH", compute_bit_depth(maskv), 0); - - for (fil = 0; fil < FILT_NUMB; fil ++) { - if (s->filters & 1<fs); - snprintf(metaname, sizeof(metaname), "lavfi.signalstats.%s", filters_def[fil].name); - av_dict_set(&out->metadata, metaname, metabuf, 0); - } - } - - if (in != out) - av_frame_free(&in); - return ff_filter_frame(outlink, out); -} - -static int filter_frame16(AVFilterLink *link, AVFrame *in) -{ - AVFilterContext *ctx = link->dst; - SignalstatsContext *s = ctx->priv; - AVFilterLink *outlink = ctx->outputs[0]; - AVFrame *out = in; - int i, j; - int w = 0, cw = 0, // in - pw = 0, cpw = 0; // prev - int fil; - char metabuf[128]; - unsigned int *histy = s->histy, - *histu = s->histu, - *histv = s->histv, - histhue[360] = {0}, - *histsat = s->histsat; - int miny = -1, minu = -1, minv = -1; - int maxy = -1, maxu = -1, maxv = -1; - int lowy = -1, lowu = -1, lowv = -1; - int highy = -1, highu = -1, highv = -1; - int minsat = -1, maxsat = -1, lowsat = -1, highsat = -1; - int lowp, highp, clowp, chighp; - int accy, accu, accv; - int accsat, acchue = 0; - int medhue, maxhue; - int64_t toty = 0, totu = 0, totv = 0, totsat=0; - int64_t tothue = 0; - int64_t dify = 0, difu = 0, difv = 0; - uint16_t masky = 0, masku = 0, maskv = 0; - - int filtot[FILT_NUMB] = {0}; - AVFrame *prev; - int ret; - AVFrame *sat = s->frame_sat; - AVFrame *hue = s->frame_hue; - const uint16_t *p_sat = (uint16_t *)sat->data[0]; - const uint16_t *p_hue = (uint16_t *)hue->data[0]; - const int lsz_sat = sat->linesize[0] / 2; - const int lsz_hue = hue->linesize[0] / 2; - ThreadDataHueSatMetrics td_huesat = { - .src = in, - .dst_sat = sat, - .dst_hue = hue, - }; - - if (!s->frame_prev) - s->frame_prev = av_frame_clone(in); - - prev = s->frame_prev; - - if (s->outfilter != FILTER_NONE) { - out = av_frame_clone(in); - if (!out) { - av_frame_free(&in); - return AVERROR(ENOMEM); - } - ret = ff_inlink_make_frame_writable(link, &out); - if (ret < 0) { - av_frame_free(&out); - av_frame_free(&in); - return ret; - } - } - - ff_filter_execute(ctx, compute_sat_hue_metrics16, &td_huesat, - NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx))); - + } else { + const uint8_t *p_sat = sat->data[0]; + const uint8_t *p_hue = hue->data[0]; + const int lsz_sat = sat->linesize[0]; + const int lsz_hue = hue->linesize[0]; // Calculate luma histogram and difference with previous frame or field. - memset(s->histy, 0, s->maxsize * sizeof(*s->histy)); for (j = 0; j < link->h; j++) { for (i = 0; i < link->w; i++) { - const int yuv = AV_RN16(in->data[0] + w + i * 2); + const int yuv = in->data[0][w + i]; masky |= yuv; histy[yuv]++; - dify += abs(yuv - (int)AV_RN16(prev->data[0] + pw + i * 2)); + dify += abs(yuv - prev->data[0][pw + i]); } w += in->linesize[0]; pw += prev->linesize[0]; } // Calculate chroma histogram and difference with previous frame or field. - memset(s->histu, 0, s->maxsize * sizeof(*s->histu)); - memset(s->histv, 0, s->maxsize * sizeof(*s->histv)); - memset(s->histsat, 0, s->maxsize * sizeof(*s->histsat)); for (j = 0; j < s->chromah; j++) { for (i = 0; i < s->chromaw; i++) { - const int yuvu = AV_RN16(in->data[1] + cw + i * 2); - const int yuvv = AV_RN16(in->data[2] + cw + i * 2); + const int yuvu = in->data[1][cw+i]; + const int yuvv = in->data[2][cw+i]; masku |= yuvu; maskv |= yuvv; histu[yuvu]++; - difu += abs(yuvu - (int)AV_RN16(prev->data[1] + cpw + i * 2)); + difu += abs(yuvu - prev->data[1][cpw+i]); histv[yuvv]++; - difv += abs(yuvv - (int)AV_RN16(prev->data[2] + cpw + i * 2)); + difv += abs(yuvv - prev->data[2][cpw+i]); histsat[p_sat[i]]++; histhue[((int16_t*)p_hue)[i]]++; @@ -874,6 +686,7 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in) p_sat += lsz_sat; p_hue += lsz_hue; } + } for (fil = 0; fil < FILT_NUMB; fil ++) { if (s->filters & 1<outfilter == fil ? out : NULL, }; memset(s->jobs_rets, 0, s->nb_jobs * sizeof(*s->jobs_rets)); - ff_filter_execute(ctx, filters_def[fil].process16, + ff_filter_execute(ctx, hbd ? filters_def[fil].process16 : filters_def[fil].process8, &td, s->jobs_rets, s->nb_jobs); for (i = 0; i < s->nb_jobs; i++) filtot[fil] += s->jobs_rets[i]; @@ -946,6 +759,11 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in) av_frame_free(&s->frame_prev); s->frame_prev = av_frame_clone(in); +#define SET_META(key, fmt, val) do { \ + snprintf(metabuf, sizeof(metabuf), fmt, val); \ + av_dict_set(&out->metadata, "lavfi.signalstats." key, metabuf, 0); \ +} while (0) + av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0); av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0); SET_META("YAVG", "%g", 1.0 * toty / s->fs); @@ -995,17 +813,6 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in) return ff_filter_frame(outlink, out); } -static int filter_frame(AVFilterLink *link, AVFrame *in) -{ - AVFilterContext *ctx = link->dst; - SignalstatsContext *s = ctx->priv; - - if (s->depth > 8) - return filter_frame16(link, in); - else - return filter_frame8(link, in); -} - static const AVFilterPad signalstats_inputs[] = { { .name = "default", From patchwork Sat May 18 15:25:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48979 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3503174pzb; Sat, 18 May 2024 08:26:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzZit9hcrxnpj/Obr1lfx7J7EWLjcLbfrrGTwixbWAdHr7w59gwoz6wkaZDvJG1Yhzzy+CJ7j/c+lKiItwm/mvsfndIPukPPzMhg== X-Google-Smtp-Source: AGHT+IFadIiznYu83WEJZXIl8TVpVG74fJe5JEHRwZPHmYTKxldNdz9aCt+rBDfRDMqBnvfVClG0 X-Received: by 2002:a50:d496:0:b0:572:42ac:9b19 with SMTP id 4fb4d7f45d1cf-5734d440712mr17055225a12.0.1716045977270; Sat, 18 May 2024 08:26:17 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5733c3271c9si11251882a12.364.2024.05.18.08.26.16; Sat, 18 May 2024 08:26: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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=J4nHNgEn; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4BDE568CE0E; Sat, 18 May 2024 18:26:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2073.outbound.protection.outlook.com [40.92.90.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB81368CF3F for ; Sat, 18 May 2024 18:26:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0Vd+iNGc3UqkGFZ4ZUbMD84COqkeMCowNDwyrNfmUCvMPLukubB/ahpESFp3lCPJfGHc30Uzh2l5F77rpqVFxN9z/k6GUE/pYCw/MmwPS0vj8dHWI1WWTzCriWIlHvU3UeWYnh5kPYjKEe5/k+LDgdfG8RGuBP6aYKsKrUcGQIFikXoqIGTpxsGl88hKY1DzV6kmUEvDlQwSZ+sSMuJcVKJzre/OAzRNP6DlWVBRRaBb9dyBJo3Xta+KVOIX2acgyx2cImjmmY8NLgBxikbcVBf0aSWtjzIH2t+xl9DucWCHyf+yFkJWC8uW0pg/pBwneFNIRZgp0ZirmqMVi8yYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=azrmyahioEQz4u3yArnCTuSXDLNpnSGSyJXYenzlC80=; b=UVowxURC8cfKsXFic/+a+WG9X0uM5PK+r3m99fckI9+pmSM8+fJG3zleflIQASfwtRDDrCj917KljF+bZ1rcNPHiRoz98LjN6H64ASabXJuOqCdqwCsQp71qQBWFt8cLh7LOqaB4sxH6SWw4D5nUqnLx0LI1qIWC5xRW//UkeFJWuK/C2SgN6G4pf/Pn0RMVzcBrH0TQXMpi5p8fq+VVfn9Un+AzG7LpcjQcSwww/XNWXvujQf2iKvkIMQjQ/2bS1jQeY7GrM7hxu3aKFPQBrdRC0CNuZSWnhxVco+ZkiWzSkAAWfBea3xy+ES2Vd4TO24tqEyl6V2CMcauEZq+YMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=azrmyahioEQz4u3yArnCTuSXDLNpnSGSyJXYenzlC80=; b=J4nHNgEnCsYhO/9+MgqfPpz39r8kaduLul98yq4G6+DuKAz5dnHUMLJLo5ei51augoIEG0m/Boin9vqMkiRTf/D1ACqSf7eEoA+UnpppQixWlj1XboDQbbIbs3XFMhJMNS86Uc3yxeD/2JORIYJdLIzj5EYLeAWD1xQiGUAP+0QioQ5gGC8b8JMFEGhPUrSh8JFlGO9Ta/yC5S5BlGOf5F0wQ9N/09S3j2Py3QAeKzthYHn1cEJzym0VyLKY+T+ycyebfUFtFC9e1UWUWAFQOLzQgcuVrUhXR/9/B0nXb+RNCXeG9alD/DiRiK2aH1k2mUz11FDkAKvQX5wIofzb7Q== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0064.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:23b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.34; Sat, 18 May 2024 15:26:06 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9%4]) with mapi id 15.20.7544.052; Sat, 18 May 2024 15:26:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 May 2024 17:25:44 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [D7pjPBSjmEZLh3Hs/zOgNIfNskd0cfC5gf56OisA0CA=] X-ClientProxiedBy: ZR0P278CA0013.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::23) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240518152544.932561-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0064:EE_ X-MS-Office365-Filtering-Correlation-Id: eb751750-8d8e-4349-deb0-08dc774ed638 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: EH/10jY2xSm9S6ktnMVyrrQ+MDEUAylIMQDza+xltu1p8LUm/oOHdbYWqlNlR/k5f7Kvc39cT718iVMRnFj67KuG65fOIfxwI61Q378SirjDn1uuf24U9hJ2I4/w2odNAebOqjqdk6zLO85EZ/URGxZHCaZ5CZ0klASa81hqjbz59fTOBs1Y3nWbAiGkp+dkR9dbV1XJE6ZQTK3Mfsehj50GenDTqcmN69dqpqHiUn09do59jBkvnNLmKPnLpdD+MUjG6CgmHQdafxlBOQDp9ULcvy8ynU3rlEhZGsGWIdnE4mlmKGKPeXBPNyupMs23rbyZlahboSadLYgvaYy3QEW/R4sJyHi1qlSDM1h+Xx2Bn1yrqfMvIddccm4M3DkXoL4gxHh4C5iJLy4qygPuPksEXXEQ50Z+DN2qoDfWEOkKd5SwLTndd0mdQfOAs9rcgktwvSZBKx1jrW0+5qHkY7gHlNoWEJO1leDwB87FGWtLNxaHJrqd9JbOdiyHPAq+q2F2Q5nEM85l8+DvMbutfd1MZIJrMwC7e4B2YdnOTYCj9LKzmud5x6VBtXuWldLcBgpRsekfdo3GhkUyv6wLVaA3ThwH7uALELBQqn30s20ZQ21/hBWL+KxCFAUq2XTV X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A1l3von+N2R+JDQetGBwhJ/hYF9QgJUQSlR7AaPKWYBF5o+0F3URHJLZo31aZGFZZWskVvA9vzIAy5Jt2ul2q4KvLOoXyo2bntCacIATd2yvCvIolm9LL/ppBY33t03wGAvGYjdhQU/u8ftpTrX0fZz8Vh8/aW1+nl0DOs5Cm7TI3P4wStc+RjazZo18fGSSD9uBrJ8/YoU/uejL+z3whmzekyzcFYbb4TrMOQRF52fPjd5wIVNYhYOGQU9k4bnk69WtPRHQOVknhZLasbvNgG+Fi7BNbspPKXsC7hRBh7zvNlBHjbmEr3TqdOvahfRMQSzHcaMEI6uCc5zVs1GPnE52AJEuUj8GsKgMrXjQYrEu+l2OfTWK62ld19CD35HN2eJXJuqB2B+jR91Ph/kptaLcDhU8cxJWBfXD567Y8UMd0HkJ9tjNMmF5JRJemia31Vy5yT10/PdL6/EAi/Qb8n6egjKICGabQPzf8ionfWJRy4e+6Xqd+Mc9dmZdOWCCCCaKuf3r1eVTNfyZowMyDCl1vE1G1awvOMN5mqeSeowJkdrYY8OAbB42ySp/i62DV3TER4nieKsiMJ5Y6K9Jm3uK2EoQMvQ5wLqTuai0HzxOcXFn8uav3KMSZyOjA4O28D6fxDzi3mgUJpn/9YAf7KoQX4zk9R5ESMSfRxqzb+0P5gy6kWW96iy/uuTNudCf0F1rPtEnoMXeI77gnsPiWhPHrqP8goclUvFzvjHQT5+gVEu4bn9weDFUIKqdRfxGHT0y1v9lhP0+JMrTaN/PJmKgMldbAybElt01EW6O3BCAex3fKISzBN3WI4RNugjOqhsxVEaYtJT+xitJ2BEcHrLfxANYIXUDzGR7umNQWuoxefIfexW/qFlyKAYKYOUiQkoWhm0zBNpNcpjHM0SWCUEgpMoRZ4lZbpaMnLC41ipki8iaSNcCnT9UHhIrJZQtoRV34XJDhXete43qmRa8P92NwwPgLh1UmnGUTQnMgfKIbiuHc1QYEA0Hw+Qnx1yiAAp5Tl48UKurB5ITjFRwuDdqOMp2YRrmPUSjYAKZs2Bou9ngB6XBrUpNepJlG21lFCYYwxqqUzIGLAT+Wh41BVRS73ngBv01eKtS4xvsu+cuRzzfzeu9U8zOgjSNHMyTPjYggW3GVrsIRiDkJr+u9kD4KtUI9KCC8edGJWnkpfpy+JYBjEYmpRRc4B0lMP7OKDcbcD7DySCaUXtlJsV6KvWg+1dAQJptyt6kwnrCW+ZwPe1TqHQZxz3v1gyYoCXZuKTYsxwQZ8LIBlKWM44QKQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb751750-8d8e-4349-deb0-08dc774ed638 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2024 15:26:06.7105 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0064 Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/vf_signalstats: Reindent after the previous commit 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Mamej4zs+6IS Also use loop scope for iterators while just at it. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_signalstats.c | 143 +++++++++++++++++------------------ 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c index 1bdc6a42ba..50c9df4298 100644 --- a/libavfilter/vf_signalstats.c +++ b/libavfilter/vf_signalstats.c @@ -544,7 +544,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) SignalstatsContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out = in; - int i, j; int w = 0, cw = 0, // in pw = 0, cpw = 0; // prev int fil; @@ -609,83 +608,83 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) memset(s->histsat, 0, s->maxsize * sizeof(*s->histsat)); if (hbd) { - const uint16_t *p_sat = (uint16_t *)sat->data[0]; - const uint16_t *p_hue = (uint16_t *)hue->data[0]; - const int lsz_sat = sat->linesize[0] / 2; - const int lsz_hue = hue->linesize[0] / 2; - // Calculate luma histogram and difference with previous frame or field. - for (j = 0; j < link->h; j++) { - for (i = 0; i < link->w; i++) { - const int yuv = AV_RN16(in->data[0] + w + i * 2); - - masky |= yuv; - histy[yuv]++; - dify += abs(yuv - (int)AV_RN16(prev->data[0] + pw + i * 2)); + const uint16_t *p_sat = (uint16_t *)sat->data[0]; + const uint16_t *p_hue = (uint16_t *)hue->data[0]; + const int lsz_sat = sat->linesize[0] / 2; + const int lsz_hue = hue->linesize[0] / 2; + // Calculate luma histogram and difference with previous frame or field. + for (int j = 0; j < link->h; j++) { + for (int i = 0; i < link->w; i++) { + const int yuv = AV_RN16(in->data[0] + w + i * 2); + + masky |= yuv; + histy[yuv]++; + dify += abs(yuv - (int)AV_RN16(prev->data[0] + pw + i * 2)); + } + w += in->linesize[0]; + pw += prev->linesize[0]; } - w += in->linesize[0]; - pw += prev->linesize[0]; - } - // Calculate chroma histogram and difference with previous frame or field. - for (j = 0; j < s->chromah; j++) { - for (i = 0; i < s->chromaw; i++) { - const int yuvu = AV_RN16(in->data[1] + cw + i * 2); - const int yuvv = AV_RN16(in->data[2] + cw + i * 2); - - masku |= yuvu; - maskv |= yuvv; - histu[yuvu]++; - difu += abs(yuvu - (int)AV_RN16(prev->data[1] + cpw + i * 2)); - histv[yuvv]++; - difv += abs(yuvv - (int)AV_RN16(prev->data[2] + cpw + i * 2)); - - histsat[p_sat[i]]++; - histhue[((int16_t*)p_hue)[i]]++; + // Calculate chroma histogram and difference with previous frame or field. + for (int j = 0; j < s->chromah; j++) { + for (int i = 0; i < s->chromaw; i++) { + const int yuvu = AV_RN16(in->data[1] + cw + i * 2); + const int yuvv = AV_RN16(in->data[2] + cw + i * 2); + + masku |= yuvu; + maskv |= yuvv; + histu[yuvu]++; + difu += abs(yuvu - (int)AV_RN16(prev->data[1] + cpw + i * 2)); + histv[yuvv]++; + difv += abs(yuvv - (int)AV_RN16(prev->data[2] + cpw + i * 2)); + + histsat[p_sat[i]]++; + histhue[((int16_t*)p_hue)[i]]++; + } + cw += in->linesize[1]; + cpw += prev->linesize[1]; + p_sat += lsz_sat; + p_hue += lsz_hue; } - cw += in->linesize[1]; - cpw += prev->linesize[1]; - p_sat += lsz_sat; - p_hue += lsz_hue; - } } else { - const uint8_t *p_sat = sat->data[0]; - const uint8_t *p_hue = hue->data[0]; - const int lsz_sat = sat->linesize[0]; - const int lsz_hue = hue->linesize[0]; - // Calculate luma histogram and difference with previous frame or field. - for (j = 0; j < link->h; j++) { - for (i = 0; i < link->w; i++) { - const int yuv = in->data[0][w + i]; - - masky |= yuv; - histy[yuv]++; - dify += abs(yuv - prev->data[0][pw + i]); + const uint8_t *p_sat = sat->data[0]; + const uint8_t *p_hue = hue->data[0]; + const int lsz_sat = sat->linesize[0]; + const int lsz_hue = hue->linesize[0]; + // Calculate luma histogram and difference with previous frame or field. + for (int j = 0; j < link->h; j++) { + for (int i = 0; i < link->w; i++) { + const int yuv = in->data[0][w + i]; + + masky |= yuv; + histy[yuv]++; + dify += abs(yuv - prev->data[0][pw + i]); + } + w += in->linesize[0]; + pw += prev->linesize[0]; } - w += in->linesize[0]; - pw += prev->linesize[0]; - } - // Calculate chroma histogram and difference with previous frame or field. - for (j = 0; j < s->chromah; j++) { - for (i = 0; i < s->chromaw; i++) { - const int yuvu = in->data[1][cw+i]; - const int yuvv = in->data[2][cw+i]; - - masku |= yuvu; - maskv |= yuvv; - histu[yuvu]++; - difu += abs(yuvu - prev->data[1][cpw+i]); - histv[yuvv]++; - difv += abs(yuvv - prev->data[2][cpw+i]); - - histsat[p_sat[i]]++; - histhue[((int16_t*)p_hue)[i]]++; + // Calculate chroma histogram and difference with previous frame or field. + for (int j = 0; j < s->chromah; j++) { + for (int i = 0; i < s->chromaw; i++) { + const int yuvu = in->data[1][cw+i]; + const int yuvv = in->data[2][cw+i]; + + masku |= yuvu; + maskv |= yuvv; + histu[yuvu]++; + difu += abs(yuvu - prev->data[1][cpw+i]); + histv[yuvv]++; + difv += abs(yuvv - prev->data[2][cpw+i]); + + histsat[p_sat[i]]++; + histhue[((int16_t*)p_hue)[i]]++; + } + cw += in->linesize[1]; + cpw += prev->linesize[1]; + p_sat += lsz_sat; + p_hue += lsz_hue; } - cw += in->linesize[1]; - cpw += prev->linesize[1]; - p_sat += lsz_sat; - p_hue += lsz_hue; - } } for (fil = 0; fil < FILT_NUMB; fil ++) { @@ -697,7 +696,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) memset(s->jobs_rets, 0, s->nb_jobs * sizeof(*s->jobs_rets)); ff_filter_execute(ctx, hbd ? filters_def[fil].process16 : filters_def[fil].process8, &td, s->jobs_rets, s->nb_jobs); - for (i = 0; i < s->nb_jobs; i++) + for (int i = 0; i < s->nb_jobs; i++) filtot[fil] += s->jobs_rets[i]; } }