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 370054B715 for ; Wed, 12 Jun 2024 01:11:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3744668D8F1; Wed, 12 Jun 2024 04:11:08 +0300 (EEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0DA9668D8A5 for ; Wed, 12 Jun 2024 04:11:02 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1f70c457823so20845825ad.3 for ; Tue, 11 Jun 2024 18:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718154659; x=1718759459; 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=jVptBv6OmaFzT6375vPWn+csq46FtdLOrXsKTIHcFnY=; b=D9hfEKZ46IdgFmEH/cN9RMy5lipOKT+NU0MI0ZXNxVvlCV+/WeT6J0mt5cPrMqrUbz /b0ks/+XMuYhO2aoZiVrQcBH9XcyF0fQZu+L8+mG1VestG4ACNabAirCJ9vNwLzM7O79 2ejj9s5Rlqngo6nOQk0qQUVJ4L4abwGk5QZ1lKA2WaCiL8hldKfS6xKkkgB/mMmzWy4o lM5J6kfE5Deu36pHo3gUsEWmuqqZJA5kp448BKXtTs3QrVEeHUl0lHr7Vi+ugUse1f3w Wcx5QEcbGidm0UIWFpV3D5fePA785zWRWzb8WrAI6AJaA0kwVSgIL+WUz1P4PbMkiVCq Od3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718154659; x=1718759459; 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=jVptBv6OmaFzT6375vPWn+csq46FtdLOrXsKTIHcFnY=; b=kOTfb8dbDKvx2MIjR7IFfzbjcs9teaHLglS41Yvb8yjS72NW06p61lwpVQOwcJ3VJ2 O7sWnVkZcMNu8OumZnLEHUwjQbDAKoAnxtGcCHzGojbvdOmnMbkBF1AIwzmJjjK/B4oT xeIJrICymDXFVmVGY00P5xCVJpS6TSb1IfEf9biXouSXLqPR/ytvNToloIixm+5H2/6Z D15YRl+vUcLdBEfY0i56mLNT4MRkOt1J6+q0d4vJyYvuve+TQoth/tSu97gRCTMNAqKb SXmhBSqxOkJEWPa8Qc/vjS6CGw9rzWWBOJQkzZxxMBPNPixbfrcEqh0x+2qEgsBs4gAV 9QoA== X-Gm-Message-State: AOJu0YwFvQI1Jy/0E/+5kQ6XF1ZAxKU5MXFetvjM6T2H+DaQCmYM47Da 2prmGkThkrSLjpRbSbE2htR34L27OpdD7g644beZSExYkchjvu0kXGk0WQ== X-Google-Smtp-Source: AGHT+IGSvX4rhnwKqgdFEJZiti5Ck8Tk/gyTqLp0KCFy5HrKyi7T4w+fkExzZziZDZBe8TM3IfuizQ== X-Received: by 2002:a17:902:ea07:b0:1f4:b2ce:8dbe with SMTP id d9443c01a7336-1f83b55fd32mr6401445ad.9.1718154658703; Tue, 11 Jun 2024 18:10:58 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f71a9beb9asm39932185ad.121.2024.06.11.18.10.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 18:10:58 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Jun 2024 22:10:59 -0300 Message-ID: <20240612011101.7641-1-jamrial@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3 v2] 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 --- TODO: Version bump doc/APIchanges | 3 +++ libavutil/common.h | 20 ++++++++++++++++---- libavutil/version.h | 1 + libavutil/x86/intmath.h | 6 +++--- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 891eaebf1a..a380e62466 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-06-12 - xxxxxxxxxx - lavu 59.22.100 - common.h + Deprecate av_mod_uintp2[_c]() and replace it with av_zero_extend[_c](). + 2024-06-08 - xxxxxxxxxx - lavc 61.7.100 - defs.h Add AV_PROFILE_AAC_USAC. diff --git a/libavutil/common.h b/libavutil/common.h index 3e4c339893..fa2333d181 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,6 @@ #ifndef av_clip_uintp2 # define av_clip_uintp2 av_clip_uintp2_c #endif -#ifndef av_mod_uintp2 -# define av_mod_uintp2 av_mod_uintp2_c -#endif #ifndef av_sat_add32 # define av_sat_add32 av_sat_add32_c #endif @@ -149,6 +147,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 +289,22 @@ 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 +#ifndef av_mod_uintp2 +# define av_mod_uintp2 av_mod_uintp2_c +#endif +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".