From patchwork Mon Jan 7 11:40:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ross X-Patchwork-Id: 11667 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 21F4644DEB2 for ; Mon, 7 Jan 2019 13:40:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAEC668A554; Mon, 7 Jan 2019 13:40:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx.sdf.org (mx.sdf.org [205.166.94.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BACD68A45B for ; Mon, 7 Jan 2019 13:40:19 +0200 (EET) Received: from a5e5c1e55c9574f03ce1000bf98294bc (pa49-199-3-1.pa.vic.optusnet.com.au [49.199.3.1]) (authenticated (128 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x07BeGus015867 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO) for ; Mon, 7 Jan 2019 11:40:25 GMT Authentication-Results: mx.sdf.org; dkim=none Date: Mon, 7 Jan 2019 22:40:11 +1100 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: <235e43fdd4219e61a5ac3f2ca7b5b3c92e2602ac.1546860888.git.pross@xvid.org> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [FFmpeg-devel] [PATCH 1/2] intreadwrite: add AV_RL64A, AV_WL64A 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" macros for reading and writing 64-bit aligned little-endian values. these macros are used by the DST decoder and give a performance boost on big-endian platforms that where the compiler must normally guard against unaligned memory access. --- libavutil/intreadwrite.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index 67c763b135..4c8413a536 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -542,6 +542,21 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; # define AV_WN64A(p, v) AV_WNA(64, p, v) #endif +#if AV_HAVE_BIGENDIAN +# define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p)) +# define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +#else +# define AV_RLA(s, p) AV_RN##s##A(p) +# define AV_WLA(s, p, v) AV_WN##s##A(p, v) +#endif + +#ifndef AV_RL64A +# define AV_RL64A(p) AV_RLA(64, p) +#endif +#ifndef AV_WL64A +# define AV_WL64A(p, v) AV_WLA(64, p, v) +#endif + /* * The AV_COPYxxU macros are suitable for copying data to/from unaligned * memory locations.