From patchwork Sun Jan 8 13:14:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Steinar H. Gunderson" X-Patchwork-Id: 2150 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp7235685vsb; Mon, 9 Jan 2017 13:20:16 -0800 (PST) X-Received: by 10.223.169.115 with SMTP id u106mr953305wrc.54.1483996816494; Mon, 09 Jan 2017 13:20:16 -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 n6si11158397wmn.62.2017.01.09.13.20.16; Mon, 09 Jan 2017 13:20:16 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 45FC068A215; Mon, 9 Jan 2017 23:20:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [193.35.52.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E7A8E68A201 for ; Mon, 9 Jan 2017 23:19:59 +0200 (EET) Received: from pannekake.samfundet.no ([2001:67c:29f4::50] ident=unknown) by cassarossa.samfundet.no with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <63a77aee0a522f2037f0217aee7b3af29aeb26be@pannekake.samfundet.no>) id 1cQhMM-0000hU-FS for ffmpeg-devel@ffmpeg.org; Mon, 09 Jan 2017 22:20:06 +0100 Received: from sesse by pannekake.samfundet.no with local (Exim 4.84_2) (envelope-from <63a77aee0a522f2037f0217aee7b3af29aeb26be@pannekake.samfundet.no>) id 1cQhMM-0003cH-D2 for ffmpeg-devel@ffmpeg.org; Mon, 09 Jan 2017 22:20:06 +0100 From: "Steinar H. Gunderson" Date: Sun, 8 Jan 2017 14:14:54 +0100 To: ffmpeg-devel@ffmpeg.org Message-Id: Subject: [FFmpeg-devel] [PATCH v4 1/2] Move bitswap_32() into a header file. 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" Allows more codecs than mpeg12video to make use of it. --- libavcodec/bitstream.c | 8 -------- libavcodec/mathops.h | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 6c8dca1d85..c26650099f 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static) return index; } -static av_always_inline uint32_t bitswap_32(uint32_t x) -{ - return (uint32_t)ff_reverse[ x & 0xFF] << 24 | - (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 | - (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 | - (uint32_t)ff_reverse[ x >> 24]; -} - typedef struct VLCcode { uint8_t bits; uint16_t symbol; diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 5168dc2ce0..958132d897 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -249,4 +249,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a) return b.s8; } +static av_always_inline uint32_t bitswap_32(uint32_t x) +{ + return (uint32_t)ff_reverse[ x & 0xFF] << 24 | + (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 | + (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 | + (uint32_t)ff_reverse[ x >> 24]; +} + #endif /* AVCODEC_MATHOPS_H */