From patchwork Wed Aug 10 20:47:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 37223 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp1142415pzi; Wed, 10 Aug 2022 13:48:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR7PYVLjNak6zBgwgdjcMq2ahooNAvHXUwfHWUu3S35LAB8JUK+orTXhFVkbeT2AyP5R/FMo X-Received: by 2002:a17:907:da2:b0:731:60e4:2261 with SMTP id go34-20020a1709070da200b0073160e42261mr10803063ejc.679.1660164488654; Wed, 10 Aug 2022 13:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660164488; cv=none; d=google.com; s=arc-20160816; b=xdjSDEiXyLvk8iepzCBdP2lTKpQlMsm8rndIBe7J9j1iCwk3QHWCvpd/R4Dp7MBnLA DUPH0FC1OSh/HEFMS/0y//GW2C5PxAihkY/OwK7qgPsJFI0na+cjk+Kt3m9cpSFimZC5 MiOwAFAwnJyOxd5MmOtPd4OZ9iGYoZByLieC+fzlVlDoUCw0ISzwtEKM9kUu8tKY+pzM uC+aWwWrXl23+TxFgsuoe/8M2m6Y9yhDptKcCJ959IepLizDMHR7gBFOF+pU7V7lEkTO jBkQqJ3PMOC7gdMIcSRNvKIuR3ja8x/RXjIzaqmWtQ4v9LzNkjMR2TdD4BLM2atEwSqP 7KpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=KGzEnEwzbqen9iKksD8wcq87gmGrd6QN9eNV2fBGpUc=; b=icNvGxB4IYBYE+B3y73IRVNenGt54kZsfveQt7pMSggB1BiGAAkfiX/M1lDWx0+oB1 nE9D9Xg5MkJtPiljyD86DLONa+0QkIWSL4UnMb/gQcl/pSEdORNmullYzQ0FrOjR0izS ecPY4W5BNplYbXRl9tXfKsL28t6BaN38QkoMQatFxtZmDrm0nurL93YYlX6C9n+VkOl0 RAVTJ94YXHUM7HlMuq4QeDG7291q0yoN75togSxrSFUwD/lcQG7Sc5/X0nCq+mbZI+Pk Jn2Eltkmz/guCgfyfdY186iuWP6qiCkGsnNyD+zjX9oTuEl8pBeaFbGxXKlrRZO4o1Nd oekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=PVZYwObf; 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=rothenpieler.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dd7-20020a1709069b8700b0073045237fd2si5745399ejc.751.2022.08.10.13.48.08; Wed, 10 Aug 2022 13:48:08 -0700 (PDT) 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=@rothenpieler.org header.s=mail header.b=PVZYwObf; 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=rothenpieler.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 62D7368B89B; Wed, 10 Aug 2022 23:47:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B3B7968B81D for ; Wed, 10 Aug 2022 23:47:25 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id E77B12F260B; Wed, 10 Aug 2022 22:47:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1660164445; bh=hIA6fXAMgpIjKVN47QgW6IcamIRVV4SEKeeSRuuBMr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PVZYwObfvFSW8nSEU0tr9oJNRbsTLTYyxMdXQj7et4fZ8k/QAHBGL6Oe9wquPOlK+ P2ijHzZaBN14wq3/jPccEl38Ck4rr/0+iJ18BWL5fRLCN4toaR43ls0ttw8aeEqdKe PENeCddnqd68ZUVEncKPJ0/9lL/3G3mVPtYpOaPylvTf4i1KjVYkZn+HQawTWAeEMJ N1F1ouC2fpS0/COlvFwYFiDFAPPwIbYBN+dHTIIaYYxkDefwgrpw3g2Hjh+oAiYTQU r0da7SwHNfGAmlXhigFbNrp2LkGDO53OX18//fGYQDvqtGZrgoiG3LgVaQMlV93i3D 58XWXEItjQTPg== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Aug 2022 22:47:06 +0200 Message-Id: <20220810204712.3123-5-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810204712.3123-1-timo@rothenpieler.org> References: <20220810204712.3123-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/11] avutil: move half-precision float helper to avutil 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 Cc: Timo Rothenpieler Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7sSmrOL2dAQX --- libavcodec/exr.c | 2 +- libavcodec/exrenc.c | 2 +- libavcodec/pnmdec.c | 3 ++- libavcodec/pnmenc.c | 2 +- {libavcodec => libavutil}/float2half.h | 6 +++--- {libavcodec => libavutil}/half2float.h | 6 +++--- 6 files changed, 11 insertions(+), 10 deletions(-) rename {libavcodec => libavutil}/float2half.h (96%) rename {libavcodec => libavutil}/half2float.h (96%) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 3a6b9c3014..5c6ca9adbf 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -41,6 +41,7 @@ #include "libavutil/avstring.h" #include "libavutil/opt.h" #include "libavutil/color_utils.h" +#include "libavutil/half2float.h" #include "avcodec.h" #include "bytestream.h" @@ -53,7 +54,6 @@ #include "exrdsp.h" #include "get_bits.h" #include "internal.h" -#include "half2float.h" #include "mathops.h" #include "thread.h" diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c index 8cf7827bb6..56c084d483 100644 --- a/libavcodec/exrenc.c +++ b/libavcodec/exrenc.c @@ -31,11 +31,11 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" enum ExrCompr { EXR_RAW, diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 130407df25..9383dc8e60 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -21,12 +21,13 @@ #include "config_components.h" +#include "libavutil/half2float.h" + #include "avcodec.h" #include "codec_internal.h" #include "internal.h" #include "put_bits.h" #include "pnm.h" -#include "half2float.h" static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval) { diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index b16c93c88f..7ce534d06e 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -24,10 +24,10 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" typedef struct PHMEncContext { uint16_t basetable[512]; diff --git a/libavcodec/float2half.h b/libavutil/float2half.h similarity index 96% rename from libavcodec/float2half.h rename to libavutil/float2half.h index e05125088c..d6aaab8278 100644 --- a/libavcodec/float2half.h +++ b/libavutil/float2half.h @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_FLOAT2HALF_H -#define AVCODEC_FLOAT2HALF_H +#ifndef AVUTIL_FLOAT2HALF_H +#define AVUTIL_FLOAT2HALF_H #include @@ -64,4 +64,4 @@ static uint16_t float2half(uint32_t f, uint16_t *basetable, uint8_t *shifttable) return h; } -#endif /* AVCODEC_FLOAT2HALF_H */ +#endif /* AVUTIL_FLOAT2HALF_H */ diff --git a/libavcodec/half2float.h b/libavutil/half2float.h similarity index 96% rename from libavcodec/half2float.h rename to libavutil/half2float.h index 7df6747e50..1f6deade07 100644 --- a/libavcodec/half2float.h +++ b/libavutil/half2float.h @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_HALF2FLOAT_H -#define AVCODEC_HALF2FLOAT_H +#ifndef AVUTIL_HALF2FLOAT_H +#define AVUTIL_HALF2FLOAT_H #include @@ -71,4 +71,4 @@ static uint32_t half2float(uint16_t h, const uint32_t *mantissatable, const uint return f; } -#endif /* AVCODEC_HALF2FLOAT_H */ +#endif /* AVUTIL_HALF2FLOAT_H */