From patchwork Thu Mar 28 23:10:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47616 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp1667370pzb; Thu, 28 Mar 2024 16:11:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUyQfwlh7vKXi8e+GTTpMvrw2bDVt6fi1sRCX/DwrgoW0/dgNT7BNJ1TgW0s8sXKvcj+ugV5XEDA0GSwM2THyFWgKfqE4/JBdblcA== X-Google-Smtp-Source: AGHT+IGXn+YR02/FZJ/X+8h+cO7OPqHH3qLJc646nD2NE3CEWZHp+g0kVrjxOHww3Jn96+Ukk9ep X-Received: by 2002:a2e:7819:0:b0:2d6:fe13:f9aa with SMTP id t25-20020a2e7819000000b002d6fe13f9aamr283816ljc.3.1711667496134; Thu, 28 Mar 2024 16:11:36 -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 z17-20020a5096d1000000b0056c5425bb88si913112eda.336.2024.03.28.16.11.28; Thu, 28 Mar 2024 16:11:36 -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=rCxYhCP3; 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 EF87068D75C; Fri, 29 Mar 2024 01:11:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2063.outbound.protection.outlook.com [40.92.90.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA47B68D74D for ; Fri, 29 Mar 2024 01:11:14 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESJRSVJs2FDNV0cV/6KZk6DLSpbeotmjCV5Bp235yTkKnSBXa2q8NrlTyYFah5peTuuUpDOBLcI7ZfEHi7sXtZ0vLMM4nIj0zfTOEOIk11944hhs/SbY3BAuOlLbEKfzRvJeIIBLxkx4C1Q3ylUFtoOlYT9XPxIgbGPV3UA29QJcAvGWFwvbexIAFUIZO0BnA+xEZqcQVodmDO0MYWwcBRu80rRuJcPFcodfH4KmvGL+NFPoL5e/hYPGCiVRWuRAh8N4PjegaxBFY3zMW4GGnJHxiauSDm7hQXXH0lfadGJcO8b8qxhokBtzoMoDMVPW3U1TGS5NRMM+fzTmlcIcqA== 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=qDjBxnKLqS+KNwnM+8/xDmihBt0tREv9G82JmAA08Dk=; b=RzKJv01KkGetMubDBu6+AtTTAUs0pH0Xb2jam7Pvyh8RGW//50iltGKQeEdZG/VYa5Jj6uKYwWmJ5qdlBsjDNGe0YhtQ/nN/soEQ90r09y7GWn884kKT+DR13Btngkz3hfqmoCVoAMx1ODKQasTl1TYq7xWQlnlmkGhwq9dd4wYLZh2qRi/6gdHqLmOCpKLYRaP2OAjqJr1vPM9Xu5v1x26yJkZ63+k9KG4B9YyGmufrBR919xRPO7dECE3FdVQoKR9ksjGO0Mk9LNpIjDeNCy76H1kwfQq6l+kdF8tPEmaTK/0veFXqSPMP4LR+tR0xMhOTVWqXZSbfYE8w+8hzpQ== 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=qDjBxnKLqS+KNwnM+8/xDmihBt0tREv9G82JmAA08Dk=; b=rCxYhCP3PBhqb2uGLx3abr/cEredV8GubyWNnl1YXS1WilQvZqahdMU5qM0EoZqPQXDc/vQ94E69mEtpO6owxi6k3+rUlwh3ajQdMP+WxoTD9cxSpc3elUqpzP3Zpn7tW6+zDdSmu3GitbKt2X8C+gJBFCil1ft3lxQI6dX9iYZNxS+IzcGYZQY7Vt+TII8DTGFGTtz1iC/NV4/jistbPe16GsRhL+KvVFpqCOnTb9MtZDva1mtDjP4zSduDnvZ4aQ0nl4sFrEKIlLHBcoQmQuBU493aILPC6IGr0wYbcMx6WmuIG1lC/Zs2KFqXUUKOXGDic2Wi8CB24Sak/8bz1w== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS1P250MB0553.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:4af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Thu, 28 Mar 2024 23:11:09 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb%3]) with mapi id 15.20.7409.039; Thu, 28 Mar 2024 23:11:09 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Mar 2024 00:10:33 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [f7d3HIP1VVbmmexS6+Kfpf9QcFnVEjOf+4ZiJ3+d0mw=] X-ClientProxiedBy: ZR0P278CA0093.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240328231047.2202386-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS1P250MB0553:EE_ X-MS-Office365-Filtering-Correlation-Id: 74b26ff2-7f4d-4517-a6dc-08dc4f7c5aa2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kkoQhtBMbDWKbSEi6S6uVjthOrFgp6tYZ6T2QIJVoJE+Yh1fHruVw6qQAUvsHXaqE4Vl11zExbS5/7rxgIh0v5nVqdLEoywHIBaiItQyOS2JtyEHgMekTrK9FqF0seZ35K6i39G1g4iX59H879EVtqcClgnU/DNJtm5fe6brvnR6zKdOxfVOq/sLlbtdRyJYoYJwyZ4SzdF4OPTKn/nr+4RJof5/4NtJzGFBV/jL/+U8EDdqm6vbBQOAoCmPgRfItlkkXqmeygtH6ivkjDLl5WSv82i+45gmlHW8e+9QPlmBj16/16YDGoHkDgujdXnJvILDtQe7s+jcJKpXD5Oy8MTLjeLBXstx9tIWxTZqK7MegoA51g2epBhS5o1MAkSUHDXwfDEKDbZO4YyWgi1uQRCBxvlxHBxmGclbq/b0q4e3tDQP30SakDknTWgz0UbiCAHdO9nykfwtOGBCnuV7CULQAQWrEILQOGmYwZiyC/Aw07ShxgsqWgyp1AnnJbipY7h8Lg+HDyXHPNoEfL0/ZpZ0gzQ/IE2WODVszLzl4Dm6rTMDP+w3ZJS9qsCV4PYgiSiYweU51kWpbQ960UYqMs77vqquwcBNcajhXJ9t5BVrm4DYNJ6YKR+6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v79DUCNW33yr18X5Npt7xo5cvocqJzH2e7ziNcYkzf+kkF0/wJCpMeOj1/63iHWHEG7fIYFkUKDMlhnSMOm9w6dqLORWY+sIY/vgwEi3uix0SANi4RdtoaLnEbq2GF+RtjLRPG62TiCFWkPKp2VCiER+MDmXSnfSiNL4jxgyBxJsgVK8zt3UOQkUm4xQE15o11GBN3Pjfcsv9PqNC/rwfW+UdygKq8BZZ5LuwGnn6eY5IO2PtWTQZ3i0Jgbo93IePgb6fVJEHkAkyhFlyI37VFEN5apmnnaCsyBALWRdmpQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74b26ff2-7f4d-4517-a6dc-08dc4f7c5aa2 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 23:11:09.6490 (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: AS1P250MB0553 Subject: [FFmpeg-devel] [PATCH 04/18] swscale/ppc/swscale_altivec: Simplify macro 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: edygvUd9bja8 Signed-off-by: Andreas Rheinhardt --- libswscale/ppc/swscale_altivec.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index 8e35e0372f..9bf72738df 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -109,17 +109,12 @@ #define SHIFT 3 -#define output_pixel(pos, val, bias, signedness) \ - if (big_endian) { \ - AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \ - } else { \ - AV_WL16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \ - } +#define get_pixel(val, bias, signedness) \ + (bias + av_clip_ ## signedness ## 16(val >> shift)) static void yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start) { - static const int big_endian = HAVE_BIGENDIAN; static const int shift = 3; static const float float_mult = 1.0f / 65535.0f; int i, val; @@ -127,7 +122,7 @@ yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start) for (i = start; i < dstW; ++i){ val = src[i] + (1 << (shift - 1)); - output_pixel(&val_uint, val, 0, uint); + val_uint = get_pixel(val, 0, uint); dest[i] = float_mult * (float)val_uint; } } @@ -135,7 +130,6 @@ yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start) static void yuv2plane1_float_bswap_u(const int32_t *src, uint32_t *dest, int dstW, int start) { - static const int big_endian = HAVE_BIGENDIAN; static const int shift = 3; static const float float_mult = 1.0f / 65535.0f; int i, val; @@ -143,7 +137,7 @@ yuv2plane1_float_bswap_u(const int32_t *src, uint32_t *dest, int dstW, int start for (i = start; i < dstW; ++i){ val = src[i] + (1 << (shift - 1)); - output_pixel(&val_uint, val, 0, uint); + val_uint = get_pixel(val, 0, uint); dest[i] = av_bswap32(av_float2int(float_mult * (float)val_uint)); } }