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 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Fsfw5Ek2YfD2WlgVge37e0GskHX8PSNg4nubebtbLwd57lIBKnwb2L5ivZBv9EP+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<