From patchwork Tue Feb 28 02:44:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 2694 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp1269231vsf; Mon, 27 Feb 2017 18:53:46 -0800 (PST) X-Received: by 10.28.128.147 with SMTP id b141mr8502232wmd.45.1488250425978; Mon, 27 Feb 2017 18:53:45 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t89si484205wrc.24.2017.02.27.18.53.45; Mon, 27 Feb 2017 18:53:45 -0800 (PST) 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=@gmail.com; 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=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 74DAB688321; Tue, 28 Feb 2017 04:53:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2751F6882D6 for ; Tue, 28 Feb 2017 04:53:24 +0200 (EET) Received: by mail-qk0-f196.google.com with SMTP id n127so21797807qkf.2 for ; Mon, 27 Feb 2017 18:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=WG3Jn+Oj/Jt/ys2Z9jHmp434BFo+M7E21o+LY09RTCQ=; b=ZRJNCS6amWZpK9oGofFWoIzZfhKeBS+Hmf5XteCJmxIAE2fjt2xzx6rJRf1zmWQKbs volQKkD9lLwOIyDZRzaxvaNWDQDsmcncDtdM/wb79cm59ai5j57SYNyC53C/nAx47HT/ tUvLMRcLvlvL1+iXwwiWkHvJ+Mnh1k1eiOSaqY5wVLAyO1Nci+o8ueJ6y3ia0m+HJ6Qh 0Vc7PiA/xp59PEeVmJE9SVg9woFEg5BiaRgikTfnKlXO6t+w93RYUzHW7eQC98bJmTEc Sf79sgjME9udGfYjrf5AYNpm6DgM/TKJ9VLfem7BvJEoWI7G4I5wfn8jShm1zzmGgcUc sUkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=WG3Jn+Oj/Jt/ys2Z9jHmp434BFo+M7E21o+LY09RTCQ=; b=Cje4jhDxib3c/Mr9Saojyct/Gr1Uf9bFqzqM0huRv0H0e45nZlTcpNrIOCFeo67drL 7V8w8zvBWelsNPqyxYgxPMloFeZrwmwPUgPU4tnKXz9NOG5rmNy/Quk9gwSQmLOnN9fX f1H9aE3ESN0lXl2x3mgcwnSnZvsWvlhx0XwDHXqlLrAkI3SbS5YfnOWr+u2gxhkehLId tnoV80YZi7apPldmhp8z7iP/QtQD7COAE2LIi1ue/z0C02/ljIiETYmW2xmmcICU9JsX G//RbTq91t0MkyKX/XjToj+BgiPvy57r0JuECUKEDqvLpaWwEga/f3WxtHQhw7GNjGbp ORww== X-Gm-Message-State: AMke39mSylGpBZGvKMX4yP2rsMly7id/LTdNriE8+A/9OoI68CFbtec4SHDo2Q3IZrYuDw== X-Received: by 10.200.54.178 with SMTP id a47mr20639279qtc.132.1488249929314; Mon, 27 Feb 2017 18:45:29 -0800 (PST) Received: from localhost.localdomain ([181.231.62.139]) by smtp.gmail.com with ESMTPSA id a39sm192900qka.43.2017.02.27.18.45.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Feb 2017 18:45:28 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 27 Feb 2017 23:44:39 -0300 Message-Id: <20170228024439.3484-1-jamrial@gmail.com> X-Mailer: git-send-email 2.12.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mathops: make zero_extend() an alias of av_mod_uintp2() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" They both do the same thing, but the latter has arch optimized implementations. Signed-off-by: James Almer --- Alternatively, i could duplicate the optimizations from av_mod_uintp2() for zero_extend() in libavcodec/{arch}/mathops.h since the c versions differ between the two. libavcodec/mathops.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 2cc8963a98..ddaea57da8 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -146,10 +146,7 @@ static inline av_const int sign_extend(int val, unsigned bits) #endif #ifndef zero_extend -static inline av_const unsigned zero_extend(unsigned val, unsigned bits) -{ - return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); -} +#define zero_extend av_mod_uintp2 #endif #ifndef COPY3_IF_LT