From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 29D9C496FA for ; Sat, 18 May 2024 15:26:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 02CE068CF55; Sat, 18 May 2024 18:26:14 +0300 (EEST) 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: =?us-ascii?Q?A1l3von+N2R+JDQetGBwhJ/hYF9QgJUQSlR7AaPKWYBF5o+0F3URHJLZo31a?= =?us-ascii?Q?ZGFZZWskVvA9vzIAy5Jt2ul2q4KvLOoXyo2bntCacIATd2yvCvIolm9LL/pp?= =?us-ascii?Q?BY33t03wGAvGYjdhQU/u8ftpTrX0fZz8Vh8/aW1+nl0DOs5Cm7TI3P4wStc+?= =?us-ascii?Q?RjazZo18fGSSD9uBrJ8/YoU/uejL+z3whmzekyzcFYbb4TrMOQRF52fPjd5w?= =?us-ascii?Q?IVNYhYOGQU9k4bnk69WtPRHQOVknhZLasbvNgG+Fi7BNbspPKXsC7hRBh7zv?= =?us-ascii?Q?NlBHjbmEr3TqdOvahfRMQSzHcaMEI6uCc5zVs1GPnE52AJEuUj8GsKgMrXjQ?= =?us-ascii?Q?YrEu+l2OfTWK62ld19CD35HN2eJXJuqB2B+jR91Ph/kptaLcDhU8cxJWBfXD?= =?us-ascii?Q?567Y8UMd0HkJ9tjNMmF5JRJemia31Vy5yT10/PdL6/EAi/Qb8n6egjKICGab?= =?us-ascii?Q?QPzf8ionfWJRy4e+6Xqd+Mc9dmZdOWCCCCaKuf3r1eVTNfyZowMyDCl1vE1G?= =?us-ascii?Q?1awvOMN5mqeSeowJkdrYY8OAbB42ySp/i62DV3TER4nieKsiMJ5Y6K9Jm3uK?= =?us-ascii?Q?2EoQMvQ5wLqTuai0HzxOcXFn8uav3KMSZyOjA4O28D6fxDzi3mgUJpn/9YAf?= =?us-ascii?Q?7KoQX4zk9R5ESMSfRxqzb+0P5gy6kWW96iy/uuTNudCf0F1rPtEnoMXeI77g?= =?us-ascii?Q?nsPiWhPHrqP8goclUvFzvjHQT5+gVEu4bn9weDFUIKqdRfxGHT0y1v9lhP0+?= =?us-ascii?Q?JMrTaN/PJmKgMldbAybElt01EW6O3BCAex3fKISzBN3WI4RNugjOqhsxVEaY?= =?us-ascii?Q?tJT+xitJ2BEcHrLfxANYIXUDzGR7umNQWuoxefIfexW/qFlyKAYKYOUiQkoW?= =?us-ascii?Q?hm0zBNpNcpjHM0SWCUEgpMoRZ4lZbpaMnLC41ipki8iaSNcCnT9UHhIrJZQt?= =?us-ascii?Q?oRV34XJDhXete43qmRa8P92NwwPgLh1UmnGUTQnMgfKIbiuHc1QYEA0Hw+Qn?= =?us-ascii?Q?x1yiAAp5Tl48UKurB5ITjFRwuDdqOMp2YRrmPUSjYAKZs2Bou9ngB6XBrUpN?= =?us-ascii?Q?epJlG21lFCYYwxqqUzIGLAT+Wh41BVRS73ngBv01eKtS4xvsu+cuRzzfzeu9?= =?us-ascii?Q?U8zOgjSNHMyTPjYggW3GVrsIRiDkJr+u9kD4KtUI9KCC8edGJWnkpfpy+JYB?= =?us-ascii?Q?jEYmpRRc4B0lMP7OKDcbcD7DySCaUXtlJsV6KvWg+1dAQJptyt6kwnrCW+Zw?= =?us-ascii?Q?Pe1TqHQZxz3v1gyYoCXZuKTYsxwQZ8LIBlKWM44QKQ=3D=3D?= 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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]; } } -- 2.40.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".