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 F417A4B6EA for ; Tue, 11 Jun 2024 18:52:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A69C68D8B2; Tue, 11 Jun 2024 21:52:31 +0300 (EEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7ABB568D89E for ; Tue, 11 Jun 2024 21:52:24 +0300 (EEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-7046e87e9afso1211750b3a.0 for ; Tue, 11 Jun 2024 11:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718131942; x=1718736742; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=cc8aUGCmzIcrTj4/OJjMXXM+mG11W483AV8p7M56m9Y=; b=VaZk1Mobfiv9Up2VvWA/0I5uGfAVCK4nmDteflUqSWZLaYi1po4taPXhbdDdC/Vod1 5rwVtZSKLDSGc8mBPENEN2FDt2NaihgmlvLBYjC8jp7e8k14kbfLuR3FF0xyUw+eUwUi dRfRVjdE53TBND+GCQOzL9fhKGB/N5eRXvpooz7QGO0GIJWnIuUemn3c6FhSR8PTTsl4 x5IF1GPNiBAAuZgUe20khcCAa+luoIE1QdQfmlcyFM1pJo6gfL62985JxfGM5SpwewZe Gx8Yim8IEE/7oWZCxxPFMv4NDR2y2sBcQSO35I+QfdguFwA7g4eg4wHKrrBrpSRte0xr pTCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718131942; x=1718736742; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cc8aUGCmzIcrTj4/OJjMXXM+mG11W483AV8p7M56m9Y=; b=ekJ7vUoW9suIX3EdpPvMf3CBmZ685b9+rVkQA2zhVCo1qomEp852ouHQy/wF+0OsFg q16SOtE+jHU+VLW/Igwwzicb8J3eEMs/70y5Q+HF/KDClrsSM68gNr6ttE3RTYTu3C4X HlP3ir2/UMjqmqvESHM+lVzU2SHtNFXLSDaC8viChMNkZaSyAQsI+ht2BK6arO9ummi0 WIe/TtV2PuspluocN3nTh0bbI0NTglkNySjndSjzVmBKO7FVK7SspQ7hTLROMv5yusqE YoVKZvXXRQZgAQbQO7ABGUK7b3D6fo0t5hQrVmdHUCEw6X1yeWXqj229FqPPQRf86ggA 8fqQ== X-Gm-Message-State: AOJu0YxwBjyKMg9xQ4vW3SCUgHyXNmT+tEHQ2uo0FadSZ5WcUf4C+oOs cKiCPN3B4sKYuNYOmyH4DzsPusq6YpbH2MP17s9U+xRHDabgqKWr+Xn9dg== X-Google-Smtp-Source: AGHT+IHqVBgtYk7ECF8R8yZ0aSo+jsA5jy9ZU/bizi3DAItm1vKvlh5P9P7lHD8P5r7TkCLGKayjEA== X-Received: by 2002:a05:6a00:1989:b0:705:a0de:6155 with SMTP id d2e1a72fcca58-705a0de6553mr4888546b3a.25.1718131942141; Tue, 11 Jun 2024 11:52:22 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7f309csm104586015ad.263.2024.06.11.11.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 11:52:21 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Jun 2024 15:52:30 -0300 Message-ID: <20240611185232.5384-1-jamrial@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avutil: rename av_mod_uintp2 to av_zero_extend 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 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: It's more descriptive of what it does. Signed-off-by: James Almer --- libavutil/common.h | 16 +++++++++++++++- libavutil/version.h | 1 + libavutil/x86/intmath.h | 6 +++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/libavutil/common.h b/libavutil/common.h index 3e4c339893..acd041fb67 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -42,6 +42,7 @@ #include "attributes.h" #include "error.h" #include "macros.h" +#include "version.h" #ifdef HAVE_AV_CONFIG_H # include "config.h" @@ -122,9 +123,11 @@ #ifndef av_clip_uintp2 # define av_clip_uintp2 av_clip_uintp2_c #endif +#if FF_API_MOD_UINTP2 #ifndef av_mod_uintp2 # define av_mod_uintp2 av_mod_uintp2_c #endif +#endif #ifndef av_sat_add32 # define av_sat_add32 av_sat_add32_c #endif @@ -149,6 +152,9 @@ #ifndef av_clipd # define av_clipd av_clipd_c #endif +#ifndef av_zero_extend +# define av_zero_extend av_zero_extend_c +#endif #ifndef av_popcount # define av_popcount av_popcount_c #endif @@ -288,11 +294,19 @@ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) * @param p bit position to clip at * @return clipped value */ -static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) +static av_always_inline av_const unsigned av_zero_extend_c(unsigned a, unsigned p) { return a & ((1U << p) - 1); } +#if FF_API_MOD_UINTP2 +attribute_deprecated +static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) +{ + return av_zero_extend_c(a, p); +} +#endif + /** * Add two signed 32-bit values with saturation. * diff --git a/libavutil/version.h b/libavutil/version.h index 9d08d56884..38456affb8 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -112,6 +112,7 @@ #define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) /** * @} diff --git a/libavutil/x86/intmath.h b/libavutil/x86/intmath.h index 8a6b5ae261..821a06ab66 100644 --- a/libavutil/x86/intmath.h +++ b/libavutil/x86/intmath.h @@ -82,13 +82,13 @@ static av_always_inline av_const int ff_ctzll_x86(long long v) #if defined(__BMI2__) #if AV_GCC_VERSION_AT_LEAST(5,1) -#define av_mod_uintp2 __builtin_ia32_bzhi_si +#define av_zero_extend __builtin_ia32_bzhi_si #elif HAVE_INLINE_ASM /* GCC releases before 5.1.0 have a broken bzhi builtin, so for those we * implement it using inline assembly */ -#define av_mod_uintp2 av_mod_uintp2_bmi2 -static av_always_inline av_const unsigned av_mod_uintp2_bmi2(unsigned a, unsigned p) +#define av_zero_extend av_zero_extend_bmi2 +static av_always_inline av_const unsigned av_zero_extend_bmi2(unsigned a, unsigned p) { if (av_builtin_constant_p(p)) return a & ((1 << p) - 1); -- 2.45.2 _______________________________________________ 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".